mirror of
https://git.yoctoproject.org/poky
synced 2026-04-30 03:32:12 +02:00
selftest/cases/signing: 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'
[YOCTO #11821]
(From OE-Core rev: 7e3a7cd2426feac757def81850dc44156cd0f33e)
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
fae168d288
commit
f44dfe63a4
@@ -22,14 +22,17 @@ class Signing(OESelftestTestCase):
|
||||
if not shutil.which("gpg"):
|
||||
raise AssertionError("This test needs GnuPG")
|
||||
|
||||
cls.gpg_home_dir = tempfile.TemporaryDirectory(prefix="oeqa-signing-")
|
||||
cls.gpg_dir = cls.gpg_home_dir.name
|
||||
cls.gpg_dir = tempfile.mkdtemp(prefix="oeqa-signing-")
|
||||
|
||||
cls.pub_key_path = os.path.join(cls.testlayer_path, 'files', 'signing', "key.pub")
|
||||
cls.secret_key_path = os.path.join(cls.testlayer_path, 'files', 'signing', "key.secret")
|
||||
|
||||
runCmd('gpg --batch --homedir %s --import %s %s' % (cls.gpg_dir, cls.pub_key_path, cls.secret_key_path))
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
shutil.rmtree(cls.gpg_dir, ignore_errors=True)
|
||||
|
||||
@OETestID(1362)
|
||||
def test_signing_packages(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user