summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-09-25 14:02:46 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-26 11:05:01 +0100
commit6550d66de338ed34de536e8c79ef66135cc88317 (patch)
tree71afb1971c2d3b18f5f1b45a9f9b9f0f167b8125 /meta/lib/oeqa/selftest
parent043d9ac0ae441e9a7e2ea8934bfc595a03ef9a52 (diff)
downloadpoky-6550d66de338ed34de536e8c79ef66135cc88317.tar.gz
selftest/cases/runtime_test: ignore removal errors when cleaning temporary gpg directory
The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.browser' This is the same fix as 7e3a7cd2426feac757def81850dc44156cd0f33e, but this applies to runtime (instead of signing). [YOCTO #11821] (From OE-Core rev: f28e8131f69913ff90ed210c7a58726d3ef37db6) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 673b1998ac..7d105f2fed 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -4,6 +4,7 @@ from oeqa.core.decorator.oeid import OETestID
4import os 4import os
5import re 5import re
6import tempfile 6import tempfile
7import shutil
7 8
8class TestExport(OESelftestTestCase): 9class TestExport(OESelftestTestCase):
9 10
@@ -147,19 +148,22 @@ class TestImage(OESelftestTestCase):
147 features += 'PACKAGE_CLASSES = "package_rpm"\n' 148 features += 'PACKAGE_CLASSES = "package_rpm"\n'
148 149
149 # Enable package feed signing 150 # Enable package feed signing
150 self.gpg_home = tempfile.TemporaryDirectory(prefix="oeqa-feed-sign-") 151 self.gpg_home = tempfile.mkdtemp(prefix="oeqa-feed-sign-")
151 signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing') 152 signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing')
152 runCmd('gpg --batch --homedir %s --import %s' % (self.gpg_home.name, os.path.join(signing_key_dir, 'key.secret'))) 153 runCmd('gpg --batch --homedir %s --import %s' % (self.gpg_home, os.path.join(signing_key_dir, 'key.secret')))
153 features += 'INHERIT += "sign_package_feed"\n' 154 features += 'INHERIT += "sign_package_feed"\n'
154 features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n' 155 features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n'
155 features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase') 156 features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase')
156 features += 'GPG_PATH = "%s"\n' % self.gpg_home.name 157 features += 'GPG_PATH = "%s"\n' % self.gpg_home
157 self.write_config(features) 158 self.write_config(features)
158 159
159 # Build core-image-sato and testimage 160 # Build core-image-sato and testimage
160 bitbake('core-image-full-cmdline socat') 161 bitbake('core-image-full-cmdline socat')
161 bitbake('-c testimage core-image-full-cmdline') 162 bitbake('-c testimage core-image-full-cmdline')
162 163
164 # remove the oeqa-feed-sign temporal directory
165 shutil.rmtree(self.gpg_home, ignore_errors=True)
166
163class Postinst(OESelftestTestCase): 167class Postinst(OESelftestTestCase):
164 @OETestID(1540) 168 @OETestID(1540)
165 def test_verify_postinst(self): 169 def test_verify_postinst(self):