]> git.saurik.com Git - apt.git/commitdiff
add a test for apt-key export{,all}
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 27 Jan 2014 15:59:46 +0000 (16:59 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 26 Sep 2014 22:12:14 +0000 (00:12 +0200)
Git-Dch: Ignore

cmdline/apt-key.in
test/integration/test-apt-key

index c54b608e1a1440878ad8bf0d14a450a4f8ac2e4f..a3f8dde3a385d2556213680f29533210651ac52f 100644 (file)
@@ -380,8 +380,8 @@ case "$command" in
        foreach_keyring_do 'fingerprint_keys_from_keyring' "$@"
        ;;
     export|exportall)
        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
        ;;
     adv*)
        setup_merged_keyring
index 99ce855d4a911d65bcdd70249120d34b5af99636..e863e54a42c9d118aec78482772c20d315943d8d 100755 (executable)
@@ -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'
 
        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
 
        msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
        testsuccess --nomsg aptkey --fakeroot update