summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-08-15 14:34:57 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-16 00:03:16 +0100
commit188feb233ab3549af46cf530c0ac31f0a66ac074 (patch)
treec480af2b4eb431b16126e057dc36733b13eb29ec
parent14fc08e3b031784456575bff0aaa45dff63826ed (diff)
downloadpoky-188feb233ab3549af46cf530c0ac31f0a66ac074.tar.gz
dnf: expand dnf selftest to test signed package feeds
[YOCTO #11209] (From OE-Core rev: 4d65421f381fc69397d7c61ba76488775e83e043) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta-selftest/files/signing/key.passphrase1
-rw-r--r--meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py12
3 files changed, 15 insertions, 2 deletions
diff --git a/meta-selftest/files/signing/key.passphrase b/meta-selftest/files/signing/key.passphrase
new file mode 100644
index 0000000000..5271a52680
--- /dev/null
+++ b/meta-selftest/files/signing/key.passphrase
@@ -0,0 +1 @@
test123
diff --git a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
index 68e56f2c5e..6742e8c080 100644
--- a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
+++ b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
@@ -36,7 +36,9 @@ class DnfSelftest(DnfTest):
36 self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo") 36 self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo")
37 37
38 import re 38 import re
39 output_makecache = self.dnf('makecache') 39 # Use '-y' for non-interactive mode: automatically import the feed signing key
40 output_makecache = self.dnf('-y makecache')
41 self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg = "dnf makecache failed to synchronize repo: %s" %(output_makecache))
40 self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache)) 42 self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache))
41 43
42 output_repoinfo = self.dnf('repoinfo') 44 output_repoinfo = self.dnf('repoinfo')
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 27cf584ea5..673b1998ac 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -3,6 +3,7 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqem
3from oeqa.core.decorator.oeid import OETestID 3from oeqa.core.decorator.oeid import OETestID
4import os 4import os
5import re 5import re
6import tempfile
6 7
7class TestExport(OESelftestTestCase): 8class TestExport(OESelftestTestCase):
8 9
@@ -143,7 +144,16 @@ class TestImage(OESelftestTestCase):
143 # in at the start of the on-image test 144 # in at the start of the on-image test
144 features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n' 145 features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
145 features += 'EXTRA_IMAGE_FEATURES += "package-management"\n' 146 features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
146 features += 'PACKAGE_CLASSES = "package_rpm"' 147 features += 'PACKAGE_CLASSES = "package_rpm"\n'
148
149 # Enable package feed signing
150 self.gpg_home = tempfile.TemporaryDirectory(prefix="oeqa-feed-sign-")
151 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 features += 'INHERIT += "sign_package_feed"\n'
154 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 += 'GPG_PATH = "%s"\n' % self.gpg_home.name
147 self.write_config(features) 157 self.write_config(features)
148 158
149 # Build core-image-sato and testimage 159 # Build core-image-sato and testimage