summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework3
-rwxr-xr-xtest/integration/test-apt-get-autoremove3
-rwxr-xr-xtest/integration/test-apt-get-install-deb26
-rwxr-xr-xtest/integration/test-apt-key24
-rwxr-xr-xtest/integration/test-apt-redirect-loop3
-rwxr-xr-xtest/integration/test-bug-605394-versioned-or-groups4
-rwxr-xr-xtest/integration/test-bug-722207-print-uris-even-if-very-quiet2
-rwxr-xr-xtest/integration/test-handle-redirect-as-used-mirror-change6
-rwxr-xr-xtest/integration/test-releasefile-verification13
9 files changed, 79 insertions, 5 deletions
diff --git a/test/integration/framework b/test/integration/framework
index c513ed12c..62720fedd 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -914,6 +914,7 @@ Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb"
test -z "$DEPENDENCIES" || printf "%b\n" "$DEPENDENCIES"
echo "Description: $(printf '%s' "$DESCRIPTION" | head -n 1)"
echo "Description-md5: $(printf '%s' "$DESCRIPTION" | md5sum | cut -d' ' -f 1)"
+ echo "SHA256: 0000000000000000000000000000000000000000000000000000000000000000"
echo
} >> "${PPATH}/Packages"
done
@@ -2032,7 +2033,7 @@ testaptautotestnodpkgwarning() {
if expr match "$2" '^-dy\?' >/dev/null 2>&1; then return; fi # download-only mode
shift
done
- testfailure grep '^dpkg: warning:.*ignor.*' "${TMPWORKINGDIRECTORY}/rootdir/tmp-before/${TESTCALL}.output"
+ testfailure grep '^dpkg: warning:.*\(ignor\|unknown\).*' "${TMPWORKINGDIRECTORY}/rootdir/tmp-before/${TESTCALL}.output"
}
aptautotest_aptget_install() { testaptautotestnodpkgwarning "$@"; }
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove
index cfee748af..8af864acb 100755
--- a/test/integration/test-apt-get-autoremove
+++ b/test/integration/test-apt-get-autoremove
@@ -152,3 +152,6 @@ Remv foo-multi2-1 [1]
Remv foo-multi2-2 [1]
Remv foo-plus-1 [1]
Remv foo-plus-2 [1]' apt autoremove -s
+
+testdpkgstatus 'pi' '1' 'unrelated'
+testsuccess apt purge unrelated -y
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb
index 5f2877dfd..7baaf0ee5 100755
--- a/test/integration/test-apt-get-install-deb
+++ b/test/integration/test-apt-get-install-deb
@@ -168,3 +168,29 @@ testsuccess apt show --with-source ./Packages pkg-as-it-should-be
testequal 'Package: pkg-as-it-should-be' head -n1 rootdir/tmp/testsuccess.output
testsuccess apt install -y --with-source ./Packages pkg-as-it-should-be
testdpkginstalled 'pkg-as-it-should-be'
+rm -f ./Packages
+
+echo 'dpkg::install::recursive "true";
+dpkg::install::recursive::force "true";
+dpkg::install::recursive::minimum "0";' > rootdir/etc/apt/apt.conf.d/lowerminimum.conf
+mv ./incoming/pkg-as-it-should-be_0_all.deb ./incoming/pkg-as-it-should-be_0_all.ddeb
+testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.ddeb --reinstall
+testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
+testsuccess apt purge -y pkg-as-it-should-be
+testdpkgnotinstalled 'pkg-as-it-should-be'
+
+mv ./incoming/pkg-as-it-should-be_0_all.ddeb ./incoming/pkg-as-it-should-be_0_all.foobar
+echo "Package: pkg-as-it-should-be
+Architecture: all
+Version: 0
+Installed-Size: 2903
+Filename: incoming/pkg-as-it-should-be_0_all.foobar
+Size: $(stat -c %s incoming/pkg-as-it-should-be_0_all.foobar)
+SHA256: $(sha256sum incoming/pkg-as-it-should-be_0_all.foobar | cut -d' ' -f 1)
+" | gzip > Packages.gz
+testsuccess apt install --with-source ./Packages.gz pkg-as-it-should-be -s
+testsuccess apt install --with-source ./Packages.gz pkg-as-it-should-be --print-uris
+testsuccess apt show --with-source ./Packages.gz pkg-as-it-should-be
+testequal 'Package: pkg-as-it-should-be' head -n1 rootdir/tmp/testsuccess.output
+testsuccess apt install -y --with-source ./Packages.gz pkg-as-it-should-be
+testdpkginstalled 'pkg-as-it-should-be'
diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key
index 759ce1487..96cfe41fa 100755
--- a/test/integration/test-apt-key
+++ b/test/integration/test-apt-key
@@ -81,6 +81,20 @@ gpg: unchanged: 1' aptkey --fakeroot update
testsuccess --nomsg aptkey --fakeroot del d141dbac8dae
testempty aptkey list
+ if [ "$(id -u)" != '0' ]; then
+ msgtest 'Test key removal with' 'unreadable key'
+ cleanplate
+ cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
+ echo 'foobar' > "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ chmod 000 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ testwarning --nomsg aptkey --fakeroot del d141dbac8dae
+ testwarning aptkey list
+ chmod 644 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ rm -f "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ grep -v '^W: ' "${ROOTDIR}/tmp/testwarning.output" > "${ROOTDIR}/aptkeylist.output" || true
+ testempty cat "${ROOTDIR}/aptkeylist.output"
+ fi
+
msgtest 'Test key removal with' 'single key in real file'
cleanplate
cp -a "${KEYDIR}/joesixpack.pub" "${ROOTDIR}/etc/apt/trusted.gpg.d/joesixpack.gpg"
@@ -202,6 +216,16 @@ gpg: unchanged: 1' aptkey --fakeroot update
msgtest 'Test verify a file' 'with all keys'
testsuccess --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
+ if [ "$(id -u)" != '0' ]; then
+ msgtest 'Test verify a file' 'with unreadable key'
+ echo 'foobar' > "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ chmod 000 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ testwarning --nomsg aptkey --quiet --readonly verify "${SIGNATURE}.gpg" "${SIGNATURE}"
+ testwarning aptkey list
+ chmod 644 "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ rm -f "${ROOTDIR}/etc/apt/trusted.gpg.d/unreadablekey.gpg"
+ fi
+
msgtest 'Test verify a file' 'with good keyring'
testsuccess --nomsg aptkey --quiet --readonly --keyring "${KEYDIR}/testcase-multikey.pub" verify "${SIGNATURE}.gpg" "${SIGNATURE}"
diff --git a/test/integration/test-apt-redirect-loop b/test/integration/test-apt-redirect-loop
index b54f74276..e1a8aeea0 100755
--- a/test/integration/test-apt-redirect-loop
+++ b/test/integration/test-apt-redirect-loop
@@ -7,9 +7,6 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture "i386"
-insertpackage 'stable' 'apt' 'all' '1'
-setupaptarchive --no-update
-
echo 'alright' > aptarchive/working
changetohttpswebserver
webserverconfig 'aptwebserver::redirect::replace::/redirectme3/' '/redirectme/'
diff --git a/test/integration/test-bug-605394-versioned-or-groups b/test/integration/test-bug-605394-versioned-or-groups
index a362463d5..43f35f79b 100755
--- a/test/integration/test-bug-605394-versioned-or-groups
+++ b/test/integration/test-bug-605394-versioned-or-groups
@@ -24,3 +24,7 @@ if aptget dist-upgrade --trivial-only -o Debug::pkgProblemResolver=1 -o Debug::p
else
msgpass
fi
+
+# the Packages file includes only MD5
+testfailure aptget dist-upgrade -y
+testsuccess grep 'Insufficient information available to perform this download securely' rootdir/tmp/testfailure.output
diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet
index d8d3c7218..82c1d715f 100755
--- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet
+++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet
@@ -20,7 +20,7 @@ APTARCHIVE=$(readlink -f ./aptarchive)
testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget upgrade -qq --print-uris
testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget dist-upgrade -qq --print-uris
testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget install apt -qq --print-uris
-testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget download apt -qq --print-uris
+testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 SHA256:0000000000000000000000000000000000000000000000000000000000000000" aptget download apt -qq --print-uris
testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 9 SHA256:7776436a6d741497f1cd958014e1a05b352224231428152aae39da3c17fd2fd4
'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 12 SHA256:f57f565eabe3fde0ec6e6e0bcc8db1d86fe2b4d6344a380a23520ddbb7728e99" aptget source apt -qq --print-uris
testsuccessequal "'http://metadata.ftp-master.debian.org/changelogs/main/a/apt/apt_2_changelog' apt.changelog" aptget changelog apt -qq --print-uris
diff --git a/test/integration/test-handle-redirect-as-used-mirror-change b/test/integration/test-handle-redirect-as-used-mirror-change
index 2e8fbeff6..2655f713c 100755
--- a/test/integration/test-handle-redirect-as-used-mirror-change
+++ b/test/integration/test-handle-redirect-as-used-mirror-change
@@ -78,3 +78,9 @@ testsuccessequal "Ign:1 http://0.0.0.0:${APTHTTPPORT}/storage unstable InRelease
404 Not Found
Hit:2 http://0.0.0.0:${APTHTTPPORT} unstable Release
Reading package lists..." aptget update
+
+rm -rf rootdir/var/lib/apt/lists
+find aptarchive -name 'Release.gpg' -delete
+find aptarchive -name 'Release' -delete
+testwarning aptget update
+testsuccess grep 'does not have a Release file' rootdir/tmp/testwarning.output
diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification
index 20ca613da..e043fa8b5 100755
--- a/test/integration/test-releasefile-verification
+++ b/test/integration/test-releasefile-verification
@@ -107,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'