Skip to contentSkip to conversation

oeqa/selftest/gotoolchain: Fix temp file cleanup

PATCH New Richard Purdie 1 participant 1 message Sep 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/selftest/gotoolchain: Fix temp file cleanup

The go tests leave readonly files and directories behind. Fix this to allow cleanup.

[YOCTO #14575]

---
 meta/lib/oeqa/selftest/cases/gotoolchain.py | 4 ++++
 1 file changed, 4 insertions(+)
meta/lib/oeqa/selftest/cases/gotoolchain.py +4 -0
index 4fc3605f42f..d1fe9b297c7 100644
@@ -43,6 +43,10 @@ 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:
+                os.chmod(os.path.join(dirpath, filename), 0o775)
         shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
         super(oeGoToolchainSelfTest, cls).tearDownClass()
 
Signature · 1 line
2.32.0