Bug 1464192

Summary: rpm.RPMTRANS_FLAG_TEST prevents to save newly imported gpg key
Product: [Fedora] Fedora Reporter: Jaroslav Mracek <jmracek>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: kardos.lubos, mjw, packaging-team-maint, pmatilai, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-2.6.3-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-09 16:00:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Mracek 2017-06-22 15:35:38 UTC
Description of problem:
If we use rpm.RPMTRANS_FLAG_TEST in DNF then we can successfully import gpg key (result = self._ts.pgpImportPubkey(misc.procgpgkey(info.raw_key))), but key is not available for consequent package verification. This behavior is critical for  "dnf system-upgrade download --releasever=<n+1>".
Here is dnf code where we use it with work around:
https://github.com/rpm-software-management/dnf/pull/847

Version-Release number of selected component (if applicable):
dnf-2.5.1_1-13g89ab82b.fc25.noarch
rpm-4.13.0.1-1.fc25.x86_64

How reproducible:
Everytime - use dnf with --setopt=tsflags=test for transaction that requires import of gpg key. Key is imported but package verification fails.

Steps to Reproduce:
1. Remove gpg key required for mashine
2. Run "dnf install --setopt=tsflags=test <package>"
3. Transaction fails due failed gpg verification

Actual results:
Transaction fails due failed gpg verification

Expected results:
Transaction succeed

Additional info:

Comment 1 Panu Matilainen 2017-06-27 08:30:26 UTC
RPMTRANS_FLAG_TEST allows you to test whether importing a key would work or not - in other words this is an intentional feature.

If you need to ensure import then you need to set the flags accordingly.

Comment 2 Jaroslav Mracek 2017-06-27 15:58:01 UTC
Thanks Panu :-)

Comment 3 Jaroslav Mracek 2017-06-27 16:57:32 UTC
I created a pull-request that should help (https://github.com/rpm-software-management/dnf/pull/847)

Comment 4 Fedora Update System 2017-08-07 12:51:05 UTC
dnf-2.6.3-1.fc26 dnf-plugins-extras-2.0.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4813633f96

Comment 5 Fedora Update System 2017-08-08 01:24:40 UTC
dnf-2.6.3-1.fc26, dnf-plugins-extras-2.0.2-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4813633f96

Comment 6 Fedora Update System 2017-08-09 16:00:09 UTC
dnf-2.6.3-1.fc26, dnf-plugins-extras-2.0.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.