[OE-core] [PATCH 5/5] dnf: expand dnf selftest to test signed package feeds

Markus Lehtonen markus.lehtonen at linux.intel.com
Fri Aug 11 12:54:57 UTC 2017


On 11/08/2017, 14.11, "Alexander Kanavin" <alexander.kanavin at linux.intel.com> wrote:

    On 08/11/2017 01:51 PM, Markus Lehtonen wrote:
    > --- a/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
    > +++ b/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
    > @@ -31,12 +31,24 @@ class DnfSelftest(DnfTest):
    >           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))
    > +        fixed_config += 'repo_gpgcheck=1\n'
    >           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")
    >   
    > +        # First try should fail as the gpg pubkey is not available for dnf
    >           import re
    >           output_makecache = self.dnf('makecache')
    > +        self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is not None, msg = "dnf makecache should have failed: %s" %(output_makecache))
    > +
    > +        # Add public key to dnf config -> now we should succeed
    > +        fixed_config += 'gpgkey=file:///etc/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-%s\n' % self.tc.td['DISTRO_VERSION']
    > +        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")
    > +
    > +        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')
    
    Wait a moment. If feed signing is enabled, then dnf's "repo_gpgcheck", 
    and "gpgkey" settings should be configured and working by default. You 
    shouldn't fix them after the fact in the test. Please add the necessary 
    code to insert_feeds_uris() in package_manager.py.
    
Do you think it's a safe assumption that all repos configured via PACKAGE_FEED_URIS are signed and with the same key?

Thanks,
   Markus
 





More information about the Openembedded-core mailing list