From: Richard Purdie Date: Sat, 25 Sep 2021 18:02:15 +0000 (+0100) Subject: oeqa/selftest/gotoolchain: Fix temp file cleanup X-Git-Tag: yocto-3.1.12~92 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=c0d4c3f96d3b3bca55013efd0ffb1ea189bd206c;p=openembedded-core.git oeqa/selftest/gotoolchain: Fix temp file cleanup The go tests leave readonly files and directories behind. Fix this to allow cleanup. [YOCTO #14575] Signed-off-by: Richard Purdie (cherry picked from commit 5680e95d7bd9fe00a797b2d0deb8cb4790027508) Signed-off-by: Steve Sakoman --- diff --git a/meta/lib/oeqa/selftest/cases/gotoolchain.py b/meta/lib/oeqa/selftest/cases/gotoolchain.py index 3119520f0d..59f80aad28 100644 --- a/meta/lib/oeqa/selftest/cases/gotoolchain.py +++ b/meta/lib/oeqa/selftest/cases/gotoolchain.py @@ -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()