diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-01-20 15:08:41 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-24 09:40:20 +0000 |
commit | a84058826d913c093f088e929cb1f34ff413fa0c (patch) | |
tree | 2384618f3e13f7476afe181499fa3aa06ee78f38 /meta/lib/oeqa | |
parent | 65c1de9763fbbd8e8533f7affb04b78154586d0d (diff) | |
download | poky-a84058826d913c093f088e929cb1f34ff413fa0c.tar.gz |
oeqa/selftest/signing: use temporary rpmdb
Use temporary rpmdb when importing gpg public key and checking rpm
signature. This patch should fix a problem where test_signing_packages()
sometimes fails with
"pmdb: BDB1540 configured environment flags incompatible with existing
environment"
(From OE-Core rev: e2ddf409f405ab570ea7f6ed87180789b3a54607)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/signing.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/signing.py b/meta/lib/oeqa/selftest/signing.py index c33662b253..c402e3709a 100644 --- a/meta/lib/oeqa/selftest/signing.py +++ b/meta/lib/oeqa/selftest/signing.py | |||
@@ -3,6 +3,8 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var | |||
3 | import os | 3 | import os |
4 | import glob | 4 | import glob |
5 | import re | 5 | import re |
6 | import shutil | ||
7 | import tempfile | ||
6 | from oeqa.utils.decorators import testcase | 8 | from oeqa.utils.decorators import testcase |
7 | 9 | ||
8 | 10 | ||
@@ -69,11 +71,17 @@ class Signing(oeSelfTest): | |||
69 | 71 | ||
70 | pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm'))) | 72 | pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm'))) |
71 | 73 | ||
72 | runCmd('%s/rpm --import %s%s' % (staging_bindir_native, self.gpg_dir, self.pub_key_name)) | 74 | # Use a temporary rpmdb |
75 | rpmdb = tempfile.mkdtemp(prefix='oeqa-rpmdb') | ||
73 | 76 | ||
74 | ret = runCmd('%s/rpm --checksig %s' % (staging_bindir_native, pkg_deploy)) | 77 | runCmd('%s/rpm --define "_dbpath %s" --import %s%s' % |
78 | (staging_bindir_native, rpmdb, self.gpg_dir, self.pub_key_name)) | ||
79 | |||
80 | ret = runCmd('%s/rpm --define "_dbpath %s" --checksig %s' % | ||
81 | (staging_bindir_native, rpmdb, pkg_deploy)) | ||
75 | # tmp/deploy/rpm/i586/ed-1.9-r0.i586.rpm: rsa sha1 md5 OK | 82 | # tmp/deploy/rpm/i586/ed-1.9-r0.i586.rpm: rsa sha1 md5 OK |
76 | self.assertIn('rsa sha1 md5 OK', ret.output, 'Package signed incorrectly.') | 83 | self.assertIn('rsa sha1 md5 OK', ret.output, 'Package signed incorrectly.') |
84 | shutil.rmtree(rpmdb) | ||
77 | 85 | ||
78 | @testcase(1382) | 86 | @testcase(1382) |
79 | def test_signing_sstate_archive(self): | 87 | def test_signing_sstate_archive(self): |