]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest/gotoolchain: Fix temp file cleanup
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 25 Sep 2021 18:02:15 +0000 (19:02 +0100)
committerSteve Sakoman <steve@sakoman.com>
Thu, 30 Sep 2021 14:20:38 +0000 (04:20 -1000)
The go tests leave readonly files and directories behind.
Fix this to allow cleanup.

[YOCTO #14575]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5680e95d7bd9fe00a797b2d0deb8cb4790027508)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oeqa/selftest/cases/gotoolchain.py

index 3119520f0de3ddaf009008e5ef4b1c46d19f107c..59f80aad281c281beffdc10ec2cc3ba257e4fd8d 100644 (file)
@@ -43,6 +43,12 @@ class oeGoToolchainSelfTest(OESelftestTestCase):
 
     @classmethod
     def tearDownClass(cls):
+        # Go creates file which are readonly
+        for dirpath, dirnames, filenames in os.walk(cls.tmpdir_SDKQA):
+            for filename in filenames + dirnames:
+                f = os.path.join(dirpath, filename)
+                if not os.path.islink(f):
+                    os.chmod(f, 0o775)
         shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
         super(oeGoToolchainSelfTest, cls).tearDownClass()