* [PATCH] oeqa/selftest/signing: use temporary rpmdb
@ 2016-01-20 13:08 Markus Lehtonen
0 siblings, 0 replies; only message in thread
From: Markus Lehtonen @ 2016-01-20 13:08 UTC (permalink / raw)
To: openembedded-core
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"
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
meta/lib/oeqa/selftest/signing.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/selftest/signing.py b/meta/lib/oeqa/selftest/signing.py
index c33662b..c402e37 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
import os
import glob
import re
+import shutil
+import tempfile
from oeqa.utils.decorators import testcase
@@ -69,11 +71,17 @@ class Signing(oeSelfTest):
pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm')))
- runCmd('%s/rpm --import %s%s' % (staging_bindir_native, self.gpg_dir, self.pub_key_name))
+ # Use a temporary rpmdb
+ rpmdb = tempfile.mkdtemp(prefix='oeqa-rpmdb')
- ret = runCmd('%s/rpm --checksig %s' % (staging_bindir_native, pkg_deploy))
+ runCmd('%s/rpm --define "_dbpath %s" --import %s%s' %
+ (staging_bindir_native, rpmdb, self.gpg_dir, self.pub_key_name))
+
+ ret = runCmd('%s/rpm --define "_dbpath %s" --checksig %s' %
+ (staging_bindir_native, rpmdb, pkg_deploy))
# tmp/deploy/rpm/i586/ed-1.9-r0.i586.rpm: rsa sha1 md5 OK
self.assertIn('rsa sha1 md5 OK', ret.output, 'Package signed incorrectly.')
+ shutil.rmtree(rpmdb)
@testcase(1382)
def test_signing_sstate_archive(self):
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-01-20 13:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20 13:08 [PATCH] oeqa/selftest/signing: use temporary rpmdb Markus Lehtonen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.