summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-01-27 16:59:46 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 00:12:14 +0200
commit38005d8b24bb81f4862d2c2a228e4a49a2af4ccd (patch)
tree62175e3b5956e8d2671430dbac6508a9b06b11a4
parentf1e1abd88a2a7f147c79b99956f88d37ab14e038 (diff)
add a test for apt-key export{,all}
Git-Dch: Ignore
-rw-r--r--cmdline/apt-key.in4
-rwxr-xr-xtest/integration/test-apt-key7
2 files changed, 9 insertions, 2 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index c54b608e1..a3f8dde3a 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -380,8 +380,8 @@ case "$command" in
foreach_keyring_do 'fingerprint_keys_from_keyring' "$@"
;;
export|exportall)
- foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/trusted.gpg"
- $GPG_CMD --keyring "${GPGHOMEDIR}/trusted.gpg" --armor --export "$@"
+ foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg"
+ $GPG_CMD --keyring "${GPGHOMEDIR}/pubring.gpg" --armor --export "$@"
;;
adv*)
setup_merged_keyring
diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key
index 99ce855d4..e863e54a4 100755
--- a/test/integration/test-apt-key
+++ b/test/integration/test-apt-key
@@ -42,6 +42,13 @@ gpg: unchanged: 1' aptkey --fakeroot update
testfileequal ./aptkey.list 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
pub 2048R/DBAC8DAE 2010-08-18'
+ msgtest 'Check that Sixpack key can be' 'exported'
+ aptkey export 'Sixpack' > aptkey.export
+ aptkey --keyring rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg exportall > aptkey.exportall
+ testsuccess --nomsg cmp aptkey.export aptkey.exportall
+ testsuccess test -s aptkey.export
+ testsuccess test -s aptkey.exportall
+
msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
testsuccess --nomsg aptkey --fakeroot update