diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/skip-bug-601016-description-translation | 13 | ||||
-rwxr-xr-x | test/integration/test-apt-update-repeated-ims-hit | 75 | ||||
-rwxr-xr-x | test/integration/test-authentication-basic | 42 |
3 files changed, 115 insertions, 15 deletions
diff --git a/test/integration/skip-bug-601016-description-translation b/test/integration/skip-bug-601016-description-translation index fd0465acd..3f68ce2d5 100755 --- a/test/integration/skip-bug-601016-description-translation +++ b/test/integration/skip-bug-601016-description-translation @@ -47,11 +47,11 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die APT-Dselect-Methode. Beides sind einfache und sicherere Wege, um Pakete zu installieren und Upgrades durchzuführen. -$MD5Sum" | bzip2 > aptarchive/${LOCALE}.bz2 +$MD5Sum" > "aptarchive/${LOCALE}" -# the $LOCALE translation file will not be included as it is a flat archive it came from and therefore -# its name can not be guessed correctly… (in non-flat archives the files are called Translation-*) -echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate +# add our $LOCALE translation file explicitly to be picked up by apt-ftparchive +echo "APT::FTPArchive::Release::Patterns:: \"en\"; +APT::FTPArchive::Release::Patterns:: \"${LOCALE}\";" > rootdir/etc/apt/apt.conf.d/ftparchivepattern NOLONGSTANZA="$PACKAGESTANZA Description: Advanced front-end for dpkg @@ -90,7 +90,8 @@ testrun() { testequal "$LOCALESTANZA2" aptcache show apt:amd64 -o Test=File-${LOCALE} testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE} testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE} - LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE} + LC_ALL=C.UTF-8 testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE} + LC_ALL=C.UTF-8 testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE} -o Acquire::Languages="environment,${LOCALE}" export LC_ALL="" echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE} @@ -113,7 +114,7 @@ Description-en: Advanced front-end for dpkg This is Debian's next generation front-end for the dpkg package manager. It provides the apt-get utility and APT dselect method that provides a simpler, safer way to install and upgrade packages. -$MD5Sum" | bzip2 > aptarchive/en.bz2 +$MD5Sum" > aptarchive/en ENGLISHSTANZA="$PACKAGESTANZA Description-en: Advanced front-end for dpkg diff --git a/test/integration/test-apt-update-repeated-ims-hit b/test/integration/test-apt-update-repeated-ims-hit new file mode 100755 index 000000000..74d46b31b --- /dev/null +++ b/test/integration/test-apt-update-repeated-ims-hit @@ -0,0 +1,75 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' +configcompression '.' 'bz2' + +echo 'Package: apt +Priority: important +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team <deity@lists.debian.org> +Architecture: i386 +Version: 0.8.7 +Filename: pool/main/a/apt/apt_0.8.7_i386.deb +Size: 2140230 +MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08 +Description: Advanced front-end for dpkg +Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' > aptarchive/Packages +compressfile aptarchive/Packages + +echo "Package: apt +Description-en: Advanced front-end for dpkg + This is Debian's next generation front-end for the dpkg package manager. + It provides the apt-get utility and APT dselect method that provides a + simpler, safer way to install and upgrade packages. +$MD5Sum" > aptarchive/en +compressfile aptarchive/en + +echo "APT::FTPArchive::Release::Patterns:: \"en\"; +APT::FTPArchive::Release::Patterns:: \"en.*\";" > rootdir/etc/apt/apt.conf.d/ftparchivepattern + +export APT_DONT_SIGN='InRelease' +setupaptarchive --no-update +rm -f aptarchive/Packages aptarchive/en + +rm -f rootdir/etc/apt/trusted.gpg.d/* +sed -i -e 's#^deb #deb [trusted=yes] #' rootdir/etc/apt/sources.list.d/* + +APTARCHIVE="$(readlink -f ./aptarchive)" +GPGERROR="W: GPG error: file:$APTARCHIVE Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A90D141DBAC8DAE" + +msgmsg 'Running update again does not change result' '0' +testwarningmsg "$GPGERROR" apt update +listcurrentlistsdirectory > lists.before +testsuccess grep 'aptarchive_en$' lists.before +testsuccess grep 'aptarchive_Packages$' lists.before +testsuccess grep 'aptarchive_Release$' lists.before +testfailure grep 'aptarchive_Release.gpg$' lists.before + +for i in $(seq 1 3); do + msgmsg 'Running update again does not change result' "$i" + testwarningmsg "$GPGERROR" apt update + testfileequal lists.before "$(listcurrentlistsdirectory)" +done + +find rootdir/var/lib/apt/lists -name '*Release*' -delete +msgmsg 'Running update with a repository gaining hashsums' +testwarningmsg "$GPGERROR" apt update +testfileequal lists.before "$(listcurrentlistsdirectory)" + +changetowebserver +find aptarchive -name '*Release*' -delete +rm -rf rootdir/var/lib/apt/lists + +msgmsg 'Running update with no indexes' '0' +testsuccess apt update +listcurrentlistsdirectory > lists.before +for i in $(seq 1 3); do + msgmsg 'Running update with no indexes' "$i" + testsuccess apt update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::Transaction=1 + testfileequal lists.before "$(listcurrentlistsdirectory)" +done diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic index 211c73e35..5aafaade0 100755 --- a/test/integration/test-authentication-basic +++ b/test/integration/test-authentication-basic @@ -65,35 +65,59 @@ runtest() { authfile '' testauthfailure "$1" + protocol="${1%%://*}" + # good auth - authfile 'machine localhost + authfile "machine ${protocol}://localhost login star@irc -password hunter2' +password hunter2" testauthsuccess "$1" # bad auth - authfile 'machine localhost + authfile "machine ${protocol}://localhost login anonymous -password hunter2' +password hunter2" testauthfailure "$1" # 2 stanzas: unmatching + good auth - authfile 'machine debian.org + authfile "machine ${protocol}://debian.org login debian password jessie -machine localhost +machine ${protocol}://localhost login star@irc -password hunter2' +password hunter2" testauthsuccess "$1" + # no protocol specifier + authfile "machine localhost +login star@irc +password hunter2" + if [ "$protocol" = "https" ]; then + testauthsuccess "$1" + else + testauthfailure "$1" + fi + + # wrong protocol specifier + if [ "$protocol" = "https" ]; then + authfile "machine http://localhost +login star@irc +password hunter2" + else + authfile "machine https://localhost +login star@irc +password hunter2" + fi + testauthfailure "$1" + # delete file, make sure it fails; add auth.conf.d snippet, works again. rm rootdir/etc/apt/auth.conf testauthfailure "$1" - authfile 'machine localhost + authfile "machine ${protocol}://localhost login star@irc -password hunter2' rootdir/etc/apt/auth.conf.d/myauth.conf +password hunter2" rootdir/etc/apt/auth.conf.d/myauth.conf testauthsuccess "$1" rm rootdir/etc/apt/auth.conf.d/myauth.conf } |