]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-releasefile-verification
test, travis: Quieter testing with a new -qq mode
[apt.git] / test / integration / test-releasefile-verification
index 82e48ffa8d69304a978a9ac2b60e7cfc43449537..e043fa8b5f41a8153c38ad7a12d281e08fe74681 100755 (executable)
@@ -12,8 +12,6 @@ buildaptarchive
 setupflataptarchive
 changetowebserver
 
-webserverconfig 'aptwebserver::support::range' 'false'
-
 prepare() {
        local DATE="${2:-now}"
        if [ "$DATE" = 'now' ]; then
@@ -109,6 +107,19 @@ runtest() {
 " aptcache show apt
        installaptold
 
+       if [ "$(id -u)" != '0' ]; then
+               msgmsg 'Cold archive signed by' 'Joe Sixpack + unreadable key'
+               rm -rf rootdir/var/lib/apt/lists
+               echo 'foobar' > rootdir/etc/apt/trusted.gpg.d/unreadablekey.gpg
+               chmod 000 rootdir/etc/apt/trusted.gpg.d/unreadablekey.gpg
+               updatewithwarnings '^W: .* is not readable by user'
+               chmod 644 rootdir/etc/apt/trusted.gpg.d/unreadablekey.gpg
+               rm -f rootdir/etc/apt/trusted.gpg.d/unreadablekey.gpg
+               testsuccessequal "$(cat "${PKGFILE}")
+" aptcache show apt
+               installaptold
+       fi
+
        msgmsg 'Good warm archive signed by' 'Joe Sixpack'
        prepare "${PKGFILE}-new"
        signreleasefiles 'Joe Sixpack'
@@ -239,7 +250,7 @@ runtest() {
        updatewithwarnings '^W: .* NO_PUBKEY'
        sed -i "s#^\(deb\(-src\)\?\) \[signed-by=$MARVIN\] #\1 #" rootdir/etc/apt/sources.list.d/*
 
-       local MARVIN="$(aptkey --keyring $MARVIN finger | grep 'Key fingerprint' | cut -d'=' -f 2 | tr -d ' ')"
+       local MARVIN="$(aptkey --keyring $MARVIN finger --with-colons | grep '^fpr' | cut -d':' -f 10)"
        msgmsg 'Cold archive signed by bad keyid' 'Joe Sixpack'
        rm -rf rootdir/var/lib/apt/lists
        signreleasefiles 'Joe Sixpack'
@@ -263,7 +274,7 @@ runtest() {
 " aptcache show apt
        installaptold
 
-       local SIXPACK="$(aptkey --keyring keys/joesixpack.pub finger | grep 'Key fingerprint' | cut -d'=' -f 2 | tr -d ' ')"
+       local SIXPACK="$(aptkey --keyring keys/joesixpack.pub finger --with-colons | grep '^fpr' | cut -d':' -f 10)"
        msgmsg 'Cold archive signed by good keyids' 'Joe Sixpack'
        rm -rf rootdir/var/lib/apt/lists
        signreleasefiles 'Joe Sixpack'
@@ -273,7 +284,6 @@ runtest() {
 " aptcache show apt
        installaptold
 
-       local SIXPACK="$(aptkey --keyring keys/joesixpack.pub finger | grep 'Key fingerprint' | cut -d'=' -f 2 | tr -d ' ')"
        msgmsg 'Cold archive signed by good keyids' 'Joe Sixpack'
        rm -rf rootdir/var/lib/apt/lists
        sed -i "s#^\(deb\(-src\)\?\) \[signed-by=${SIXPACK},${MARVIN}\] #\1 [signed-by=${MARVIN},${SIXPACK}] #" rootdir/etc/apt/sources.list.d/*