Change tests that import partially valid keys to use --quiet

When `rpmkey --import` is given a partially valid key, it may emit
warnings, which are backend dependent.  This is currently the case
with the Sequoia, but not the internal OpenPGP parser.

The lints make the tests more fragile.  Moreover, the tests aren't
checking the warnings, but other behavior.  Suppress the warnings by
passing `--quiet` to `rpmkeys`.

Fixes #2071.
This commit is contained in:
Neal H. Walfield 2022-05-13 12:30:01 +02:00 committed by Panu Matilainen
parent 866a235441
commit f439f246b5
1 changed files with 6 additions and 6 deletions

View File

@ -323,7 +323,7 @@ RPMDB_INIT
echo Checking package before importing key: echo Checking package before importing key:
runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm; echo $? runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm; echo $?
echo Importing key: echo Importing key:
runroot rpmkeys --import /data/keys/alice.asc; echo $? runroot rpmkeys --quiet --import /data/keys/alice.asc; echo $?
echo Checking for key: echo Checking for key:
runroot rpm -qi gpg-pubkey-eb04e625-* | grep Version | head -n1 runroot rpm -qi gpg-pubkey-eb04e625-* | grep Version | head -n1
echo Checking package after importing key: echo Checking package after importing key:
@ -388,7 +388,7 @@ RPMDB_INIT
echo Checking package before importing key: echo Checking package before importing key:
runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm; echo $? runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm; echo $?
echo Importing key: echo Importing key:
runroot rpmkeys --import /data/keys/alice-expired-subkey.asc; echo $? runroot rpmkeys --quiet --import /data/keys/alice-expired-subkey.asc; echo $?
echo Checking for key: echo Checking for key:
runroot rpm -qi gpg-pubkey-eb04e625-* | grep Version | head -n1 runroot rpm -qi gpg-pubkey-eb04e625-* | grep Version | head -n1
echo Checking package after importing key: echo Checking package after importing key:
@ -455,7 +455,7 @@ RPMDB_INIT
echo Checking package before importing key: echo Checking package before importing key:
runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm; echo $? runroot rpmkeys --define '_pkgverify_level all' -Kv /data/RPMS/hello-2.0-1.x86_64-signed-with-subkey.rpm; echo $?
echo Importing key: echo Importing key:
runroot rpmkeys --import /data/keys/alice-revoked-subkey.asc; echo $? runroot rpmkeys --quiet --import /data/keys/alice-revoked-subkey.asc; echo $?
echo Checking for key: echo Checking for key:
runroot rpm -qi gpg-pubkey-eb04e625-* | grep Version | head -n1 runroot rpm -qi gpg-pubkey-eb04e625-* | grep Version | head -n1
echo Checking package after importing key: echo Checking package after importing key:
@ -522,7 +522,7 @@ RPMDB_INIT
# The internal OpenPGP implementation checks for validity when the key # The internal OpenPGP implementation checks for validity when the key
# is imported; other implementations should not do this. # is imported; other implementations should not do this.
AT_CHECK_UNQUOTED([ AT_CHECK_UNQUOTED([
runroot rpmkeys --import /data/keys/CVE-2021-3521-badbind.asc runroot rpmkeys --quiet --import /data/keys/CVE-2021-3521-badbind.asc
echo exit code: $? >&2 echo exit code: $? >&2
], ],
[ignore], [ignore],
@ -537,7 +537,7 @@ fi`]
) )
AT_CHECK_UNQUOTED([ AT_CHECK_UNQUOTED([
runroot rpmkeys --import /data/keys/CVE-2021-3521-nosubsig.asc runroot rpmkeys --quiet --import /data/keys/CVE-2021-3521-nosubsig.asc
echo exit code: $? >&2 echo exit code: $? >&2
], ],
[ignore], [ignore],
@ -552,7 +552,7 @@ fi`]
) )
AT_CHECK_UNQUOTED([ AT_CHECK_UNQUOTED([
runroot rpmkeys --import /data/keys/CVE-2021-3521-nosubsig-last.asc runroot rpmkeys --quiet --import /data/keys/CVE-2021-3521-nosubsig-last.asc
echo exit code: $? >&2 echo exit code: $? >&2
], ],
[ignore], [ignore],