From 4e9ccfb2ff599b7a65ecec3c2f1383636f068f0c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 5 Jul 2011 11:30:35 +0100 Subject: Removed some debug stuff, corrected the VerifyConfigure calls to VerifyAndConfigure --- test/integration/test-package-reinstallation | 17 +++++++++ test/integration/test-provides-gone-with-upgrade | 46 ++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100755 test/integration/test-package-reinstallation create mode 100755 test/integration/test-provides-gone-with-upgrade (limited to 'test/integration') diff --git a/test/integration/test-package-reinstallation b/test/integration/test-package-reinstallation new file mode 100755 index 000000000..359f69284 --- /dev/null +++ b/test/integration/test-package-reinstallation @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertinstalledpackage 'libc-bin' 'i386' '2.13-8' 'Replaces: libc6' +insertpackage 'unstable' 'libc-bin' 'i386' '2.13-8' 'Replaces: libc6' +insertinstalledpackage 'libc6' 'i386' '2.13-8' 'Depends: libc-bin (= 2.13-8)' +insertpackage 'unstable' 'libc6' 'i386' '2.13-8' 'Depends: libc-bin (= 2.13-8)' +insertinstalledpackage 'apt' 'i386' '0.8.15' 'Depends: libc6' + +setupaptarchive + +aptget install --reinstall libc6 libc-bin -s -o Debug::pkgPackageManager=1 diff --git a/test/integration/test-provides-gone-with-upgrade b/test/integration/test-provides-gone-with-upgrade new file mode 100755 index 000000000..ece2eaa41 --- /dev/null +++ b/test/integration/test-provides-gone-with-upgrade @@ -0,0 +1,46 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertinstalledpackage 'apt' 'i386' '0.8.14' 'Provides: libapt-pkg4.10' +insertpackage 'unstable' 'apt' 'i386' '0.8.15' 'Depends: libapt-pkg4.10' +insertpackage 'unstable' 'libapt-pkg4.10' 'i386' '0.8.15' 'Breaks: apt (<< 0.8.15) +Replaces: apt (<< 0.8.15)' + +setupaptarchive + +#testequal 'Reading package lists... +#Building dependency tree... +#The following NEW packages will be installed: +# libapt-pkg4.10 +#The following packages will be upgraded: +# apt +#1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +#Inst libapt-pkg4.10 (0.8.15 unstable [i386]) [libapt-pkg4.10:i386 on apt:i386] [] +#Conf libapt-pkg4.10:i386 broken +# Breaks:apt:i386 +# [] +#Inst apt [0.8.14] (0.8.15 unstable [i386]) +#Conf apt (0.8.15 unstable [i386]) +#E: Conf Broken libapt-pkg4.10:i386' +aptget dist-upgrade -s -o Debug::pkgPackageManager=1 +# the solution by dpkg will be to deconfigure apt with the configuration of libapt-pkg4.10 + +exit 0 + +#FIXME: a good result would be this instead, but it requires that APT can delay his immediate configuration… +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libapt-pkg4.10 +The following packages will be upgraded: + apt +1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libapt-pkg4.10 (0.8.15 unstable [i386]) +Conf libapt-pkg4.10 (0.8.15 unstable [i386]) +Inst apt [0.8.14] (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386])' aptget dist-upgrade -s -- cgit v1.2.3 From aaf991a8640da0d18f8e9bbea6d9bcda166fb60c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 13 Jul 2011 10:50:41 +0100 Subject: Added test for conflicts loop --- test/integration/test-conflicts-loop | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 test/integration/test-conflicts-loop (limited to 'test/integration') diff --git a/test/integration/test-conflicts-loop b/test/integration/test-conflicts-loop new file mode 100755 index 000000000..f76c016fb --- /dev/null +++ b/test/integration/test-conflicts-loop @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertinstalledpackage 'openjdk-6-jre' 'i386' '6b16-1.8-0ubuntu1' +insertpackage 'unstable' 'openjdk-6-jre' 'i386' '6b20-1.9.8-0ubuntu1~10.04.1' 'Conflicts: openjdk-6-jre-headless (<< 6b17~pre3-1), openjdk-6-jre-lib (<< 6b17~pre3-1)' +insertinstalledpackage 'openjdk-6-jre-lib' 'i386' '6b16-1.8-0ubuntu1' +insertpackage 'unstable' 'openjdk-6-jre-lib' 'i386' '6b20-1.9.8-0ubuntu1~10.04.1' 'Conflicts: openjdk-6-jre (<< 6b17~pre3-1), openjdk-6-jre-headless (<< 6b17~pre3-1)' +insertinstalledpackage 'openjdk-6-jre-headless' 'i386' '6b16-1.8-0ubuntu1' +insertpackage 'unstable' 'openjdk-6-jre-headless' 'i386' '6b20-1.9.8-0ubuntu1~10.04.1' 'Conflicts: openjdk-6-jre (<< 6b17~pre3-1), openjdk-6-jre-lib (<< 6b17~pre3-1)' + +setupaptarchive + +aptget dist-upgrade -s -o Debug::pkgPackageManager=true -o Debug::pkgDpkgPM=true -o APT::Immediate-Configure-All=true -- cgit v1.2.3 From 682a3bf727cd79a66eeb335c4c6593472ce11907 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Aug 2011 14:37:25 +0200 Subject: do not output color in the testcases if stdout/stderr are not a /dev/pts --- test/integration/framework | 29 ++++++++++++++++++----------- test/integration/run-tests | 17 +++++++++++++---- 2 files changed, 31 insertions(+), 15 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index ccab010e6..45c1f156a 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1,16 +1,19 @@ #!/bin/sh -- # no runable script, just for vi # we all like colorful messages -CERROR="" # red -CWARNING="" # yellow -CMSG="" # green -CINFO="" # light blue -CDEBUG="" # blue -CNORMAL="" # default system console color -CDONE="" # green -CPASS="" # green -CFAIL="" # red -CCMD="" # pink +if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \ + expr match "$(readlink -f /proc/$$/fd/2)" '/dev/pts/[0-9]\+' > /dev/null; then + CERROR="" # red + CWARNING="" # yellow + CMSG="" # green + CINFO="" # light blue + CDEBUG="" # blue + CNORMAL="" # default system console color + CDONE="" # green + CPASS="" # green + CFAIL="" # red + CCMD="" # pink +fi msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; } msgwarn() { echo "${CWARNING}W: $1${CNORMAL}" >&2; } @@ -42,7 +45,11 @@ if [ $MSGLEVEL -le 2 ]; then msgtest() { true; } msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; } msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; } - msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; } + if [ -n "$CFAIL" ]; then + msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; } + else + msgfail() { echo -n " ###FAILED###" >&2; } + fi fi if [ $MSGLEVEL -le 3 ]; then msginfo() { true; } diff --git a/test/integration/run-tests b/test/integration/run-tests index edac07dbf..292986822 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -8,17 +8,26 @@ if [ "$1" = "-q" ]; then elif [ "$1" = "-v" ]; then export MSGLEVEL=4 fi + +if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then + CTEST='\033[1;32m' + CHIGH='\033[1;35m' + CRESET='\033[0m' +elif [ -z "${MSGLEVEL}" ]; then + export MSGLEVEL=2 +fi + for testcase in $(run-parts --list $DIR | grep '/test-'); do - if [ "$1" = "-q" ]; then - echo -n "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" + if [ "$MSGLEVEL" -le 2 ]; then + echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: " else - echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" + echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}" fi if ! ${testcase}; then FAIL=$((FAIL+1)) echo "$(basename $testcase) ... FAIL" fi - if [ "$1" = "-q" ]; then + if [ "$MSGLEVEL" -le 2 ]; then echo fi done -- cgit v1.2.3 From 92d5a40da433833380626b9678c4887568505b6d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Aug 2011 15:47:08 +0200 Subject: for consistency allow the usage of 'make test' instead of './run-tests' --- test/integration/makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/integration/makefile (limited to 'test/integration') diff --git a/test/integration/makefile b/test/integration/makefile new file mode 100644 index 000000000..fb12fe9a8 --- /dev/null +++ b/test/integration/makefile @@ -0,0 +1,10 @@ +# -*- make -*- +BASE=../.. +SUBDIR=test/integration + +# Bring in the default rules +include ../../buildlib/defaults.mak + +.PHONY: test +test: + ./run-tests -- cgit v1.2.3 From fe268128119bc73403003a29b66c927b9c36690d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Aug 2011 15:49:59 +0200 Subject: set the msglevel to a high dummy value if none is specified --- test/integration/run-tests | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/integration') diff --git a/test/integration/run-tests b/test/integration/run-tests index 292986822..75f2ad662 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -17,6 +17,10 @@ elif [ -z "${MSGLEVEL}" ]; then export MSGLEVEL=2 fi +if [ -z "$MSGLEVEL" ]; then + MSGLEVEL=5 +fi + for testcase in $(run-parts --list $DIR | grep '/test-'); do if [ "$MSGLEVEL" -le 2 ]; then echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: " -- cgit v1.2.3 From 8de79b68a834a6cc7abb8976e96ed19374fc02a2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 22 Aug 2011 23:10:15 +0200 Subject: remove the caches in 'apt-get update', too, as they will be invalid in most cases anyway --- test/integration/test-bug-254770-segfault-if-cache-not-buildable | 1 - .../test-bug-590438-broken-provides-thanks-to-remove-order | 2 -- test/integration/test-bug-595691-empty-and-broken-archive-files | 2 +- test/integration/test-bug-601016-description-translation | 2 +- .../integration/test-bug-633350-do-not-kill-last-char-in-Release | 2 +- test/integration/test-compressed-indexes | 9 ++++----- test/integration/test-hashsum-verification | 2 -- test/integration/test-policy-pinning | 7 ------- test/integration/test-releasefile-verification | 3 +-- 9 files changed, 8 insertions(+), 22 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable index b9f45b131..8fa337ccc 100755 --- a/test/integration/test-bug-254770-segfault-if-cache-not-buildable +++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable @@ -12,7 +12,6 @@ trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM chmod a-x rootdir/var/lib/dpkg testsegfault() { - rm -f rootdir/var/cache/apt/*.bin msgtest "No segfault in" "$*" local TEST="$($* 2>&1 | grep -v 'E:')" if [ -z "$TEST" ]; then diff --git a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order index 0f6493948..645e86d7d 100755 --- a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order +++ b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order @@ -25,7 +25,6 @@ MD5sum: 8489687ce10e656babd467c9ee389349 Description-de: Verschiedene Dateien für das Basis-System von Debian" predependsgawk() { - rm rootdir/var/cache/apt/*.bin cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status echo "$pkgbasefile Pre-Depends: $1 @@ -57,7 +56,6 @@ predependsgawk "awk | aawk" predependsgawk "awk" predependsgawk2() { - rm rootdir/var/cache/apt/*.bin cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status echo "$pkgbasefile Pre-Depends: $1 diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index 11dee0628..5c103da6f 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -11,7 +11,7 @@ touch aptarchive/Packages setupflataptarchive testaptgetupdate() { - rm -rf rootdir/var/lib/apt rootdir/var/cache/apt + rm -rf rootdir/var/lib/apt aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff GIVEN="$1" diff --git a/test/integration/test-bug-601016-description-translation b/test/integration/test-bug-601016-description-translation index 2a323a201..44ab91900 100755 --- a/test/integration/test-bug-601016-description-translation +++ b/test/integration/test-bug-601016-description-translation @@ -57,7 +57,7 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg testrun() { echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages export LC_ALL="" - rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/ + rm -rf rootdir/var/lib/apt/lists setupaptarchive testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE} testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE} diff --git a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release index 3d3835507..2aae7cfcc 100755 --- a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release +++ b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release @@ -15,7 +15,7 @@ echo 'NotAutomatic: yes' >> aptarchive/dists/unstable/Release signreleasefiles find aptarchive/dists -name 'InRelease' -delete -rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt +rm -rf rootdir/var/lib/apt/lists OUTPUT="$(aptget update 2>&1)" msgtest 'Check that parsing happens without warnings' 'with missing newline' diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index 99943574e..26a45812e 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -51,17 +51,16 @@ testrun() { aptget clean msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail fi - rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin testequal "$GOODSHOW" aptcache show testpkg testequal "$GOODSHOW" aptcache show testpkg - rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin testequal "$GOODPOLICY" aptcache policy testpkg testequal "$GOODPOLICY" aptcache policy testpkg - rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin testequal "$GOODSHOWSRC" aptcache showsrc testpkg testequal "$GOODSHOWSRC" aptcache showsrc testpkg - rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin - rm -rf rootdir/var/cache/apt/archives + aptget clean msgtest "Check if the source is aptgetable" aptget source testpkg -qq 2> /dev/null > /dev/null && msgpass || msgfail msgtest "\tdsc file is present"; test -f testpkg_1.0.dsc && msgpass || msgfail diff --git a/test/integration/test-hashsum-verification b/test/integration/test-hashsum-verification index 033096ee8..3ac9eccfb 100755 --- a/test/integration/test-hashsum-verification +++ b/test/integration/test-hashsum-verification @@ -19,8 +19,6 @@ prepare() { for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do touch -d 'now - 6 hours' $release done - rm -rf rootdir/var/cache/apt/archives - rm -f rootdir/var/cache/apt/*.bin cp $1 aptarchive/Packages find aptarchive -name 'Release' -delete cat aptarchive/Packages | gzip > aptarchive/Packages.gz diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index fa356ed54..6b1473564 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -30,21 +30,18 @@ testequalpolicy 100 500 testequalpolicy 990 500 -t now sed -i aptarchive/Release -e 1i"NotAutomatic: yes" -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicy 100 1 -o Test=NotAutomatic testequalpolicy 990 1 -o Test=NotAutomatic -t now sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes" -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicy 100 100 -o Test=ButAutomaticUpgrades testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d' -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicy 100 500 -o Test=Automatic @@ -135,7 +132,6 @@ Pin-Priority: -1" > rootdir/etc/apt/preferences rm rootdir/etc/apt/preferences sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic @@ -164,7 +160,6 @@ testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t s rm rootdir/etc/apt/preferences sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades @@ -211,7 +206,6 @@ setupaptarchive sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test=NotAutomatic @@ -220,7 +214,6 @@ testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=N sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles -rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin aptget update -qq testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 961c49895..8bf02a78f 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -19,8 +19,7 @@ prepare() { for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do touch -d 'now - 6 hours' $release done - rm -rf rootdir/var/cache/apt/archives - rm -f rootdir/var/cache/apt/*.bin + aptget clean cp $1 aptarchive/Packages find aptarchive -name 'Release' -delete cat aptarchive/Packages | gzip > aptarchive/Packages.gz -- cgit v1.2.3 From 884a4c0a3a6cba654e77478a086f26539bc5bd32 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 5 Sep 2011 14:50:30 +0200 Subject: * apt-pkg/indexrecords.cc: - fix Acquire::Max-ValidTime option by interpreting it really as seconds as specified in the manpage and not as days --- test/integration/framework | 31 +++++++------ test/integration/test-releasefile-valid-until | 66 +++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 13 deletions(-) create mode 100755 test/integration/test-releasefile-valid-until (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 45c1f156a..322cf2875 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -515,8 +515,9 @@ getcodenamefromsuite() { echo -n "$1"; } getreleaseversionfromsuite() { true; } generatereleasefiles() { + # $1 is the Date header and $2 is the ValidUntil header to be set + # both should be given in notation date/touch can understand msgninfo "\tGenerate Release files… " - local DATE="${1:-now}" if [ -e aptarchive/dists ]; then for dir in $(find ./aptarchive/dists -mindepth 3 -maxdepth 3 -type d -name 'i18n'); do aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index @@ -525,27 +526,31 @@ generatereleasefiles() { local SUITE="$(echo "$dir" | cut -d'/' -f 4)" local CODENAME="$(getcodenamefromsuite $SUITE)" local VERSION="$(getreleaseversionfromsuite $SUITE)" - if [ -z "$VERSION" ]; then - aptftparchive -qq release $dir \ - -o APT::FTPArchive::Release::Suite="${SUITE}" \ - -o APT::FTPArchive::Release::Codename="${CODENAME}" \ - | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference - else - aptftparchive -qq release $dir \ - -o APT::FTPArchive::Release::Suite="${SUITE}" \ - -o APT::FTPArchive::Release::Codename="${CODENAME}" \ - -o APT::FTPArchive::Release::Version="${VERSION}" \ - | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + if [ -n "$VERSION" ]; then + VERSION="-o APT::FTPArchive::Release::Version='${VERSION}'" fi + aptftparchive -qq release $dir \ + -o APT::FTPArchive::Release::Suite="${SUITE}" \ + -o APT::FTPArchive::Release::Codename="${CODENAME}" \ + -o APT::FTPArchive::Release::Label="Testcases" \ + ${VERSION} \ + | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then sed -i '/^Date: / a\ NotAutomatic: yes' $dir/Release fi + if [ -n "$1" -a "$1" != "now" ]; then + sed -i "s/^Date: .*$/Date: $(date -d "$1" '+%a, %d %b %Y %H:%M:%S %Z')/" $dir/Release + fi + if [ -n "$2" ]; then + sed -i "/^Date: / a\ +Valid-Until: $(date -d "$2" '+%a, %d %b %Y %H:%M:%S %Z')" $dir/Release + fi done else aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference fi - if [ "$DATE" != "now" ]; then + if [ -n "$1" -a "$1" != "now" ]; then for release in $(find ./aptarchive -name 'Release'); do touch -d "$1" $release done diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until new file mode 100755 index 000000000..35498f6d1 --- /dev/null +++ b/test/integration/test-releasefile-valid-until @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertpackage 'wheezy' 'apt' 'all' '0.8.15' + +setupaptarchive + +setupreleasefile() { + rm -rf rootdir/var/lib/apt/lists + aptget clean + generatereleasefiles "$1" "$2" + signreleasefiles +} + +aptgetupdate() { + if aptget update $* 2>&1 | grep -q 'is expired'; then + return 1 + else + return 0 + fi +} + +setupreleasefile +msgtest 'Release file is accepted as it has' 'no Until' +aptgetupdate && msgpass || msgfail + +setupreleasefile +msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid' +aptgetupdate -o Acquire::Max-ValidTime=3600 && msgpass || msgfail + +setupreleasefile 'now - 2 days' +msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid' +aptgetupdate -o Acquire::Max-ValidTime=3600 && msgfail || msgpass + +setupreleasefile 'now - 3 days' 'now + 1 day' +msgtest 'Release file is accepted as it has' 'good Until' +aptgetupdate && msgpass || msgfail + +setupreleasefile 'now - 7 days' 'now - 4 days' +msgtest 'Release file is rejected as it has' 'bad Until' +aptgetupdate && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now - 4 days' +msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)' +aptgetupdate -o Acquire::Max-ValidTime=1209600 && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now - 4 days' +msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)' +aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now + 4 days' +msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)' +aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now + 4 days' +msgtest 'Release file is accepted as it has' 'good labeled Max-Valid' +aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 && msgpass || msgfail + +setupreleasefile 'now - 7 days' 'now + 4 days' +msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid' +aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 && msgfail || msgpass -- cgit v1.2.3 From 89500a25b30d53ea0f5ae213c4207e13f35d1d61 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 5 Sep 2011 15:58:19 +0200 Subject: - add an Acquire::Min-ValidTime option (Closes: #640122) * doc/apt.conf.5.xml: - reword Acquire::Max-ValidTime documentation to make clear that it doesn't provide the new Min-ValidTime functionality --- test/integration/test-releasefile-valid-until | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index 35498f6d1..c35fe97ff 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -64,3 +64,27 @@ aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcase setupreleasefile 'now - 7 days' 'now + 4 days' msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid' aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now + 1 days' +msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)' +aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail + +setupreleasefile 'now - 7 days' 'now - 4 days' +msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)' +aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail + +setupreleasefile 'now - 7 days' 'now - 2 days' +msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <' +aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 && msgpass || msgfail + +setupreleasefile 'now - 7 days' 'now - 2 days' +msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >' +aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now - 2 days' +msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <' +aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 && msgfail || msgpass + +setupreleasefile 'now - 7 days' 'now - 2 days' +msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >' +aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 && msgfail || msgpass -- cgit v1.2.3 From 718f797cef0fb766b6f7cfa1d34b617ad047dbc5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 9 Sep 2011 10:56:42 +0200 Subject: fix bashism (local outside function) and releasefile creation in testcases --- test/integration/framework | 9 +++++++-- test/integration/test-compressed-indexes | 8 ++++---- test/integration/test-disappearing-packages | 8 ++++---- test/integration/test-releasefile-valid-until | 5 +++++ 4 files changed, 20 insertions(+), 10 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 322cf2875..a2e71760e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -513,6 +513,7 @@ buildaptarchivefromfiles() { # can be overridden by testcases for their pleasure getcodenamefromsuite() { echo -n "$1"; } getreleaseversionfromsuite() { true; } +getlabelfromsuite() { true; } generatereleasefiles() { # $1 is the Date header and $2 is the ValidUntil header to be set @@ -526,13 +527,17 @@ generatereleasefiles() { local SUITE="$(echo "$dir" | cut -d'/' -f 4)" local CODENAME="$(getcodenamefromsuite $SUITE)" local VERSION="$(getreleaseversionfromsuite $SUITE)" + local LABEL="$(getlabelfromsuite $SUITE)" if [ -n "$VERSION" ]; then - VERSION="-o APT::FTPArchive::Release::Version='${VERSION}'" + VERSION="-o APT::FTPArchive::Release::Version=${VERSION}" + fi + if [ -n "$LABEL" ]; then + LABEL="-o APT::FTPArchive::Release::Label=${LABEL}" fi aptftparchive -qq release $dir \ -o APT::FTPArchive::Release::Suite="${SUITE}" \ -o APT::FTPArchive::Release::Codename="${CODENAME}" \ - -o APT::FTPArchive::Release::Label="Testcases" \ + ${LABEL} \ ${VERSION} \ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index 26a45812e..a5e885745 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -10,10 +10,10 @@ configarchitecture "i386" buildsimplenativepackage "testpkg" "i386" "1.0" setupaptarchive -local GOODSHOW="$(aptcache show testpkg) +GOODSHOW="$(aptcache show testpkg) " -local GOODPOLICY="$(aptcache policy testpkg)" -local GOODSHOWSRC="$(aptcache showsrc testpkg) +GOODPOLICY="$(aptcache policy testpkg)" +GOODSHOWSRC="$(aptcache showsrc testpkg) " test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken' @@ -99,7 +99,7 @@ testrun "compressed" rm rootdir/etc/apt/apt.conf.d/02compressindex changetowebserver aptget update -qq -local GOODPOLICY="$(aptcache policy testpkg)" +GOODPOLICY="$(aptcache policy testpkg)" test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 testequal "$GOODPOLICY" aptcache policy testpkg diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index b5d565c2f..82ba9e592 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -12,13 +12,13 @@ buildsimplenativepackage "unrelated" "all" "0.5" "unstable" setupsimplenativepackage "new-pkg" "i386" "2.0" "unstable" "Provides: old-pkg Replaces: old-pkg Conflicts: old-pkg (<< 2.0)" -local BUILDDIR="incoming/new-pkg-2.0" +BUILDDIR="incoming/new-pkg-2.0" echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/new-pkg.links buildpackage "$BUILDDIR" "unstable" "main" rm -rf "$BUILDDIR" setupsimplenativepackage "old-pkg" "all" "2.0" "unstable" "Depends: new-pkg" -local BUILDDIR="incoming/old-pkg-2.0" +BUILDDIR="incoming/old-pkg-2.0" echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/old-pkg.links echo " override_dh_link: @@ -33,9 +33,9 @@ aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null testmarkedauto # old-pkg is manual installed -local CMD="aptget dist-upgrade -y -q=0" +CMD="aptget dist-upgrade -y -q=0" msgtest "Test for equality of" "$CMD" -local COMPAREFILE=$(mktemp) +COMPAREFILE=$(mktemp) echo "The following package disappeared from your system as all files have been overwritten by other packages: old-pkg diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index c35fe97ff..680a370cb 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -8,6 +8,11 @@ configarchitecture 'i386' insertpackage 'wheezy' 'apt' 'all' '0.8.15' +getlabelfromsuite() { + echo -n 'Testcases' +} + + setupaptarchive setupreleasefile() { -- cgit v1.2.3 From 30426f4822516bdd26528aa2e6d8d69c1291c8d3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 9 Sep 2011 12:35:22 +0200 Subject: M-A:same lockstep unpack should operate on installed packages first (LP: #835625) --- .../test-bug-618288-multiarch-same-lockstep | 4 +-- .../test-bug-632221-cross-dependency-satisfaction | 16 +++++------ ...u-bug-835625-multiarch-lockstep-installed-first | 31 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 10 deletions(-) create mode 100755 test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first (limited to 'test/integration') diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep index 7e384e428..a05f03df4 100755 --- a/test/integration/test-bug-618288-multiarch-same-lockstep +++ b/test/integration/test-bug-618288-multiarch-same-lockstep @@ -22,8 +22,8 @@ Building dependency tree... The following packages will be upgraded: apt:i386 apt2 libsame libsame:i386 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. -Inst libsame [1] (2 unstable [amd64]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:i386 apt2:amd64 ] -Inst libsame:i386 [1] (2 unstable [i386]) [apt2:amd64 apt:i386 ] +Inst libsame:i386 [1] (2 unstable [i386]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:amd64 apt:i386 ] +Inst libsame [1] (2 unstable [amd64]) [apt2:amd64 apt:i386 ] Conf libsame:i386 (2 unstable [i386]) [apt2:amd64 apt:i386 ] Conf libsame (2 unstable [amd64]) [apt2:amd64 apt:i386 ] Inst apt2 [1] (2 unstable [amd64]) [apt:i386 ] diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 58de44843..4299f052f 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -47,10 +47,10 @@ Inst amdboot (1.0 unstable [amd64]) Inst cool (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst foreigner (1.0 unstable [amd64]) -Inst libc6:armel (1.0 unstable [armel]) Inst libc6 (1.0 unstable [amd64]) -Inst libc6-dev:armel (1.0 unstable [armel]) +Inst libc6:armel (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [amd64]) +Inst libc6-dev:armel (1.0 unstable [armel]) Conf amdboot (1.0 unstable [amd64]) Conf cool (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) @@ -90,10 +90,10 @@ Inst amdboot:amd64 (1.0 unstable [amd64]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) Inst foreigner (1.0 unstable [armel]) -Inst libc6 (1.0 unstable [armel]) Inst libc6:amd64 (1.0 unstable [amd64]) -Inst libc6-dev (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [armel]) Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) @@ -129,10 +129,10 @@ The following NEW packages will be installed: 0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) -Inst libc6:armel (1.0 unstable [armel]) Inst libc6 (1.0 unstable [amd64]) -Inst libc6-dev:armel (1.0 unstable [armel]) +Inst libc6:armel (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [amd64]) +Inst libc6-dev:armel (1.0 unstable [armel]) Conf amdboot (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) @@ -169,10 +169,10 @@ The following NEW packages will be installed: 0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [armel]) -Inst libc6 (1.0 unstable [armel]) Inst libc6:amd64 (1.0 unstable [amd64]) -Inst libc6-dev (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [armel]) Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [armel]) Conf libc6:amd64 (1.0 unstable [amd64]) diff --git a/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first new file mode 100755 index 000000000..a9a4069cf --- /dev/null +++ b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertinstalledpackage 'libsame' 'i386' '1' +insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)' + +insertpackage 'unstable' 'libsame' 'i386,amd64' '2' 'Multi-Arch: same' +insertpackage 'unstable' 'apt' 'i386' '2' 'Depends: libsame (= 2)' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + apt:i386 libsame:i386 +The following NEW packages will be installed: + libsame +The following packages will be upgraded: + apt:i386 libsame:i386 +2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libsame:i386 [1] (2 unstable [i386]) [apt:i386 ] +Inst libsame (2 unstable [amd64]) [apt:i386 ] +Conf libsame:i386 (2 unstable [i386]) [apt:i386 ] +Conf libsame (2 unstable [amd64]) [apt:i386 ] +Inst apt:i386 [1] (2 unstable [i386]) +Conf apt:i386 (2 unstable [i386])' aptget install libsame:amd64 -s -- cgit v1.2.3 From 451ea3d4046d95a82856b78087449519ec7e8487 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 15 Sep 2011 11:02:43 +0200 Subject: update the test to ensure that NotAutomatic and co is used also if the archive is signed, but the signature can't be checked as the key is missing (debbugs #597301 - fix in r2105) --- test/integration/test-policy-pinning | 58 +++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 8 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 6b1473564..9e1ea4ac5 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -25,28 +25,70 @@ testequalpolicy() { Pinned packages:" aptcache policy $* } -aptget update -qq +aptgetupdate() { + # just to be sure that no old files are used + rm -rf rootdir/var/lib/apt + if aptget update -qq 2>&1 | grep '^E: '; then + msgwarn 'apt-get update failed with an error' + fi +} + +### not signed archive + +aptgetupdate testequalpolicy 100 500 testequalpolicy 990 500 -t now sed -i aptarchive/Release -e 1i"NotAutomatic: yes" -aptget update -qq +aptgetupdate testequalpolicy 100 1 -o Test=NotAutomatic testequalpolicy 990 1 -o Test=NotAutomatic -t now sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes" -aptget update -qq +aptgetupdate testequalpolicy 100 100 -o Test=ButAutomaticUpgrades testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d' -aptget update -qq +aptgetupdate testequalpolicy 100 500 -o Test=Automatic testequalpolicy 990 500 -o Test=Automatic -t now +sed -i aptarchive/Release -e '/NotAutomatic: / d' -e '/ButAutomaticUpgrades: / d' + +### signed but no key in trusted + +signreleasefiles 'Marvin Paranoid' +aptgetupdate +testequalpolicy 100 500 +testequalpolicy 990 500 -t now + +sed -i aptarchive/Release -e 1i"NotAutomatic: yes" +signreleasefiles 'Marvin Paranoid' +aptgetupdate + +testequalpolicy 100 1 -o Test=NotAutomatic +testequalpolicy 990 1 -o Test=NotAutomatic -t now + +sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes" +signreleasefiles 'Marvin Paranoid' +aptgetupdate + +testequalpolicy 100 100 -o Test=ButAutomaticUpgrades +testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now + +sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d' +signreleasefiles 'Marvin Paranoid' +aptgetupdate + +testequalpolicy 100 500 -o Test=Automatic +testequalpolicy 990 500 -o Test=Automatic -t now + +### signed and valid key + buildsimplenativepackage "coolstuff" "all" "1.0" "stable" buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports" @@ -132,7 +174,7 @@ Pin-Priority: -1" > rootdir/etc/apt/preferences rm rootdir/etc/apt/preferences sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic testequalpolicycoolstuff "" "1.0" 1 990 0 "" -o Test=NotAutomatic -t stable @@ -160,7 +202,7 @@ testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t s rm rootdir/etc/apt/preferences sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable @@ -206,7 +248,7 @@ setupaptarchive sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test=NotAutomatic testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test=NotAutomatic -t stable @@ -214,7 +256,7 @@ testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=N sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable -- cgit v1.2.3 From 061c58b61ab5aae4689386bd2ab1e36e71470dfc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 4 Oct 2011 00:14:38 +0200 Subject: * apt-pkg/policy.cc: - accept generic release pin expressions again in -t (Closes: #644166) --- .../test-bug-407511-fail-invalid-default-release | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-407511-fail-invalid-default-release b/test/integration/test-bug-407511-fail-invalid-default-release index d0a73af7d..7f23a1e82 100755 --- a/test/integration/test-bug-407511-fail-invalid-default-release +++ b/test/integration/test-bug-407511-fail-invalid-default-release @@ -23,18 +23,31 @@ getreleaseversionfromsuite() { fi } +getlabelfromsuite() { + if [ "$SUITE" = 'unstable' ]; then + echo -n 'UnstableTestcases' + else + echo -n 'Testcases' + fi +} + setupaptarchive passdist() { - msgtest "Test that target-release is accepted" $1 + msgtest 'Test that target-release is accepted' $1 aptget dist-upgrade -t $1 -qq && msgpass || msgfail + msgtest 'Test that target-release pins with' $1 + aptcache policy -t $1 | grep -q ' 990' && msgpass || msgfail } faildist() { - msgtest "Test that target-release is refused" $1 + msgtest 'Test that target-release is refused' $1 aptget dist-upgrade -t $1 -qq 2> /dev/null && msgfail || msgpass } +msgtest 'Test that no default-release is active in this test' 'setup' +aptcache policy | grep -q ' 990' && msgfall || msgpass + passdist unstable passdist sid faildist sidd @@ -45,3 +58,9 @@ passdist 42* passdist 4*.0 faildist 21.0 faildist 21* +# we accept, but don't validate the following +passdist a=unstable +passdist n=sid +passdist v=42.0 +passdist c=main +passdist l=UnstableTestcases -- cgit v1.2.3 From 7cb28948317e0d326c8663ec3c9ce995d5bf65e8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Oct 2011 22:45:22 +0200 Subject: * apt-pkg/deb/debmetaindex.cc: - none is a separator, not a language: no need for Index (Closes: #624218) * apt-pkg/aptconfiguration.cc: - do not builtin languages only if none is forced (Closes: #643787) --- .../test-bug-624218-Translation-file-handling | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100755 test/integration/test-bug-624218-Translation-file-handling (limited to 'test/integration') diff --git a/test/integration/test-bug-624218-Translation-file-handling b/test/integration/test-bug-624218-Translation-file-handling new file mode 100755 index 000000000..a1e708d2e --- /dev/null +++ b/test/integration/test-bug-624218-Translation-file-handling @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable' + +setupaptarchive + +changetowebserver + +rm -rf rootdir/var/lib/apt/lists + +msgtest 'No download of non-existent locals' 'with Index' +LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of existent locals' 'with Index' +LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of en in LC_ALL=C' 'with Index' +LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of en as forced language' 'with Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing else in forced language' 'with Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download no Translation- if forced language is non-existent' 'with Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing if none is forced' 'with Index' +aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +sed -i '/i18n\/Index$/ d' $(find aptarchive -name 'Release') +signreleasefiles + +# we have to try as not every archive includes the i18n Index in the Release file - if it has one at all +msgtest 'Download no Translation- if forced language is non-existent' 'with not-announced Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +find aptarchive -name 'Index' -delete + +msgtest 'Download of en as forced language' 'without Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing else in forced language' 'without Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of ast_DE as forced language' 'without Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-ast_DE$' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing else in forced language' 'without Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-[^a][^s]' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing if none is forced' 'without Index' +aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +mkdir -p rootdir/var/lib/apt/lists +touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE + +msgtest 'Download of builtin files' 'without Index' +aptget update | grep -q -e 'Translation-ast_DE' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +mkdir -p rootdir/var/lib/apt/lists +touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE + +msgtest 'Download of nothing (even builtin) if none is forced' 'without Index' +aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists -- cgit v1.2.3 From d073d7db69eddd2d9c22e8ded7c6b871bca1716a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Oct 2011 23:00:47 +0200 Subject: cherrypick from my apt/experimental branch * apt-pkg/deb/debmetaindex.cc: - none is a separator, not a language: no need for Index (Closes: #624218) * apt-pkg/aptconfiguration.cc: - do not builtin languages only if none is forced (Closes: #643787) --- .../test-bug-624218-Translation-file-handling | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100755 test/integration/test-bug-624218-Translation-file-handling (limited to 'test/integration') diff --git a/test/integration/test-bug-624218-Translation-file-handling b/test/integration/test-bug-624218-Translation-file-handling new file mode 100755 index 000000000..a1e708d2e --- /dev/null +++ b/test/integration/test-bug-624218-Translation-file-handling @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable' + +setupaptarchive + +changetowebserver + +rm -rf rootdir/var/lib/apt/lists + +msgtest 'No download of non-existent locals' 'with Index' +LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of existent locals' 'with Index' +LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of en in LC_ALL=C' 'with Index' +LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of en as forced language' 'with Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing else in forced language' 'with Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download no Translation- if forced language is non-existent' 'with Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing if none is forced' 'with Index' +aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +sed -i '/i18n\/Index$/ d' $(find aptarchive -name 'Release') +signreleasefiles + +# we have to try as not every archive includes the i18n Index in the Release file - if it has one at all +msgtest 'Download no Translation- if forced language is non-existent' 'with not-announced Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +find aptarchive -name 'Index' -delete + +msgtest 'Download of en as forced language' 'without Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing else in forced language' 'without Index' +aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of ast_DE as forced language' 'without Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-ast_DE$' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing else in forced language' 'without Index' +aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-[^a][^s]' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +msgtest 'Download of nothing if none is forced' 'without Index' +aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists + +mkdir -p rootdir/var/lib/apt/lists +touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE + +msgtest 'Download of builtin files' 'without Index' +aptget update | grep -q -e 'Translation-ast_DE' && msgpass || msgfail +rm -rf rootdir/var/lib/apt/lists + +mkdir -p rootdir/var/lib/apt/lists +touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE + +msgtest 'Download of nothing (even builtin) if none is forced' 'without Index' +aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass +rm -rf rootdir/var/lib/apt/lists -- cgit v1.2.3 From ea65d079e19231eee2b9a167384fac33c1534290 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 11 Oct 2011 14:37:03 +0200 Subject: run integration tests on my new amd64 box without failures --- test/integration/framework | 28 ++++++++++++++++------ .../test-bug-590041-prefer-non-virtual-packages | 2 +- .../test-bug-595691-empty-and-broken-archive-files | 8 +------ .../test-bug-612099-multiarch-conflicts | 7 +----- test/integration/test-disappearing-packages | 14 +++++------ .../test-ubuntu-bug-761175-remove-purge | 8 +++---- 6 files changed, 35 insertions(+), 32 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index a2e71760e..b55f793a4 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -149,6 +149,7 @@ setupenvironment() { echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf + echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it… echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C @@ -156,13 +157,26 @@ setupenvironment() { msgdone "info" } +getarchitecture() { + if [ "$1" = "native" -o -z "$1" ]; then + eval `aptconfig shell ARCH APT::Architecture` + if [ -n "$ARCH" ]; then + echo $ARCH + else + dpkg-architecture -qDEB_BUILD_ARCH + fi + else + echo $1 + fi +} + configarchitecture() { local CONFFILE=rootdir/etc/apt/apt.conf.d/01multiarch.conf rm -f $CONFFILE - echo "APT::Architecture \"$1\";" > $CONFFILE + echo "APT::Architecture \"$(getarchitecture $1)\";" > $CONFFILE shift while [ -n "$1" ]; do - echo "APT::Architectures:: \"$1\";" >> $CONFFILE + echo "APT::Architectures:: \"$(getarchitecture $1)\";" >> $CONFFILE shift done } @@ -275,7 +289,7 @@ Package: $NAME" > ${BUILDDIR}/debian/control echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist done - for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do rm -rf ${BUILDDIR}/debian/tmp mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} @@ -298,6 +312,7 @@ buildpackage() { local BUILDDIR=$1 local RELEASE=$2 local SECTION=$3 + local ARCH=$(getarchitecture $4) msgninfo "Build package $(echo "$BUILDDIR" | grep -o '[^/]*$') for ${RELEASE} in ${SECTION}… " cd $BUILDDIR if [ "$ARCH" = "all" ]; then @@ -408,7 +423,7 @@ insertpackage() { local DEPENDENCIES="$5" local PRIORITY="${6:-optional}" local ARCHS="" - for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do if [ "$arch" = "all" ]; then ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" else @@ -465,7 +480,7 @@ insertinstalledpackage() { local DEPENDENCIES="$4" local PRIORITY="${5:-optional}" local FILE="rootdir/var/lib/dpkg/status" - for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do echo "Package: $NAME Status: install ok installed Priority: $PRIORITY @@ -715,8 +730,7 @@ N: Can't select versions from package '$1' as it is purely virtual" N: No packages found" local COMPAREFILE=$(mktemp) addtrap "rm $COMPAREFILE;" - local ARCH=$(dpkg-architecture -qDEB_HOST_ARCH_CPU) - eval `apt-config shell ARCH APT::Architecture` + local ARCH="$(getarchitecture 'native')" echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE aptcache show -q=0 $PACKAGE 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail } diff --git a/test/integration/test-bug-590041-prefer-non-virtual-packages b/test/integration/test-bug-590041-prefer-non-virtual-packages index 3e2693f85..e0dd7737f 100755 --- a/test/integration/test-bug-590041-prefer-non-virtual-packages +++ b/test/integration/test-bug-590041-prefer-non-virtual-packages @@ -3,7 +3,7 @@ set -e . $(readlink -f $(dirname $0))/framework setupenvironment -configarchitecture "i386" "armel" +configarchitecture 'i386' 'armel' pkglibc6="Package: libc6 Architecture: armel diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index 5c103da6f..bb1ac0e54 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -13,7 +13,7 @@ setupflataptarchive testaptgetupdate() { rm -rf rootdir/var/lib/apt aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true - sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff + sed -i -e '/^Fetched / d' -e '/Ign / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff GIVEN="$1" shift msgtest "Test for correctness of" "apt-get update with $*" @@ -78,7 +78,6 @@ testoverfile() { createemptyfile 'en' testaptgetupdate "Get:1 file: InRelease [] -Ign file: Translation-en Reading package lists..." "empty file en.$COMPRESS over file" createemptyarchive 'en' @@ -89,12 +88,10 @@ Reading package lists..." "empty archive en.$COMPRESS over file" # FIXME: Why omits the file transport the Packages Get line? #Get:3 file: Packages [] testaptgetupdate "Get:1 file: InRelease [] -Ign file: Translation-en Reading package lists..." "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' testaptgetupdate "Get:1 file: InRelease [] -Ign file: Translation-en Err file: Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:$(readlink -f aptarchive/Packages.$COMPRESS) Empty files can't be valid archives @@ -109,7 +106,6 @@ testoverhttp() { testaptgetupdate "Get:1 http://localhost InRelease [] Get:2 http://localhost Packages [] Get:3 http://localhost Translation-en -Ign http://localhost Translation-en Reading package lists..." "empty file en.$COMPRESS over http" createemptyarchive 'en' @@ -121,14 +117,12 @@ Reading package lists..." "empty archive en.$COMPRESS over http" createemptyarchive 'Packages' testaptgetupdate "Get:1 http://localhost InRelease [] Get:2 http://localhost Packages [] -Ign http://localhost Translation-en Reading package lists..." "empty archive Packages.$COMPRESS over http" createemptyfile 'Packages' #FIXME: we should response with a good error message instead testaptgetupdate "Get:1 http://localhost InRelease [] Get:2 http://localhost Packages -Ign http://localhost Translation-en Err http://localhost Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages) Empty files can't be valid archives diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index b8cfe59e2..dd9efb785 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -4,9 +4,7 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" "amd64" - -buildsimplenativepackage 'peace-dpkg' 'all' '1.0' 'stable' +configarchitecture 'i386' 'amd64' buildsimplenativepackage 'libc6' 'i386' '1.0' 'stable' buildsimplenativepackage 'libc6' 'amd64' '1.0' 'stable' @@ -17,9 +15,6 @@ buildsimplenativepackage 'foobar' 'amd64' '1.0' 'stable' 'Depends: libc6' setupaptarchive -aptget install peace-dpkg:i386 -y -qq 2>&1 > /dev/null -testdpkginstalled peace-dpkg - aptget install libc6:i386 -t stable -y -qq 2>&1 > /dev/null testdpkginstalled libc6 testequal 'Reading package lists... diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index 82ba9e592..0e0e9618d 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -4,12 +4,12 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'native' -buildsimplenativepackage "old-pkg" "i386" "1.0" "stable" +buildsimplenativepackage "old-pkg" "native" "1.0" "stable" buildsimplenativepackage "unrelated" "all" "0.5" "unstable" -setupsimplenativepackage "new-pkg" "i386" "2.0" "unstable" "Provides: old-pkg +setupsimplenativepackage "new-pkg" "native" "2.0" "unstable" "Provides: old-pkg Replaces: old-pkg Conflicts: old-pkg (<< 2.0)" BUILDDIR="incoming/new-pkg-2.0" @@ -43,12 +43,12 @@ Note: This is done automatic and on purpose by dpkg." > $COMPAREFILE $CMD 2>&1 | tail -n 4 | diff $COMPAREFILE - && msgpass || msgfail rm $COMPAREFILE -sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' +sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e "s#:$(getarchitecture 'native') #:native #" testfileequal "rootdir/var/log/apt/history.log" " -Install: old-pkg:i386 (1.0) +Install: old-pkg:native (1.0) -Install: new-pkg:i386 (2.0, automatic) -Upgrade: old-pkg:i386 (1.0, 2.0) +Install: new-pkg:native (2.0, automatic) +Upgrade: old-pkg:native (1.0, 2.0) Disappeared: old-pkg (1.0)" testmarkedauto # new-pkg should have get the manual flag from old-pkg diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge index 93b67fc02..f55c6e909 100755 --- a/test/integration/test-ubuntu-bug-761175-remove-purge +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -4,14 +4,14 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture 'i386' +configarchitecture 'native' -setupsimplenativepackage 'compiz-core' 'i386' '1.0' 'unstable' +setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable' BUILDDIR='incoming/compiz-core-1.0' mkdir -p ${BUILDDIR}/debian/compiz-core/etc echo 'foo=bar;' > ${BUILDDIR}/compiz.conf echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install -buildpackage "$BUILDDIR" 'unstable' 'main' +buildpackage "$BUILDDIR" 'unstable' 'main' 'native' rm -rf "$BUILDDIR" setupaptarchive @@ -27,7 +27,7 @@ aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail testdpkgnotinstalled compiz-core msgtest 'Check that conffiles are still around for' 'compiz-core' -dpkg -l compiz-core | grep '^rc' 2>&1 >/dev/null && msgpass || msgfail +dpkg -l compiz-core | grep -q '^rc' && msgpass || msgfail testequal 'Reading package lists... Building dependency tree... -- cgit v1.2.3 From 2aa7df1d88017a7f0352e210b129889ad8b6f7f3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 11 Oct 2011 14:44:05 +0200 Subject: run apt-get download in quiet mode as it messes with output otherwise --- test/integration/test-apt-get-download | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 7db93c32f..4edb7c173 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -13,13 +13,12 @@ buildsimplenativepackage 'apt' 'all' '2.0' 'unstable' setupaptarchive testdownload() { - msgtest 'Test download of package file' $1 - if [ -z "$3" ]; then - aptget download ${2} - else - aptget download ${2}/${3} + local APT="$2" + if [ -n "$3" ]; then + APT="${APT}/${3}" fi - test -f $1 && msgpass || msgfail + msgtest "Test download of package file $1 with" "$APT" + aptget -qq download ${APT} && test -f $1 && msgpass || msgfail } testdownload apt_1.0_all.deb apt stable -- cgit v1.2.3 From 5f4db009e50a254f1dd3edaac7b77fe31e1c5f6b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 11 Oct 2011 21:10:31 +0200 Subject: share description list between "same" versions (LP: #868977) --- .../test-bug-601016-description-translation | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-601016-description-translation b/test/integration/test-bug-601016-description-translation index 44ab91900..03fddbfda 100755 --- a/test/integration/test-bug-601016-description-translation +++ b/test/integration/test-bug-601016-description-translation @@ -4,7 +4,7 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'i386' 'amd64' # we need a valid locale here, otherwise the language configuration # will be overridden by LC_ALL=C @@ -22,8 +22,22 @@ Size: 2140230 MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08 Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c" +PACKAGESTANZA2='Package: apt +Priority: important +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team +Architecture: amd64 +Version: 0.8.7 +Filename: pool/main/a/apt/apt_0.8.7_amd64.deb +Size: 2210342 +MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a +Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' echo "$PACKAGESTANZA +Description: Advanced front-end for dpkg + +$PACKAGESTANZA2 Description: Advanced front-end for dpkg" > aptarchive/Packages echo "Package: apt @@ -53,6 +67,13 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg APT-Dselect-Methode. Beides sind einfache und sicherere Wege, um Pakete zu installieren und Upgrades durchzuführen. " +LOCALESTANZA2="$PACKAGESTANZA2 +Description-${LOCALE}: Mächtige Oberfläche für dpkg + Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff + 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. +" testrun() { echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages @@ -60,6 +81,8 @@ testrun() { rm -rf rootdir/var/lib/apt/lists setupaptarchive testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE} + testequal "$LOCALESTANZA" aptcache show apt:i386 -o Test=File-${LOCALE} + 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} @@ -73,6 +96,9 @@ testrun() { testrun echo "$PACKAGESTANZA +Description: Advanced front-end for dpkg + +$PACKAGESTANZA2 Description: Advanced front-end for dpkg" > aptarchive/Packages echo "Package: apt @@ -88,5 +114,11 @@ Description-en: Advanced front-end for dpkg It provides the apt-get utility and APT dselect method that provides a simpler, safer way to install and upgrade packages. " +ENGLISHSTANZA2="$PACKAGESTANZA2 +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. +" testrun -- cgit v1.2.3 From 28f7a8f269d704779d1eb192da0e052444064693 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 17 Oct 2011 11:21:12 +0200 Subject: create "real" testcases out of the tests for chris --- test/integration/test-conflicts-loop | 19 ++++++++++++++++++- test/integration/test-package-reinstallation | 8 +++++++- test/integration/test-provides-gone-with-upgrade | 22 +--------------------- 3 files changed, 26 insertions(+), 23 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-conflicts-loop b/test/integration/test-conflicts-loop index f76c016fb..7b5724d74 100755 --- a/test/integration/test-conflicts-loop +++ b/test/integration/test-conflicts-loop @@ -15,4 +15,21 @@ insertpackage 'unstable' 'openjdk-6-jre-headless' 'i386' '6b20-1.9.8-0ubuntu1~10 setupaptarchive -aptget dist-upgrade -s -o Debug::pkgPackageManager=true -o Debug::pkgDpkgPM=true -o APT::Immediate-Configure-All=true +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib +3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + openjdk-6-jre-lib conflicts with openjdk-6-jre + openjdk-6-jre conflicts with openjdk-6-jre-headless + openjdk-6-jre-headless conflicts with openjdk-6-jre +Remv openjdk-6-jre [6b16-1.8-0ubuntu1] + openjdk-6-jre-headless conflicts with openjdk-6-jre-lib +Remv openjdk-6-jre-lib [6b16-1.8-0ubuntu1] +Inst openjdk-6-jre-headless [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386]) + openjdk-6-jre conflicts with openjdk-6-jre-lib +Inst openjdk-6-jre [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386]) +Inst openjdk-6-jre-lib [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386]) +Conf openjdk-6-jre-lib (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386]) +Conf openjdk-6-jre (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386]) +Conf openjdk-6-jre-headless (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])' aptget dist-upgrade -s -o APT::Immediate-Configure-All=true diff --git a/test/integration/test-package-reinstallation b/test/integration/test-package-reinstallation index 359f69284..b4f2061ec 100755 --- a/test/integration/test-package-reinstallation +++ b/test/integration/test-package-reinstallation @@ -14,4 +14,10 @@ insertinstalledpackage 'apt' 'i386' '0.8.15' 'Depends: libc6' setupaptarchive -aptget install --reinstall libc6 libc-bin -s -o Debug::pkgPackageManager=1 +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded. +Inst libc-bin [2.13-8] (2.13-8 unstable [i386]) +Conf libc-bin (2.13-8 unstable [i386]) +Inst libc6 [2.13-8] (2.13-8 unstable [i386]) +Conf libc6 (2.13-8 unstable [i386])' aptget install --reinstall libc6 libc-bin -s diff --git a/test/integration/test-provides-gone-with-upgrade b/test/integration/test-provides-gone-with-upgrade index ece2eaa41..70384ce29 100755 --- a/test/integration/test-provides-gone-with-upgrade +++ b/test/integration/test-provides-gone-with-upgrade @@ -13,26 +13,6 @@ Replaces: apt (<< 0.8.15)' setupaptarchive -#testequal 'Reading package lists... -#Building dependency tree... -#The following NEW packages will be installed: -# libapt-pkg4.10 -#The following packages will be upgraded: -# apt -#1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -#Inst libapt-pkg4.10 (0.8.15 unstable [i386]) [libapt-pkg4.10:i386 on apt:i386] [] -#Conf libapt-pkg4.10:i386 broken -# Breaks:apt:i386 -# [] -#Inst apt [0.8.14] (0.8.15 unstable [i386]) -#Conf apt (0.8.15 unstable [i386]) -#E: Conf Broken libapt-pkg4.10:i386' -aptget dist-upgrade -s -o Debug::pkgPackageManager=1 -# the solution by dpkg will be to deconfigure apt with the configuration of libapt-pkg4.10 - -exit 0 - -#FIXME: a good result would be this instead, but it requires that APT can delay his immediate configuration… testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: @@ -40,7 +20,7 @@ The following NEW packages will be installed: The following packages will be upgraded: apt 1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst apt [0.8.14] (0.8.15 unstable [i386]) [] Inst libapt-pkg4.10 (0.8.15 unstable [i386]) Conf libapt-pkg4.10 (0.8.15 unstable [i386]) -Inst apt [0.8.14] (0.8.15 unstable [i386]) Conf apt (0.8.15 unstable [i386])' aptget dist-upgrade -s -- cgit v1.2.3