]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 26 Sep 2021 13:36:49 +0000 (14:36 +0100)
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>
meta/lib/oeqa/selftest/cases/gotoolchain.py

index 4fc3605f42f9f16151f2b53de50363b9d1a9332c..c809d7c9b140434d6cd38ec3da15694e72c77b03 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()