Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Support signed RPM package feeds
@ 2017-08-11 15:35 Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 1/7] lib/oe/package_manager: re-implement rpm feed signing Markus Lehtonen
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

Second try of re-enabling signed rpm package feeds.

Changes since v1:
- enabling sign_package_feed.bbclass now causes the pubkey of the signing key
  to be installed in the image
- enabling sign_package_feed.bbclass automatically enables repo_gpgcheck (i.e.
  gpg signature check of the repo metadata) in rpm repositories added via
  PACKAGE_FEED_URIS
- dnf package feed selftest adjusted to the changes above


The following changes since commit df7f5221a56118da7654476f072c37ae1e75dc50:

  libinput: Upgrade 1.7.3 -> 1.8.1 (2017-08-09 09:25:47 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib marquiz/fixes-11209
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=marquiz/fixes-11209

Markus Lehtonen (7):
  lib/oe/package_manager: re-implement rpm feed signing
  dnf: rrecommend gnupg
  sign_package_feed.bbclass: install signing key into rootfs
  package_manager.py: enable dnf's repo_gpgcheck if feed signing is
    enabled
  oeqa: fix dnf tests
  oeqa: fix temp file handling in dnf package feed test
  dnf: expand dnf selftest to test signed package feeds

 meta-selftest/files/signing/key.passphrase         |  1 +
 .../cases/{dnf-runtime.py => dnf_runtime.py}       | 12 +++++++----
 meta/classes/sign_package_feed.bbclass             |  3 +++
 meta/lib/oe/package_manager.py                     | 24 +++++++++++++++++++---
 meta/lib/oeqa/selftest/cases/runtime_test.py       | 14 +++++++++++--
 meta/recipes-devtools/dnf/dnf_2.5.1.bb             |  2 ++
 6 files changed, 47 insertions(+), 9 deletions(-)
 create mode 100644 meta-selftest/files/signing/key.passphrase
 rename meta-selftest/lib/oeqa/runtime/cases/{dnf-runtime.py => dnf_runtime.py} (80%)

-- 
2.12.3



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/7] lib/oe/package_manager: re-implement rpm feed signing
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 2/7] dnf: rrecommend gnupg Markus Lehtonen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

[YOCTO #11209]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/lib/oe/package_manager.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 518cf8dbe3..942f2dd903 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -104,13 +104,25 @@ class Indexer(object, metaclass=ABCMeta):
 class RpmIndexer(Indexer):
     def write_index(self):
         if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-            raise NotImplementedError('Package feed signing not yet implementd for rpm')
+            signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
+        else:
+            signer = None
 
         createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
         result = create_index("%s --update -q %s" % (createrepo_c, self.deploy_dir))
         if result:
             bb.fatal(result)
 
+        # Sign repomd
+        if signer:
+            sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
+            is_ascii_sig = (sig_type.upper() != "BIN")
+            signer.detach_sign(os.path.join(self.deploy_dir, 'repodata', 'repomd.xml'),
+                               self.d.getVar('PACKAGE_FEED_GPG_NAME'),
+                               self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
+                               armor=is_ascii_sig)
+
+
 class OpkgIndexer(Indexer):
     def write_index(self):
         arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/7] dnf: rrecommend gnupg
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 1/7] lib/oe/package_manager: re-implement rpm feed signing Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 3/7] sign_package_feed.bbclass: install signing key into rootfs Markus Lehtonen
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

This makes it possible to enable 'repo_gpgcheck' in dnf.conf. That is, do
GPG signature check on repository metadata. Without gnupg dnf fails with
"error: Invalid crypto engine."

[YOCTO #11209]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/recipes-devtools/dnf/dnf_2.5.1.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/dnf/dnf_2.5.1.bb b/meta/recipes-devtools/dnf/dnf_2.5.1.bb
index cdc2a8549f..88172532bf 100644
--- a/meta/recipes-devtools/dnf/dnf_2.5.1.bb
+++ b/meta/recipes-devtools/dnf/dnf_2.5.1.bb
@@ -27,6 +27,8 @@ EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -
 
 BBCLASSEXTEND = "native nativesdk"
 RDEPENDS_${PN}_class-target += "python3-core python3-codecs python3-netclient python3-email python3-threading python3-distutils librepo python3-shell python3-subprocess libcomps libdnf python3-sqlite3 python3-compression python3-rpm python3-iniparse python3-json python3-importlib python3-curses python3-argparse python3-misc python3-gpg"
+# Recommend gnupg so that GPG signature check on repository metadata is possible
+RRECOMMENDS_${PN}_class-target += "gnupg"
 
 # Create a symlink called 'dnf' as 'make install' does not do it, but
 # .spec file in dnf source tree does (and then Fedora and dnf documentation
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/7] sign_package_feed.bbclass: install signing key into rootfs
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 1/7] lib/oe/package_manager: re-implement rpm feed signing Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 2/7] dnf: rrecommend gnupg Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 4/7] package_manager.py: enable dnf's repo_gpgcheck if feed signing is enabled Markus Lehtonen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

If package-management is enabled.

[YOCTO #11209]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/classes/sign_package_feed.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/sign_package_feed.bbclass b/meta/classes/sign_package_feed.bbclass
index 71df03bab3..f03c4802d0 100644
--- a/meta/classes/sign_package_feed.bbclass
+++ b/meta/classes/sign_package_feed.bbclass
@@ -28,6 +28,9 @@ PACKAGE_FEED_SIGN = '1'
 PACKAGE_FEED_GPG_BACKEND ?= 'local'
 PACKAGE_FEED_GPG_SIGNATURE_TYPE ?= 'ASC'
 
+# Make feed signing key to be present in rootfs
+FEATURE_PACKAGES_package-management_append = " signing-keys-packagefeed"
+
 python () {
     # Check sanity of configuration
     for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'):
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 4/7] package_manager.py: enable dnf's repo_gpgcheck if feed signing is enabled
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
                   ` (2 preceding siblings ...)
  2017-08-11 15:35 ` [PATCH v2 3/7] sign_package_feed.bbclass: install signing key into rootfs Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 5/7] oeqa: fix dnf tests Markus Lehtonen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

If package feed signing is enabled enable repo gpg signature check for
rpm repositories added via PACKAGE_FEED_URIS. This has the implication
that all repositories added via this mechanism must be signed with the
same key.

[YOCTO #11209]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta/lib/oe/package_manager.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 942f2dd903..d43d729203 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -559,6 +559,12 @@ class RpmPM(PackageManager):
         if feed_uris == "":
             return
 
+        if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+            gpg_opts = 'repo_gpgcheck=1\n'
+            gpg_opts += 'gpgkey=file://%s/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-%s\n' % (self.d.getVar('sysconfdir'), self.d.getVar('DISTRO_VERSION'))
+        else:
+            gpg_opts = ''
+
         bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d"))
         remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
         for uri in remote_uris:
@@ -569,12 +575,12 @@ class RpmPM(PackageManager):
                     repo_id   = "oe-remote-repo"  + "-".join(urlparse(repo_uri).path.split("/"))
                     repo_name = "OE Remote Repo:" + " ".join(urlparse(repo_uri).path.split("/"))
                     open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'a').write(
-                             "[%s]\nname=%s\nbaseurl=%s\n\n" % (repo_id, repo_name, repo_uri))
+                             "[%s]\nname=%s\nbaseurl=%s\n%s\n" % (repo_id, repo_name, repo_uri, gpg_opts))
             else:
                 repo_name = "OE Remote Repo:" + " ".join(urlparse(uri).path.split("/"))
                 repo_uri = uri
                 open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'w').write(
-                             "[%s]\nname=%s\nbaseurl=%s\n" % (repo_base, repo_name, repo_uri))
+                             "[%s]\nname=%s\nbaseurl=%s\n%s" % (repo_base, repo_name, repo_uri, gpg_opts))
 
     def _prepare_pkg_transaction(self):
         os.environ['D'] = self.target_rootfs
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 5/7] oeqa: fix dnf tests
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
                   ` (3 preceding siblings ...)
  2017-08-11 15:35 ` [PATCH v2 4/7] package_manager.py: enable dnf's repo_gpgcheck if feed signing is enabled Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 6/7] oeqa: fix temp file handling in dnf package feed test Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds Markus Lehtonen
  6 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

Rename one dnf runtime test that it will recognized as a python module
and thus also found by the oe test loader. Also, fix value of
TEST_SUITES in dnf selftest so that all test dependencies are satisfied
and the runtime test may be successfully run from there.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta-selftest/lib/oeqa/runtime/cases/{dnf-runtime.py => dnf_runtime.py} | 0
 meta/lib/oeqa/selftest/cases/runtime_test.py                            | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename meta-selftest/lib/oeqa/runtime/cases/{dnf-runtime.py => dnf_runtime.py} (100%)

diff --git a/meta-selftest/lib/oeqa/runtime/cases/dnf-runtime.py b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
similarity index 100%
rename from meta-selftest/lib/oeqa/runtime/cases/dnf-runtime.py
rename to meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 2a70ae15b8..07d05b5972 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -138,7 +138,7 @@ class TestImage(OESelftestTestCase):
             self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
 
         features = 'INHERIT += "testimage"\n'
-        features += 'TEST_SUITES = "ping ssh dnf-runtime"\n'
+        features += 'TEST_SUITES = "ping ssh dnf_runtime dnf.DnfBasicTest.test_dnf_help"\n'
         # We don't yet know what the server ip and port will be - they will be patched
         # in at the start of the on-image test
         features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 6/7] oeqa: fix temp file handling in dnf package feed test
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
                   ` (4 preceding siblings ...)
  2017-08-11 15:35 ` [PATCH v2 5/7] oeqa: fix dnf tests Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-11 15:35 ` [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds Markus Lehtonen
  6 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

Prevent stale temp files and a possible (if unlikely) race in tempfile
usage.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
index 123e7259f1..68e56f2c5e 100644
--- a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
+++ b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
@@ -6,6 +6,8 @@ class DnfSelftest(DnfTest):
 
     @classmethod
     def setUpClass(cls):
+        import tempfile
+        cls.temp_dir = tempfile.TemporaryDirectory(prefix="oeqa-remotefeeds-")
         cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-rootfs-repo'),
                                       cls.tc.target.server_ip)
         cls.repo_server.start()
@@ -13,6 +15,7 @@ class DnfSelftest(DnfTest):
     @classmethod
     def tearDownClass(cls):
         cls.repo_server.stop()
+        cls.temp_dir.cleanup()
 
     @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
     def test_verify_package_feeds(self):
@@ -25,11 +28,11 @@ class DnfSelftest(DnfTest):
         """
         # When we created an image, we had to supply fake ip and port
         # for the feeds. Now we can patch the real ones into the config file.
-        import tempfile
-        temp_file = tempfile.TemporaryDirectory(prefix="oeqa-remotefeeds-").name
+        temp_file = os.path.join(self.temp_dir.name, 'tmp.repo')
         self.tc.target.copyFrom("/etc/yum.repos.d/oe-remote-repo.repo", temp_file)
         fixed_config = open(temp_file, "r").read().replace("bogus_ip", self.tc.target.server_ip).replace("bogus_port", str(self.repo_server.port))
-        open(temp_file, "w").write(fixed_config)
+        with open(temp_file, "w") as f:
+            f.write(fixed_config)
         self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo")
 
         import re
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds
  2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
                   ` (5 preceding siblings ...)
  2017-08-11 15:35 ` [PATCH v2 6/7] oeqa: fix temp file handling in dnf package feed test Markus Lehtonen
@ 2017-08-11 15:35 ` Markus Lehtonen
  2017-08-14 11:16   ` Alexander Kanavin
  6 siblings, 1 reply; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-11 15:35 UTC (permalink / raw)
  To: openembedded-core

[YOCTO #12099]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 meta-selftest/files/signing/key.passphrase          |  1 +
 meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py |  3 ++-
 meta/lib/oeqa/selftest/cases/runtime_test.py        | 12 +++++++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 meta-selftest/files/signing/key.passphrase

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..8a2b3d2180 100644
--- a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
+++ b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
@@ -36,7 +36,8 @@ class DnfSelftest(DnfTest):
         self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo")
 
         import re
-        output_makecache = self.dnf('makecache')
+        output_makecache = self.dnf('-y makecache')
+        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))
         self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache))
 
         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 07d05b5972..dea18651e3 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
 from oeqa.core.decorator.oeid import OETestID
 import os
 import re
+import tempfile
 
 class TestExport(OESelftestTestCase):
 
@@ -143,7 +144,16 @@ class TestImage(OESelftestTestCase):
         # in at the start of the on-image test
         features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
         features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
-        features += 'PACKAGE_CLASSES = "package_rpm"'
+        features += 'PACKAGE_CLASSES = "package_rpm"\n'
+
+        # Enable package feed signing
+        self.gpg_home = tempfile.TemporaryDirectory(prefix="oeqa-feed-sign-")
+        signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing')
+        runCmd('gpg --batch --homedir %s --import %s' % (self.gpg_home.name, os.path.join(signing_key_dir, 'key.secret')))
+        features += 'INHERIT += "sign_package_feed"\n'
+        features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n'
+        features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase')
+        features += 'GPG_PATH = "%s"\n' % self.gpg_home.name
         self.write_config(features)
 
         # Build core-image-sato and testimage
-- 
2.12.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds
  2017-08-11 15:35 ` [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds Markus Lehtonen
@ 2017-08-14 11:16   ` Alexander Kanavin
  2017-08-14 13:23     ` Markus Lehtonen
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Kanavin @ 2017-08-14 11:16 UTC (permalink / raw)
  To: Markus Lehtonen, openembedded-core

On 08/11/2017 06:35 PM, Markus Lehtonen wrote:
>   
>           import re
> -        output_makecache = self.dnf('makecache')
> +        output_makecache = self.dnf('-y makecache')

Why add '-y'? Can you add a comment (just prior to this line) explaining 
what question dnf is asking?

> +        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))
>           self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache))
>   
>           output_repoinfo = self.dnf('repoinfo')

Do 'makecache' or 'repoinfo' print any indication that repo signing is 
in use and working correctly? Can you check for presence of that in the 
commands' output?

Alex


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds
  2017-08-14 11:16   ` Alexander Kanavin
@ 2017-08-14 13:23     ` Markus Lehtonen
  0 siblings, 0 replies; 10+ messages in thread
From: Markus Lehtonen @ 2017-08-14 13:23 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

On 14/08/2017, 14.16, "Alexander Kanavin" <alexander.kanavin@linux.intel.com> wrote:

    On 08/11/2017 06:35 PM, Markus Lehtonen wrote:
    >   
    >           import re
    > -        output_makecache = self.dnf('makecache')
    > +        output_makecache = self.dnf('-y makecache')
    
    Why add '-y'? Can you add a comment (just prior to this line) explaining 
    what question dnf is asking?

Dnf is asking whether to import the new key.

    
    > +        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))
    >           self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache))
    >   
    >           output_repoinfo = self.dnf('repoinfo')
    
    Do 'makecache' or 'repoinfo' print any indication that repo signing is 
    in use and working correctly? Can you check for presence of that in the 
    commands' output?

No


Thanks,
   Markus 




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-08-14 13:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-11 15:35 [PATCH v2 0/7] Support signed RPM package feeds Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 1/7] lib/oe/package_manager: re-implement rpm feed signing Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 2/7] dnf: rrecommend gnupg Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 3/7] sign_package_feed.bbclass: install signing key into rootfs Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 4/7] package_manager.py: enable dnf's repo_gpgcheck if feed signing is enabled Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 5/7] oeqa: fix dnf tests Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 6/7] oeqa: fix temp file handling in dnf package feed test Markus Lehtonen
2017-08-11 15:35 ` [PATCH v2 7/7] dnf: expand dnf selftest to test signed package feeds Markus Lehtonen
2017-08-14 11:16   ` Alexander Kanavin
2017-08-14 13:23     ` Markus Lehtonen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox