From 5b63d2a9a2e088bb7df7c703e9452af7efc88210 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 8 May 2013 17:50:15 +0200 Subject: merged patch from Daniel Hartwig to fix URI and proxy releated issues --- .../test-bug-595691-empty-and-broken-archive-files | 14 +++++++------- test/integration/test-releasefile-verification | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'test/integration') 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 4611b8b8e..a05ed5fa6 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -103,23 +103,23 @@ testoverhttp() { setupcompressor "$1" createemptyfile 'en' - testaptgetupdate "Get: http://localhost Packages [] -Get: http://localhost Translation-en + testaptgetupdate "Get: http://localhost:8080 Packages [] +Get: http://localhost:8080 Translation-en Reading package lists..." "empty file en.$COMPRESS over http" createemptyarchive 'en' - testaptgetupdate "Get: http://localhost Packages [] -Get: http://localhost Translation-en [] + testaptgetupdate "Get: http://localhost:8080 Packages [] +Get: http://localhost:8080 Translation-en [] Reading package lists..." "empty archive en.$COMPRESS over http" createemptyarchive 'Packages' - testaptgetupdate "Get: http://localhost Packages [] + testaptgetupdate "Get: http://localhost:8080 Packages [] Reading package lists..." "empty archive Packages.$COMPRESS over http" createemptyfile 'Packages' #FIXME: we should response with a good error message instead - testaptgetupdate "Get: http://localhost Packages -Err http://localhost Packages + testaptgetupdate "Get: http://localhost:8080 Packages +Err http://localhost:8080 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-releasefile-verification b/test/integration/test-releasefile-verification index 01fb2e529..fba7ab290 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -37,7 +37,7 @@ The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. After this operation, 5370 kB of additional disk space will be used. -Get:1 http://localhost/ apt 0.7.25.3 +Get:1 http://localhost:8080/ apt 0.7.25.3 Download complete and in download only mode' aptget install apt -dy } @@ -50,7 +50,7 @@ The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. After this operation, 5808 kB of additional disk space will be used. -Get:1 http://localhost/ apt 0.8.0~pre1 +Get:1 http://localhost:8080/ apt 0.8.0~pre1 Download complete and in download only mode' aptget install apt -dy } -- cgit v1.2.3 From 69335858269845904635c592268cf9519e75c1a9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 21 May 2013 18:06:17 +0200 Subject: fix priority sorting by prefering higher in MarkInstall Used to work until a certain (here unnamed) person came along and used the wrong operator causing low-priority packages to be sorted above high-priority packages while choosing a provider in commit 2b5c35c7bb915dbd46fefd7c79f05364ba22f93b from Nov 2011 --- .../test-prefer-higher-priority-providers | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 test/integration/test-prefer-higher-priority-providers (limited to 'test/integration') diff --git a/test/integration/test-prefer-higher-priority-providers b/test/integration/test-prefer-higher-priority-providers new file mode 100755 index 000000000..66458bee0 --- /dev/null +++ b/test/integration/test-prefer-higher-priority-providers @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'native' + +insertpackage 'unstable' 'foo' 'all' '1' 'Provides: stuff' 'important' +insertpackage 'unstable' 'bar' 'all' '1' 'Provides: stuff' 'optional' +insertpackage 'unstable' 'baz' 'all' '1' 'Provides: stuff' 'extra' +insertpackage 'unstable' 'awesome' 'all' '1' 'Depends: stuff' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + awesome foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Inst awesome (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf awesome (1 unstable [all])' aptget install awesome -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + awesome foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Inst awesome (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf awesome (1 unstable [all])' aptget install awesome foo -s -- cgit v1.2.3 From 66706285737a895d0baf64c2387c58d5211be4f9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 21 May 2013 21:50:30 +0200 Subject: try all providers in order if uninstallable in MarkInstall --- .../test-prefer-higher-priority-providers | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-prefer-higher-priority-providers b/test/integration/test-prefer-higher-priority-providers index 66458bee0..64b901dd0 100755 --- a/test/integration/test-prefer-higher-priority-providers +++ b/test/integration/test-prefer-higher-priority-providers @@ -34,3 +34,73 @@ Inst foo (1 unstable [all]) Inst awesome (1 unstable [all]) Conf foo (1 unstable [all]) Conf awesome (1 unstable [all])' aptget install awesome foo -s + +testequal "Reading package lists... +Building dependency tree... +Package 'bar' is not installed, so not removed +Package 'baz' is not installed, so not removed +The following extra packages will be installed: + foo +The following NEW packages will be installed: + awesome foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [all]) +Inst awesome (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf awesome (1 unstable [all])" aptget install awesome bar- baz- -s + +testequal "Reading package lists... +Building dependency tree... +Package 'foo' is not installed, so not removed +The following extra packages will be installed: + bar +The following NEW packages will be installed: + awesome bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1 unstable [all]) +Inst awesome (1 unstable [all]) +Conf bar (1 unstable [all]) +Conf awesome (1 unstable [all])" aptget install awesome foo- -s + +testequal "Reading package lists... +Building dependency tree... +Package 'foo' is not installed, so not removed +Package 'baz' is not installed, so not removed +The following extra packages will be installed: + bar +The following NEW packages will be installed: + awesome bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1 unstable [all]) +Inst awesome (1 unstable [all]) +Conf bar (1 unstable [all]) +Conf awesome (1 unstable [all])" aptget install awesome foo- baz- -s + +testequal "Reading package lists... +Building dependency tree... +Package 'foo' is not installed, so not removed +Package 'bar' is not installed, so not removed +The following extra packages will be installed: + baz +The following NEW packages will be installed: + awesome baz +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst baz (1 unstable [all]) +Inst awesome (1 unstable [all]) +Conf baz (1 unstable [all]) +Conf awesome (1 unstable [all])" aptget install awesome foo- bar- -s + +testequal "Reading package lists... +Building dependency tree... +Package 'foo' is not installed, so not removed +Package 'bar' is not installed, so not removed +Package 'baz' is not installed, so not removed +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + awesome : Depends: stuff +E: Unable to correct problems, you have held broken packages." aptget install awesome foo- bar- baz- -s -- cgit v1.2.3 From 42d51f333e8ef522fed02cdfc48663488d56c3a3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 23 May 2013 12:14:56 +0200 Subject: do unpacks before configures in SmartConfigure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splits the big loop over dependencies in SmartConfigure which unpacks and configures dependencies into two loops and reverse their order, so that all dependencies which need to be unpacked are handled first and only after that configures are issued for dependencies. This is needed as otherwise the unpack of a (new) dependency will be issued in between a configure call for two (or more) packages which form a loop, which means the configure calls aren't part of the same dpkg call and therefore dpkg bails out. Such tight loops should really be avoided as they are usually wrong – and in reality the dependencies in libreoffice were greatly simplified thanks to Rene Engelhard so the problem is gone for the benefit of all. Closes: 707578 --- ...ight-loop-configure-with-unpacking-new-packages | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 test/integration/test-very-tight-loop-configure-with-unpacking-new-packages (limited to 'test/integration') diff --git a/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages b/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages new file mode 100755 index 000000000..7f3b05e59 --- /dev/null +++ b/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages @@ -0,0 +1,46 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +# the difference between version 3 and 4 is the new package 'ure' which +# we have to unpack before we start configuring parts of the loop +insertinstalledpackage 'libreoffice' 'amd64' '3' 'Depends: libreoffice-core (= 3)' +insertinstalledpackage 'libreoffice-core' 'amd64' '3' 'Depends: libreoffice-common (>= 3)' +insertinstalledpackage 'libreoffice-common' 'all' '3' 'Depends: libreoffice-style +Breaks: libreoffice-core (>= 3+), libreoffice-core (<= 3~), libreoffice-style-galaxy (>= 3+), libreoffice-style-galaxy (<= 3~)' +insertinstalledpackage 'libreoffice-style-galaxy' 'amd64' '3' 'Depends: libreoffice-core +Provides: libreoffice-style' + +buildsimplenativepackage 'libreoffice' 'amd64' '4' 'sid' 'Depends: libreoffice-core (= 4)' +buildsimplenativepackage 'libreoffice-core' 'amd64' '4' 'sid' 'Depends: libreoffice-common (>= 4) +Breaks: libreoffice-common (<< 4), libreoffice-style-galaxy (<< 4)' +buildsimplenativepackage 'libreoffice-common' 'all' '4' 'sid' 'Depends: libreoffice-style, ure +Breaks: libreoffice-core (>= 4+), libreoffice-core (<= 4~), libreoffice-style-galaxy (>= 4+), libreoffice-style-galaxy (<= 4~)' +buildsimplenativepackage 'libreoffice-style-galaxy' 'amd64' '4' 'sid' 'Depends: libreoffice-core +Provides: libreoffice-style' + +buildsimplenativepackage 'ure' 'amd64' '4' 'sid' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + ure +The following packages will be upgraded: + libreoffice libreoffice-common libreoffice-core libreoffice-style-galaxy +4 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libreoffice [3] (4 sid [amd64]) [] +Inst libreoffice-style-galaxy [3] (4 sid [amd64]) [libreoffice-common:amd64 on libreoffice-style-galaxy:amd64] [libreoffice-common:amd64 ] +Inst libreoffice-core [3] (4 sid [amd64]) [libreoffice-core:amd64 on libreoffice-common:amd64] [libreoffice-common:amd64 on libreoffice-core:amd64] [libreoffice-common:amd64 on libreoffice-style-galaxy:amd64] [libreoffice-common:amd64 ] +Inst libreoffice-common [3] (4 sid [all]) [] +Inst ure (4 sid [amd64]) +Conf ure (4 sid [amd64]) +Conf libreoffice-style-galaxy (4 sid [amd64]) +Conf libreoffice-common (4 sid [all]) +Conf libreoffice-core (4 sid [amd64]) +Conf libreoffice (4 sid [amd64])' aptget dist-upgrade -s -- cgit v1.2.3 From 8ba17539a3ec33abc283ca382cca6e59876a0f07 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 25 May 2013 19:57:48 +0200 Subject: fix support for multiple patterns in apt-cache search Patterns can appear in the name as well as in the description, they don't have to match all in the name/description only. Closes: 691453 --- test/integration/framework | 12 ++++++-- .../test-bug-691453-apt-cache-search-multi-pattern | 33 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100755 test/integration/test-bug-691453-apt-cache-search-multi-pattern (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 31b12e8bf..e3e868d45 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -483,6 +483,7 @@ insertpackage() { local VERSION="$4" local DEPENDENCIES="$5" local PRIORITY="${6:-optional}" + local DESCRIPTION="${7}" local ARCHS="" for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do if [ "$arch" = 'all' -o "$arch" = 'none' ]; then @@ -504,11 +505,16 @@ Maintainer: Joe Sixpack " >> $FILE echo "Version: $VERSION Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + echo -n 'Description: ' >> $FILE + if [ -z "$DESCRIPTION" ]; then + echo "an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, YOU did something horribly wrong! They are autogenerated - und used only by testcases for APT and surf no other propose… -" >> $FILE + und used only by testcases for APT and surf no other propose…" >> $FILE + else + echo "$DESCRIPTION" >> $FILE + fi + echo >> $FILE done done } diff --git a/test/integration/test-bug-691453-apt-cache-search-multi-pattern b/test/integration/test-bug-691453-apt-cache-search-multi-pattern new file mode 100755 index 000000000..0367892fc --- /dev/null +++ b/test/integration/test-bug-691453-apt-cache-search-multi-pattern @@ -0,0 +1,33 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'native' + +insertpackage 'unstable' 'foobar' 'native' '1' '' '' 'funky tool' +insertpackage 'unstable' 'coolstuff' 'native' '1' '' '' 'funky tool just like foo and bar' +insertpackage 'unstable' 'foo' 'native' '1' '' '' 'tool best used with bar' +insertpackage 'unstable' 'bar' 'native' '1' '' '' 'tool best used with foo' +insertpackage 'unstable' 'baz' 'native' '1' 'Provides: bar' '' 'alternative tool best used with foo' + +setupaptarchive + +# in this special case the following queries should be equal +FOOBAR='foobar - funky tool +coolstuff - funky tool just like foo and bar +foo - tool best used with bar +bar - tool best used with foo +baz - alternative tool best used with foo' + +testequal "$FOOBAR" aptcache search foo +testequal "$FOOBAR" aptcache search bar +testequal "$FOOBAR" aptcache search foo bar + +testequal 'foobar - funky tool +foo - tool best used with bar' aptcache search -n foo +testequal 'foobar - funky tool +bar - tool best used with foo +baz - alternative tool best used with foo' aptcache search -n bar +testequal 'foobar - funky tool' aptcache search -n foo bar -- cgit v1.2.3 From 8437b7d4a699c8a0bfa6c2c2bff66ffff2e36a22 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 28 May 2013 18:08:32 +0200 Subject: tests: trap-adding can be post- as well as prefix For testcases it might sometimes be handy to add trap-actions before the general cleanup, e.g. if it has set directories read- only which rm doesn't want to remove even with --force applied (its fine with files though) Git-Dch: Ignore --- test/integration/framework | 9 ++++++--- test/integration/test-apt-cdrom | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index e3e868d45..7c2aed592 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -125,7 +125,11 @@ exitwithstatus() { } addtrap() { - CURRENTTRAP="$CURRENTTRAP $1" + if [ "$1" = 'prefix' ]; then + CURRENTTRAP="$2 $CURRENTTRAP" + else + CURRENTTRAP="$CURRENTTRAP $1" + fi trap "$CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM } @@ -135,8 +139,7 @@ setupenvironment() { msgninfo "Preparing environment for ${CCMD}$(basename $0)${CINFO} in ${TMPWORKINGDIRECTORY}… " BUILDDIRECTORY="${TESTDIRECTORY}/../../build/bin" test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first" - local OLDWORKINGDIRECTORY=$(pwd) - addtrap "cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY;" + addtrap "cd /; rm -rf $TMPWORKINGDIRECTORY;" cd $TMPWORKINGDIRECTORY mkdir rootdir aptarchive keys cd rootdir diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index f1c4fd9d3..3394aa505 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -24,7 +24,7 @@ cat Translation-de | xz --format=lzma > Translation-de.lzma cat Translation-de | xz > Translation-de.xz rm Translation-en Translation-de cd - > /dev/null -addtrap "chmod -R +w $PWD/rootdir/media/cdrom/dists/;" +addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;" chmod -R -w rootdir/media/cdrom/dists aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -- cgit v1.2.3 From 2842f3e6c42ac6c6512a290064326d55bfa62a40 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 28 May 2013 18:17:55 +0200 Subject: tests: add expected port for cve-2013-105 testcase Git-Dch: Ignore --- test/integration/test-cve-2013-1051-InRelease-parsing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index bd68fccf6..853da5ff6 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -12,7 +12,7 @@ insertpackage 'stable' 'good-pkg' 'all' '1.0' setupaptarchive changetowebserver -ARCHIVE='http://localhost/' +ARCHIVE='http://localhost:8080/' msgtest 'Initial apt-get update should work with' 'InRelease' aptget update -qq && msgpass || msgfail -- cgit v1.2.3 From b2ea1a47531266377abe4f12c6f21417ea96eea0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Jun 2013 18:58:34 +0200 Subject: ensure state-dir exists before coyping cdrom files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do the same in the acquire system which handles the 'normal' downloads, so do it here as well even though its unlikely anyone will ever notice (beside testcases of course …) --- test/integration/framework | 8 +++++--- test/integration/test-apt-cdrom | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 7c2aed592..5c50498a2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -692,9 +692,11 @@ setupaptarchive() { setupflataptarchive fi signreleasefiles - msgninfo "\tSync APT's cache with the archive… " - aptget update -qq - msgdone "info" + if [ "$1" != '--no-update' ]; then + msgninfo "\tSync APT's cache with the archive… " + aptget update -qq + msgdone "info" + fi } signreleasefiles() { diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 3394aa505..6e3533152 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -7,7 +7,7 @@ setupenvironment configarchitecture 'amd64' 'i386' buildsimplenativepackage 'testing' 'amd64,i386' '0.8.15' 'stable' -setupaptarchive +setupaptarchive --no-update changetocdrom 'Debian APT Testdisk 0.8.15' -- cgit v1.2.3 From 8b8cc7bf85ac187bb9333f56c4c2c4dba27d3a7e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Jun 2013 22:13:20 +0200 Subject: tests: add an interactive 'test' with multiple cdroms Can't be used as a test as is, but shows how to build multiple CD-ROMs for tests and can be used to reproduce debbug #711456. Git-Dch: Ignore --- ...kip-bug-711456-apt-cdrom-multiple-cds-multiarch | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 test/integration/skip-bug-711456-apt-cdrom-multiple-cds-multiarch (limited to 'test/integration') diff --git a/test/integration/skip-bug-711456-apt-cdrom-multiple-cds-multiarch b/test/integration/skip-bug-711456-apt-cdrom-multiple-cds-multiarch new file mode 100755 index 000000000..9e683b5b9 --- /dev/null +++ b/test/integration/skip-bug-711456-apt-cdrom-multiple-cds-multiarch @@ -0,0 +1,47 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'testing' 'amd64,i386' '0.8.15' 'stable' 'Depends: libtest' +buildsimplenativepackage 'libtest' 'amd64,i386' '0.8.15' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'libtest' 'amd64,i386' '1' 'unstable' 'Multi-Arch: same' + +# needed by the ftparchive.conf +cd aptarchive +ln -s ../incoming pool +createaptftparchiveconfig +cd - >/dev/null +# create an amd64 cdrom +sed -i 's#Architectures .*$#Architectures "amd64 source";#' aptarchive/ftparchive.conf +setupaptarchive --no-update +changetocdrom 'Debian APT Testdisk amd64 0.8.15' +mv rootdir/media/cdrom rootdir/media/cdrom-amd64 +addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom-amd64/dists/;" +chmod -R -w rootdir/media/cdrom-amd64/dists +ln -s $PWD/rootdir/media/cdrom-amd64 $PWD/rootdir/media/cdrom +aptcdrom add -m -o quiet=1 +rm $PWD/rootdir/media/cdrom +# do it again to create a i386 cdrom +sed -i 's#Architectures .*$#Architectures "i386 source";#' aptarchive/ftparchive.conf +setupaptarchive --no-update +changetocdrom 'Debian APT Testdisk i386 0.8.15' +mv rootdir/media/cdrom rootdir/media/cdrom-i386 +addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom-i386/dists/;" +chmod -R -w rootdir/media/cdrom-i386/dists +ln -s $PWD/rootdir/media/cdrom-i386 $PWD/rootdir/media/cdrom +aptcdrom add -m -o quiet=1 + +# play with the cdroms +testdpkgnotinstalled testing +aptget install testing -t stable -y #> /dev/null 2>&1 +testdpkginstalled testing + +testdpkgnotinstalled testing:i386 +aptget install testing:i386 -t stable -y #> /dev/null 2>&1 +testdpkginstalled testing:i386 + +aptget dist-upgrade -y -- cgit v1.2.3 From 99359751efb1ad84e877219639030feb47fb28f7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 16 Jun 2013 15:42:31 +0200 Subject: handle missing "Description" in apt-cache show do not blindly assume that all packages stanzas have a "Description:" field in 'apt-cache show' as well as in the cache creation itself. We instead assume now that if the stanza has a Description, it will not be the first field as we look out for "\nDescription" to take care of MD5sum as well as (maybe ignored) translated Descriptions embedded in the package stanza. Closes: #712435 --- .../test-bug-712435-missing-descriptions | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 test/integration/test-bug-712435-missing-descriptions (limited to 'test/integration') diff --git a/test/integration/test-bug-712435-missing-descriptions b/test/integration/test-bug-712435-missing-descriptions new file mode 100755 index 000000000..9b3c2ee50 --- /dev/null +++ b/test/integration/test-bug-712435-missing-descriptions @@ -0,0 +1,89 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +PACKAGESTANZA='Version: 0.9.7.8 +Installed-Size: 3270 +Maintainer: APT Development Team +Architecture: amd64 +Filename: pool/main/a/apt/apt_0.9.7.8_amd64.deb +MD5sum: 3a622acda41620df50aa22a9fac6f32e' + +DESCRIPTION='Description: commandline package manager + This APT has Super Cow Powers.' + +TRANSDESCRIPTION='Description-en: commandline package manager + This APT has translated Super Cow Powers.' + +echo "Package: apt-normal +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +Package: apt-both-below +$PACKAGESTANZA +$DESCRIPTION +$TRANSDESCRIPTION +Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + +Package: apt-both-middle +$PACKAGESTANZA +$DESCRIPTION +Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +$TRANSDESCRIPTION + +Package: apt-both-top +$PACKAGESTANZA +Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +$DESCRIPTION +$TRANSDESCRIPTION + +Package: apt-trans +$PACKAGESTANZA +$TRANSDESCRIPTION +Description-md5: cccccccccccccccccccccccccccccccc + +Package: apt-md5 +$PACKAGESTANZA +Description-md5: dddddddddddddddddddddddddddddddd + +Package: apt-none +$PACKAGESTANZA" > aptarchive/Packages + +setupaptarchive + +testequal "Package: apt-normal +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +" aptcache show apt-normal + +# displaying the translated Description would be equally valid, +# but we assume only one description is in a Packages file and +# so we prefer "Description" over "Description-*" currently. +for variant in 'below' 'middle' 'top'; do + testequal "Package: apt-both-$variant +$PACKAGESTANZA +$DESCRIPTION +Description-md5: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +" aptcache show apt-both-$variant +done + +testequal "Package: apt-trans +$PACKAGESTANZA +$TRANSDESCRIPTION +Description-md5: cccccccccccccccccccccccccccccccc +" aptcache show apt-trans + +testequal "Package: apt-md5 +$PACKAGESTANZA +Description-md5: dddddddddddddddddddddddddddddddd +" aptcache show apt-md5 + +testequal "Package: apt-none +$PACKAGESTANZA +" aptcache show apt-none -- cgit v1.2.3 From fbd29dd60a195a5c252ba1d28366d52d60447560 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 15 Jun 2013 15:45:22 +0200 Subject: add a simple webserver for our testcases APT needs to acquire data in a secure fashion over an inherently unsecure way, known as the internet, while communicating with unreliable partners, known as webservers and proxies. For your integration tests we so far relied on 'normal' webservers, but all of them have certain quirks and none is able to provide us with all quirks which can be observed in the wild and we therefore have to test with, so this webserver isn't trying to be fast, secure or feature complete, but to provide all the quirks we need in a consistent way. This webserver also makes the APT project self-contained, as it is now able to generate, serve as well as acquire package indexes. ;) Git-Dch: Ignore --- test/integration/framework | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 5c50498a2..9db4a1017 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -718,12 +718,20 @@ signreleasefiles() { } changetowebserver() { - if which weborf > /dev/null; then - weborf -xb aptarchive/ 2>&1 > /dev/null & + local LOG='/dev/null' + if test -x ${BUILDDIRECTORY}/aptwebserver; then + cd aptarchive + LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver "$@" >$LOG 2>&1 & + addtrap "kill $!;" + cd - > /dev/null + elif [ $# -gt 0 ]; then + msgdie 'Need the aptwebserver when passing arguments for the webserver' + elif which weborf > /dev/null; then + weborf -xb aptarchive/ >$LOG 2>&1 & addtrap "kill $!;" elif which gatling > /dev/null; then cd aptarchive - gatling -p 8080 -F -S 2>&1 > /dev/null & + gatling -p 8080 -F -S >$LOG 2>&1 & addtrap "kill $!;" cd - > /dev/null elif which lighttpd > /dev/null; then @@ -731,11 +739,10 @@ changetowebserver() { server.port = 8080 server.stat-cache-engine = \"disable\"" > lighttpd.conf lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' - lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & + lighttpd -D -f lighttpd.conf >$LOG 2>&1 & addtrap "kill $!;" else - msgdie 'You have to install weborf or lighttpd first' - return 1 + msgdie 'You have to build aptwerbserver or install a webserver' fi local APTARCHIVE="file://$(readlink -f ./aptarchive)" for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do -- cgit v1.2.3 From 7ea27d2a6d10ee41f8fca5d8ad7373c8b3d90ea9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 15 Jun 2013 23:58:12 +0200 Subject: simple URI rewrite rules config for webserver we have a test which required traditionally lighttpd to be executed as it requires a webserver supporting some kind of URI rewriting. Now with some lines of code our own webserver can do this and the testcase can be enabled by default. This test hinted at the bug fixed in the previous commit, so having more tests which can easily be run is a good thing. Git-Dch: Ignore --- test/integration/skip-bug-602412-dequote-redirect | 38 ----------------------- test/integration/test-bug-602412-dequote-redirect | 29 +++++++++++++++++ 2 files changed, 29 insertions(+), 38 deletions(-) delete mode 100755 test/integration/skip-bug-602412-dequote-redirect create mode 100755 test/integration/test-bug-602412-dequote-redirect (limited to 'test/integration') diff --git a/test/integration/skip-bug-602412-dequote-redirect b/test/integration/skip-bug-602412-dequote-redirect deleted file mode 100755 index 689b671ce..000000000 --- a/test/integration/skip-bug-602412-dequote-redirect +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework -setupenvironment -configarchitecture 'i386' - -if ! which lighttpd > /dev/null; then - msgdie 'You need lighttpd for this testcase, sorry…' - exit 1 -fi - -buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' - -setupaptarchive - -echo "server.modules = ( \"mod_redirect\" ) -server.document-root = \"$(readlink -f ./aptarchive)\" -server.port = 8080 -server.stat-cache-engine = \"disable\" -url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\", - \"^/dists/(.*)$\" => \"/newdists/\$1\" )" > lighttpd.conf - -mv aptarchive/pool aptarchive/newpool -mv aptarchive/dists aptarchive/newdists - -lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' -lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & -addtrap "kill $!;" - -APTARCHIVE="file://$(readlink -f ./aptarchive)" -for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do - sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#" -done - -aptget update || msgdie 'apt-get update failed' -aptget install unrelated --download-only || msgdie 'downloading package failed' diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect new file mode 100755 index 000000000..c20443559 --- /dev/null +++ b/test/integration/test-bug-602412-dequote-redirect @@ -0,0 +1,29 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' + +setupaptarchive +changetowebserver -o aptwebserver::redirect::replace::/pool/=/newpool/ \ + -o aptwebserver::redirect::replace::/dists/=/newdists/ + +mv aptarchive/pool aptarchive/newpool +mv aptarchive/dists aptarchive/newdists + +msgtest 'Test redirection works in' 'apt-get update' +aptget update -qq && msgpass || msgfail + +# check that I-M-S header is kept in redirections +testequal 'Hit http://localhost:8080 unstable InRelease +Hit http://localhost:8080 unstable/main Sources +Hit http://localhost:8080 unstable/main amd64 Packages +Hit http://localhost:8080 unstable/main Translation-en +Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1 + +msgtest 'Test redirection works in' 'package download' +aptget install unrelated --download-only -qq && msgpass || msgfail -- cgit v1.2.3 From 5229b285f07edd5ed695c264c8d80310f339af96 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 16 Jun 2013 23:23:28 +0200 Subject: tests: accept an explaination for msgfail Git-Dch: Ignore --- test/integration/framework | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 9db4a1017..3f11ac23b 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -38,7 +38,11 @@ msgtest() { } msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } -msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); } +msgfail() { + if [ $# -gt 0 ]; then echo "${CFAIL}FAIL: $*${CNORMAL}" >&2; + else echo "${CFAIL}FAIL${CNORMAL}" >&2; fi + EXIT_CODE=$((EXIT_CODE+1)); +} # enable / disable Debugging MSGLEVEL=${MSGLEVEL:-3} @@ -56,9 +60,9 @@ if [ $MSGLEVEL -le 2 ]; then msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; } msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; } if [ -n "$CFAIL" ]; then - msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; } + msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); } else - msgfail() { echo -n " ###FAILED###" >&2; } + msgfail() { echo -n " ###FAILED###" >&2; EXIT_CODE=$((EXIT_CODE+1)); } fi fi if [ $MSGLEVEL -le 3 ]; then -- cgit v1.2.3 From ae99ce2e3cadb07c80b89ab2afc804875b1026c5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 17 Jun 2013 11:23:13 +0200 Subject: trigger NODATA error for invalid InRelease files With the selfgrown splitting we got the problem of not recovering from networks which just reply with invalid data like those sending us login pages to authenticate with the network (e.g. hotels) back. The good thing about the InRelease file is that we know that it must be clearsigned (a Release file might or might not have a detached sig) so if we get a file but are unable to split it something is seriously wrong, so there is not much point in trying further. The Acquire system already looks out for a NODATA error from gpgv, so this adds a new error message sent to the acquire system in case the splitting we do now ourselves failed including this magic word. Closes: #712486 --- test/integration/framework | 3 + .../test-ubuntu-bug-346386-apt-get-update-paywall | 64 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 test/integration/test-ubuntu-bug-346386-apt-get-update-paywall (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 3f11ac23b..3a02cfb76 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -118,6 +118,9 @@ gdb() { echo "gdb: run »$*«" APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1 } +http() { + LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http +} exitwithstatus() { # error if we about to overflow, but ... diff --git a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall new file mode 100755 index 000000000..1576c396c --- /dev/null +++ b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall @@ -0,0 +1,64 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'native' + +insertpackage 'unstable' 'unrelated' 'all' '1.0' 'stable' +insertsource 'unstable' 'unrelated' 'all' '1.0' 'stable' + +echo 'ni ni ni' > aptarchive/knights + +setupaptarchive +changetowebserver -o 'aptwebserver::overwrite::.*::filename=/knights' + +msgtest 'Acquire test file from the webserver to check' 'overwrite' +echo '601 Configuration +Config-Item: Acquire::http::DependOnSTDIN=0 + +600 Acquire URI +URI: http://localhost:8080/holygrail +Filename: knights-talking +' | http >/dev/null 2>&1 && msgpass || msgfail +testfileequal knights-talking 'ni ni ni' + +ensure_n_canary_strings_in_dir() { + local DIR="$1" + local CANARY_STRING="$2" + local EXPECTED_N="$3" + + msgtest "Testing in $DIR for $EXPECTED_N canary" "$CANARY_STRING" + local N=$(grep "$CANARY_STRING" $DIR/* 2>/dev/null |wc -l ) + test "$N" = "$EXPECTED_N" && msgpass || msgfail "Expected $EXPECTED_N canaries, got $N" +} + +LISTS='rootdir/var/lib/apt/lists' +rm -rf rootdir/var/lib/apt/lists +msgtest 'Got expected NODATA failure in' 'apt-get update' +aptget update -qq 2>&1 | grep -q 'E: GPG error.*NODATA' && msgpass || msgfail + +ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 +testequal 'partial' ls $LISTS + +# and again with pre-existing files with "valid data" which should remain +for f in Release Release.gpg main_binary-amd64_Packages main_source_Sources; do + echo 'peng neee-wom' > $LISTS/localhost:8080_dists_stable_${f} +done + +msgtest 'Got expected NODATA failure in' 'apt-get update' +aptget update -qq 2>&1 | grep -q 'E: GPG error.*NODATA' && msgpass || msgfail + +ensure_n_canary_strings_in_dir $LISTS 'peng neee-wom' 4 +ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 + +# and now with a pre-existing InRelease file +echo 'peng neee-wom' > $LISTS/localhost:8080_dists_stable_InRelease +rm -f $LISTS/localhost:8080_dists_stable_Release $LISTS/localhost:8080_dists_stable_Release.gpg +msgtest 'excpected failure of' 'apt-get update' +aptget update -qq 2>&1 | grep -q 'E: GPG error.*NODATA' && msgpass || msgfail + +ensure_n_canary_strings_in_dir $LISTS 'peng neee-wom' 3 +ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 -- cgit v1.2.3 From e3c62328abbd548bb0da42fdbad954b3ce4f7102 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 24 Jun 2013 16:34:38 +0200 Subject: simple fork and pidfile aptwebserver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forking only after being ready to accept clients avoids running races with the tests which sometimes failed on the first 'apt-get update' (or similar) with the previous background-start and hope for the best… The commit fixes also some oversight output-order changes in regards to Description-md5 and (I-M-S) race conditions in various tests. Git-Dch: Ignore --- test/integration/Packages-pdiff-usage | 2 ++ test/integration/Packages-pdiff-usage-new | 2 ++ test/integration/Packages-releasefile-verification | 1 + .../Packages-releasefile-verification-new | 1 + test/integration/framework | 18 ++++++++++--- .../test-bug-590041-prefer-non-virtual-packages | 2 ++ .../test-bug-601016-description-translation | 31 ++++++++++++++-------- .../test-cve-2013-1051-InRelease-parsing | 2 +- test/integration/test-pdiff-usage | 2 +- test/integration/test-releasefile-verification | 4 +-- 10 files changed, 46 insertions(+), 19 deletions(-) (limited to 'test/integration') diff --git a/test/integration/Packages-pdiff-usage b/test/integration/Packages-pdiff-usage index d1530a95c..ac962f29a 100644 --- a/test/integration/Packages-pdiff-usage +++ b/test/integration/Packages-pdiff-usage @@ -19,6 +19,7 @@ Description: Advanced front-end for dpkg . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc. +Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c Package: oldstuff Version: 1.0 @@ -32,3 +33,4 @@ SHA1: 3c695e028f74d5c544deeddaaa1242desa81088c SHA256: b46fd1546151c545fe4bfa56a5cc0e7deaef23e2da3e4f129727fd660f28f050 Description: some cool but old stuff This package will disappear in the next mirror update +Description-md5: 1948af60eda0a41dfa9fe83f60eb8389 diff --git a/test/integration/Packages-pdiff-usage-new b/test/integration/Packages-pdiff-usage-new index 4f374b37f..f8d7b1958 100644 --- a/test/integration/Packages-pdiff-usage-new +++ b/test/integration/Packages-pdiff-usage-new @@ -22,6 +22,7 @@ Description: Advanced front-end for dpkg . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc. +Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c Package: newstuff Version: 1.0 @@ -35,3 +36,4 @@ SHA1: 3c695e028f7a1ae324deeddaaa1242desa81088c SHA256: b46fd154615edefab321cc56a5cc0e7deaef23e2da3e4f129727fd660f28f050 Description: some cool and shiny new stuff This package will appear in the next mirror update +Description-md5: d5f89fbbc2ac69c43d7e4c9b67d82b6b diff --git a/test/integration/Packages-releasefile-verification b/test/integration/Packages-releasefile-verification index 29a385f4f..eb7327279 100644 --- a/test/integration/Packages-releasefile-verification +++ b/test/integration/Packages-releasefile-verification @@ -16,3 +16,4 @@ Description: Advanced front-end for dpkg . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc. +Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c diff --git a/test/integration/Packages-releasefile-verification-new b/test/integration/Packages-releasefile-verification-new index e3b2edf1f..61509d157 100644 --- a/test/integration/Packages-releasefile-verification-new +++ b/test/integration/Packages-releasefile-verification-new @@ -19,3 +19,4 @@ Description: Advanced front-end for dpkg . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc. +Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c diff --git a/test/integration/framework b/test/integration/framework index 3a02cfb76..7dd7c20a7 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -605,9 +605,12 @@ buildaptarchivefromfiles() { cat ${line} | bzip2 > ${line}.bz2 cat ${line} | xz --format=lzma > ${line}.lzma cat ${line} | xz > ${line}.xz + if [ -n "$1" ]; then + touch -d "$1" ${line}.gz ${line}.bz2 ${line}.lzma ${line}.xz + fi msgdone "info" done - generatereleasefiles + generatereleasefiles "$@" } # can be overridden by testcases for their pleasure @@ -719,7 +722,10 @@ signreleasefiles() { done for RELEASE in $(find aptarchive/ -name Release); do gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" -abs -o ${RELEASE}.gpg ${RELEASE} - gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" --clearsign -o "$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')" $RELEASE + local INRELEASE="$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')" + gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" --clearsign -o $INRELEASE $RELEASE + # we might have set a specific date for the Release file, so copy it + touch -d "$(stat --format "%y" ${RELEASE})" ${RELEASE}.gpg ${INRELEASE} done msgdone "info" } @@ -728,8 +734,12 @@ changetowebserver() { local LOG='/dev/null' if test -x ${BUILDDIRECTORY}/aptwebserver; then cd aptarchive - LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver "$@" >$LOG 2>&1 & - addtrap "kill $!;" + LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver -o aptwebserver::fork=1 "$@" >$LOG 2>&1 + local PID="$(cat aptwebserver.pid)" + if [ -z "$PID" ]; then + msgdie 'Could not fork aptwebserver successfully' + fi + addtrap "kill $PID;" cd - > /dev/null elif [ $# -gt 0 ]; then msgdie 'Need the aptwebserver when passing arguments for the webserver' diff --git a/test/integration/test-bug-590041-prefer-non-virtual-packages b/test/integration/test-bug-590041-prefer-non-virtual-packages index e0dd7737f..0ce4c1413 100755 --- a/test/integration/test-bug-590041-prefer-non-virtual-packages +++ b/test/integration/test-bug-590041-prefer-non-virtual-packages @@ -9,6 +9,7 @@ pkglibc6="Package: libc6 Architecture: armel Version: 2.11.2-2~0.3 Description: Embedded GNU C Library: Shared libraries +Description-md5: b8c1e0561b75e2dc6b6482a99079c3e4 Filename: pool/main/e/eglibc/libc6_2.11.2-2_armel.deb Installed-Size: 9740 MD5sum: f5b878ce5fb8aa01a7927fa1460df537 @@ -25,6 +26,7 @@ Architecture: i386 Version: 2.1.3-13~0.3 Replaces: libc6 (<< 2.2.5-13~0.3) Description: The Berkeley database routines [glibc 2.0/2.1 compatibility] +Description-md5: de1876f7fe7f7709a110875e145e38a8 Filename: pool/main/d/db1-compat/libdb1-compat_2.1.3-13_armel.deb Installed-Size: 136 MD5sum: 4043f176ab2b40b0c01bc1211b8c103c diff --git a/test/integration/test-bug-601016-description-translation b/test/integration/test-bug-601016-description-translation index 03fddbfda..33c209e9d 100755 --- a/test/integration/test-bug-601016-description-translation +++ b/test/integration/test-bug-601016-description-translation @@ -9,8 +9,9 @@ configarchitecture 'i386' 'amd64' # we need a valid locale here, otherwise the language configuration # will be overridden by LC_ALL=C LOCALE="$(echo "$LANG" | cut -d'_' -f 1)" +MD5Sum='Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' -PACKAGESTANZA="Package: apt +PACKAGESTANZA='Package: apt Priority: important Section: admin Installed-Size: 5984 @@ -19,8 +20,7 @@ Architecture: i386 Version: 0.8.7 Filename: pool/main/a/apt/apt_0.8.7_i386.deb Size: 2140230 -MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08 -Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c" +MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08' PACKAGESTANZA2='Package: apt Priority: important @@ -31,22 +31,23 @@ Architecture: amd64 Version: 0.8.7 Filename: pool/main/a/apt/apt_0.8.7_amd64.deb Size: 2210342 -MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a -Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' +MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a' echo "$PACKAGESTANZA Description: Advanced front-end for dpkg +$MD5Sum $PACKAGESTANZA2 -Description: Advanced front-end for dpkg" > aptarchive/Packages +Description: Advanced front-end for dpkg +$MD5Sum" > aptarchive/Packages echo "Package: apt -Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c 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." | bzip2 > aptarchive/${LOCALE}.bz2 + um Pakete zu installieren und Upgrades durchzuführen. +$MD5Sum" | bzip2 > aptarchive/${LOCALE}.bz2 # 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-*) @@ -54,10 +55,12 @@ echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate NOLONGSTANZA="$PACKAGESTANZA Description: Advanced front-end for dpkg +$MD5Sum " ENGLISHSTANZA="$PACKAGESTANZA Description: Advanced front-end for dpkg +$MD5Sum " LOCALESTANZA="$PACKAGESTANZA @@ -66,6 +69,7 @@ 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 " LOCALESTANZA2="$PACKAGESTANZA2 Description-${LOCALE}: Mächtige Oberfläche für dpkg @@ -73,6 +77,7 @@ 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 " testrun() { @@ -97,28 +102,32 @@ testrun echo "$PACKAGESTANZA Description: Advanced front-end for dpkg +$MD5Sum $PACKAGESTANZA2 -Description: Advanced front-end for dpkg" > aptarchive/Packages +Description: Advanced front-end for dpkg +$MD5Sum" > aptarchive/Packages echo "Package: apt -Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c 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." | bzip2 > aptarchive/en.bz2 + simpler, safer way to install and upgrade packages. +$MD5Sum" | bzip2 > aptarchive/en.bz2 ENGLISHSTANZA="$PACKAGESTANZA 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 " 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. +$MD5Sum " testrun diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index 853da5ff6..6764fefff 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -37,7 +37,7 @@ sed -i '/^-----BEGIN PGP SIGNATURE-----/,/^-----END PGP SIGNATURE-----/ s/^$/ / # we append the (evil unsigned) Release file to the (good signed) InRelease cat aptarchive/dists/stable/Release >> aptarchive/dists/stable/InRelease - +touch -d '+1hour' aptarchive/dists/stable/InRelease # ensure the update fails # useful for debugging to add "-o Debug::pkgAcquire::auth=true" diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 29301d07d..e45326970 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -35,7 +35,7 @@ SHA1-History: SHA1-Patches: 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28 $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX -generatereleasefiles +generatereleasefiles '+1hour' signreleasefiles find aptarchive -name 'Packages*' -type f -delete aptget update -qq diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index fba7ab290..e56f458d3 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -184,5 +184,5 @@ runtest2 DELETEFILE="InRelease" runtest -#DELETEFILE="Release.gpg" -#runtest +DELETEFILE="Release.gpg" +runtest -- cgit v1.2.3 From 7a948ec719ecc020c2337fe3f41c5fc42699e2c1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 26 Jun 2013 17:37:57 +0200 Subject: Version 3 for DPkg::Pre-Install-Pkgs with MultiArch info Adds on top of Version 2 to all displayed version numbers the architecture as well as the MultiArch flag for consumption by the hooks. Most of the time the architecture will be the same for both versions displayed, but packages might change from "all" to "any" (or back) between versions so we can't display the architecture for packages. Pseudo-Format for Version 3: Examples: stuff - - none < 1 amd64 none **CONFIGURE** libsame 1 i386 same < 2 i386 same **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE** libsame 2 i386 same > - - none **REMOVE** toolkit 1 all foreign > - - none **REMOVE** Closes: #712116 --- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch (limited to 'test/integration') diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch new file mode 100755 index 000000000..aee44f76b --- /dev/null +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'toolkit' 'all' '1' 'stable' 'Multi-Arch: foreign' +buildsimplenativepackage 'toolkit' 'amd64' '2' 'unstable' 'Multi-Arch: foreign' +buildsimplenativepackage 'libsame' 'i386,amd64' '1' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same' +buildsimplenativepackage 'stuff' 'i386,amd64' '1' 'stable' 'Depends: libsame (= 1), toolkit (= 1)' +buildsimplenativepackage 'stuff' 'i386,amd64' '2' 'unstable' 'Depends: libsame (= 2), toolkit (= 2)' + +setupaptarchive + +hook='pre-install-pkgs' + +enablehookversion() { + echo "#!/bin/sh +while read line; do + if echo \"\$line\" | grep -Fq '**'; then + echo \"\$line\" + fi +done > ${hook}-v${1}.list" > ${hook}-v${1}.sh + chmod +x ${hook}-v${1}.sh + echo "dpkg::${hook}:: \"./${hook}-v${1}.sh --foo -bar\"; +DPkg::Tools::options::\"./${hook}-v${1}.sh\"::Version \"$1\";" > rootdir/etc/apt/apt.conf.d/hook-v$1 +} + +enablehookversion 2 +enablehookversion 3 + +observehook() { + rm -f ${hook}-v2.list ${hook}-v3.list + msgtest 'Observe hooks while' "$*" + aptget "$@" -y --force-yes >/dev/null 2>&1 && msgpass || msgfail +} + +observehook install stuff -t stable +testfileequal "${hook}-v2.list" 'libsame - < 1 **CONFIGURE** +toolkit - < 1 **CONFIGURE** +stuff - < 1 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame - - none < 1 amd64 same **CONFIGURE** +toolkit - - none < 1 all foreign **CONFIGURE** +stuff - - none < 1 amd64 none **CONFIGURE**' + +observehook install stuff -t unstable +testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** +toolkit 1 < 2 **CONFIGURE** +stuff 1 < 2 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame 1 amd64 same < 2 amd64 same **CONFIGURE** +toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE** +stuff 1 amd64 none < 2 amd64 none **CONFIGURE**' + +observehook install stuff:i386 -t unstable +testfileequal "${hook}-v2.list" 'stuff 2 > - **REMOVE** +libsame - < 2 **CONFIGURE** +stuff - < 2 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'stuff 2 amd64 none > - - none **REMOVE** +libsame - - none < 2 i386 same **CONFIGURE** +stuff - - none < 2 i386 none **CONFIGURE**' + +observehook remove libsame +testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**' + +observehook install stuff:i386/stable libsame:i386/stable toolkit/stable +testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE** +toolkit 2 > 1 **CONFIGURE** +stuff 2 > 1 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame 2 i386 same > 1 i386 same **CONFIGURE** +toolkit 2 amd64 foreign > 1 all foreign **CONFIGURE** +stuff 2 i386 none > 1 i386 none **CONFIGURE**' + +observehook install 'libsame:*' +testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** +libsame - < 2 **CONFIGURE** +toolkit 1 < 2 **CONFIGURE** +stuff 1 < 2 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame 1 i386 same < 2 i386 same **CONFIGURE** +libsame - - none < 2 amd64 same **CONFIGURE** +toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE** +stuff 1 i386 none < 2 i386 none **CONFIGURE**' + +observehook purge stuff:i386 'libsame:*' toolkit +testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE** +stuff 2 > - **REMOVE** +libsame 2 > - **REMOVE** +toolkit 2 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE** +stuff 2 i386 none > - - none **REMOVE** +libsame 2 i386 same > - - none **REMOVE** +toolkit 2 amd64 foreign > - - none **REMOVE**' -- cgit v1.2.3 From 3d1be93dc4242df2b93de632715a8aa7dd34f96f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 28 Jun 2013 20:42:18 +0200 Subject: implement arch+= and arch-= for sources.list Default is to acquire all architectures from APT::Architectures which can be changed by arch=, but this isn't very flexible if you want "mostly" the default as you have to hardcode the architectures then, so arch-= and arch+= can be used to add/remove architectures from the default set. On a machine with 'amd64' and 'i386' configured the lines: deb [arch+=armel] http://example.org/debian wheezy rocks deb [arch-=amd64] http://example.org/debian jessie rocks will result in the download of: wheezy Packages for 'amd64', 'i386' and 'armel' jessie Packages for 'i386' --- .../test-sourceslist-arch-plusminus-options | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 test/integration/test-sourceslist-arch-plusminus-options (limited to 'test/integration') diff --git a/test/integration/test-sourceslist-arch-plusminus-options b/test/integration/test-sourceslist-arch-plusminus-options new file mode 100755 index 000000000..0d4d7448f --- /dev/null +++ b/test/integration/test-sourceslist-arch-plusminus-options @@ -0,0 +1,85 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +testbinaries() { + msgtest 'Test acquired archs for' "$1" + shift + rm -f gotarchs.list + aptget update --print-uris | grep -o '/binary-[a-z0-9-]\+/Packages' | sort > gotarchs.list + while [ -n "$1" ]; do + echo "/binary-${1}/Packages" + shift + done | sort | checkdiff - gotarchs.list && msgpass || msgfail +} + +echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'default & native' 'amd64' +configarchitecture 'amd64' 'i386' +testbinaries 'default & native + foreign' 'amd64' 'i386' +configarchitecture 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' +testbinaries 'default & native + many foreigns' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=native' 'amd64' + +echo 'deb [arch=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=foreign' 'mips' + +echo 'deb [arch=kfreebsd-armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=unknown' 'kfreebsd-armel' + +echo 'deb [arch=amd64,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=native,foreign' 'amd64' 'i386' + +echo 'deb [arch=mips,armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=foreign,foreign' 'mips' 'armhf' + +echo 'deb [arch=kfreebsd-armel,hurd-powerpc,mipsel,armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=unknown,unknown,foreign,foreign' 'kfreebsd-armel' 'hurd-powerpc' 'mipsel' 'armel' + +echo 'deb [arch+=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=native' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch+=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=foreign,foreign,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch+=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' + +echo 'deb [arch+=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=foreign,unknown,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' + +echo 'deb [arch-=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=native' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mipsel' + +echo 'deb [arch-=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=foreign,foreign,foreign' 'amd64' 'armel' 'mipsel' + +echo 'deb [arch-=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch-=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=foreign,unknown,foreign' 'amd64' 'armel' 'armhf' 'mipsel' + +echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'substract from a arch-set' 'i386' + +echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'useless substract from a arch-set' 'i386' + +echo 'deb [arch=mips,i386 arch+=armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf' + +echo 'deb [arch=mips,i386 arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'useless addition to a arch-set' 'i386' 'mips' -- cgit v1.2.3 From 486d190d3c66bb7271509dc002f8ec9e9eb0166c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 10 Jul 2013 13:06:05 +0200 Subject: prevent MarkInstall of unsynced Multi-Arch:same siblings Multi-Arch: same packages can be co-installed, but need to have the same version for all installed packages (aka "siblings"). Otherwise the unsynced versions will fight against each other and the auto-install as wel as the problem resolver will later have to decide between holding the packages or to remove one of the siblings (usually a foreign) taking a bunch of packages (like the entire foreign setup) with them. The idea here is now to be more pro-active: MarkInstall will fail for a package if the siblings aren't synced, so we don't allow a situation in which a resolver has to decide if to hold or to remove-upgrade under the assumption that the remove-upgrade decision is always wrong and doesn't deserve to be explored (expect valid out-of-syncs of course). Thats a pretty bold move to take for a library which is used by different solvers so this check is done in IsInstallOk and can be overridden if front-ends want to. --- ...prevent-markinstall-multiarch-same-versionscrew | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 test/integration/test-prevent-markinstall-multiarch-same-versionscrew (limited to 'test/integration') diff --git a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew new file mode 100755 index 000000000..fed12dad0 --- /dev/null +++ b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew @@ -0,0 +1,100 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' 'armel' + +insertpackage 'stable' 'allarchs' 'all' '1' +insertpackage 'unstable' 'allarchs' 'all' '2' + +insertinstalledpackage 'fine' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'fine' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'fine' 'amd64,i386' '2' 'Multi-Arch: same' + +insertinstalledpackage 'fine-installed' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'fine-installed' 'i386,amd64,armel' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'fine-installed' 'i386,amd64' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-native' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-native' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-native' 'amd64' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-foreign' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-foreign' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-foreign' 'i386' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-gone-native' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-gone-native' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-gone-native' 'i386' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-gone-foreign' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-gone-foreign' 'amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-gone-foreign' 'amd64' '2' 'Multi-Arch: same' + +insertpackage 'stable' 'libsame2' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'libsame2' 'amd64' '2' 'Multi-Arch: same' +insertpackage 'unstable' 'depender2' 'all' '2' 'Depends: libsame2 (= 2)' +insertpackage 'stable' 'libsame3' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'libsame3' 'i386,amd64' '3' 'Multi-Arch: same' +insertpackage 'unstable' 'depender3' 'all' '3' 'Depends: libsame3 (= 3)' +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + out-of-sync-gone-foreign:i386 out-of-sync-gone-native +The following packages have been kept back: + out-of-sync-foreign:i386 out-of-sync-native +The following packages will be upgraded: + fine fine:i386 fine-installed fine-installed:i386 out-of-sync-gone-foreign + out-of-sync-gone-native:i386 +6 upgraded, 0 newly installed, 2 to remove and 2 not upgraded. +Remv out-of-sync-gone-foreign:i386 [1] +Remv out-of-sync-gone-native [1] +Inst fine [1] (2 unstable [amd64]) [fine:amd64 on fine:i386] [fine:i386 on fine:amd64] [fine:i386 ] +Inst fine:i386 [1] (2 unstable [i386]) +Conf fine (2 unstable [amd64]) +Conf fine:i386 (2 unstable [i386]) +Inst fine-installed [1] (2 unstable [amd64]) [fine-installed:amd64 on fine-installed:i386] [fine-installed:i386 on fine-installed:amd64] [fine-installed:i386 ] +Inst fine-installed:i386 [1] (2 unstable [i386]) +Conf fine-installed (2 unstable [amd64]) +Conf fine-installed:i386 (2 unstable [i386]) +Inst out-of-sync-gone-foreign [1] (2 unstable [amd64]) +Inst out-of-sync-gone-native:i386 [1] (2 unstable [i386]) +Conf out-of-sync-gone-foreign (2 unstable [amd64]) +Conf out-of-sync-gone-native:i386 (2 unstable [i386])' aptget dist-upgrade -s #-o Debug::pkgDepCache::Marker=1 + +rm rootdir/var/lib/dpkg/status +insertinstalledpackage 'libsame2' 'i386' '1' 'Multi-Arch: same' +insertinstalledpackage 'libsame3' 'i386' '1' 'Multi-Arch: same' + +# the error message isn't great, but better than nothing, right? +testequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + depender2 : Depends: libsame2 (= 2) but it is not going to be installed +E: Unable to correct problems, you have held broken packages.' aptget install depender2 -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + libsame3:i386 libsame3 +The following NEW packages will be installed: + depender3 libsame3 +The following packages will be upgraded: + libsame3:i386 +1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libsame3:i386 [1] (3 unstable [i386]) +Inst libsame3 (3 unstable [amd64]) +Inst depender3 (3 unstable [all]) +Conf libsame3:i386 (3 unstable [i386]) +Conf libsame3 (3 unstable [amd64]) +Conf depender3 (3 unstable [all])' aptget install depender3 -s -- cgit v1.2.3 From 86fdeec2a76f6b134ee8400eb1e53d06fe0974fe Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 16 Jul 2013 23:15:55 +0200 Subject: fix if-clause to generate hook-info for 'rc' packages The code incorrectly skips printing of current version information, if the package has no current version (for APT, but for dpkg as it is the case for packages which are removed but not purged) by using an unintended "else if" rather than an "if". Closes: 717006 --- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index aee44f76b..a89cb7191 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -13,6 +13,13 @@ buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same buildsimplenativepackage 'stuff' 'i386,amd64' '1' 'stable' 'Depends: libsame (= 1), toolkit (= 1)' buildsimplenativepackage 'stuff' 'i386,amd64' '2' 'unstable' 'Depends: libsame (= 2), toolkit (= 2)' +setupsimplenativepackage 'confpkg' 'amd64' '1' 'unstable' +BUILDDIR='incoming/confpkg-1' +echo 'foo "bar";' > ${BUILDDIR}/pkg.conf +echo 'pkg.conf /etc/pkg.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' 'amd64' +rm -rf "$BUILDDIR" + setupaptarchive hook='pre-install-pkgs' @@ -93,3 +100,21 @@ testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE** stuff 2 i386 none > - - none **REMOVE** libsame 2 i386 same > - - none **REMOVE** toolkit 2 amd64 foreign > - - none **REMOVE**' + +observehook install confpkg +testfileequal "${hook}-v2.list" 'confpkg - < 1 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'confpkg - - none < 1 amd64 none **CONFIGURE**' + +observehook remove confpkg +testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' + +msgtest 'Conffiles of package remained after remove' 'confpkg' +dpkg -l confpkg | grep -q '^rc' && msgpass || msgfail + +observehook purge confpkg +testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' + +msgtest 'Conffiles are gone after purge' 'confpkg' +dpkg -l confpkg 2>/dev/null | grep -q '^rc' && msgfail || msgpass -- cgit v1.2.3 From 61843f539513b3e661dac55717e6d7cc0b8f9b0c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 18 Jul 2013 16:52:31 +0200 Subject: skip all Description fields in apt-cache, not just first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given a Packages file like: […] Description: foo bar baz moo moo moo Multi-Arch: foreign Description-md5: 97e204a9f4ad8c681dbd54ec7c505251 […] We have to display the Multi-Arch flag field as well as the fields after the Description-md5, but not this field itself, as we already have one printed alongside the Description we display. Closes: 717254 --- .../test-bug-712435-missing-descriptions | 52 +++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-712435-missing-descriptions b/test/integration/test-bug-712435-missing-descriptions index 9b3c2ee50..c61bea452 100755 --- a/test/integration/test-bug-712435-missing-descriptions +++ b/test/integration/test-bug-712435-missing-descriptions @@ -52,7 +52,32 @@ $PACKAGESTANZA Description-md5: dddddddddddddddddddddddddddddddd Package: apt-none -$PACKAGESTANZA" > aptarchive/Packages +$PACKAGESTANZA + +Package: apt-intermixed +$PACKAGESTANZA +$DESCRIPTION +X-Some-Flag: yes +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +Package: apt-intermixed2 +$PACKAGESTANZA +$DESCRIPTION +X-Some-Flag: yes +$TRANSDESCRIPTION +X-Foo-Flag: Something with a Description +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Bar-Flag: no + +Package: apt-intermixed3 +$PACKAGESTANZA +$DESCRIPTION +X-Some-Flag: yes +$TRANSDESCRIPTION +X-Foo-Flag: Something with a Description +X-Bar-Flag: no +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > aptarchive/Packages + setupaptarchive @@ -87,3 +112,28 @@ Description-md5: dddddddddddddddddddddddddddddddd testequal "Package: apt-none $PACKAGESTANZA " aptcache show apt-none + +testequal "Package: apt-intermixed +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Some-Flag: yes +" aptcache show apt-intermixed + +testequal "Package: apt-intermixed2 +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Some-Flag: yes +X-Foo-Flag: Something with a Description +X-Bar-Flag: no +" aptcache show apt-intermixed2 + +testequal "Package: apt-intermixed3 +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Some-Flag: yes +X-Foo-Flag: Something with a Description +X-Bar-Flag: no +" aptcache show apt-intermixed3 -- cgit v1.2.3 From 922f07986b93ce7866f89917e3a475e6a4b3941c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 18 Jul 2013 19:22:29 +0200 Subject: fix 'apt-cache search' crash with missing description Beside the earlier fixed 'apt-cache show', 'showpkg' and 'search' deal with descriptions. 'showpkg' was fixed by fixing the cache generation for 'show', but 'search' still segfaulted. On the upside, it doesn't segfault any longer, on the downside, if a package has no description at all (aka: not in the Packages file and not in a Translation-* file) the package can't be found with 'search', even if we search only by name. That is a shortcoming in the code, but fixing it means rewriting it completely for dubious gain at best. So this commit just skips packages without a description and is done. Closes: 647590 --- .../test-bug-712435-missing-descriptions | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-bug-712435-missing-descriptions b/test/integration/test-bug-712435-missing-descriptions index c61bea452..53ecbbeb3 100755 --- a/test/integration/test-bug-712435-missing-descriptions +++ b/test/integration/test-bug-712435-missing-descriptions @@ -137,3 +137,29 @@ X-Some-Flag: yes X-Foo-Flag: Something with a Description X-Bar-Flag: no " aptcache show apt-intermixed3 + +msgtest 'Test that no description does not destroy' 'showpkg' +aptcache showpkg apt-none | sed 's#/tmp/.*_aptarchive_#/tmp/aptarchive_#' >showpkg.explosion && msgpass || msgfail +testfileequal showpkg.explosion 'Package: apt-none +Versions: +0.9.7.8 (/tmp/aptarchive_Packages) + + +Reverse Depends: +Dependencies: +0.9.7.8 - +Provides: +0.9.7.8 - +Reverse Provides: ' + +testempty aptcache search nonexistentstring + +# packages without a description can't be found +testequal 'apt-normal - commandline package manager +apt-both-below - commandline package manager +apt-both-middle - commandline package manager +apt-both-top - commandline package manager +apt-trans - commandline package manager +apt-intermixed - commandline package manager +apt-intermixed2 - commandline package manager +apt-intermixed3 - commandline package manager' aptcache search apt -- cgit v1.2.3 From a5b9f4890fc2b367b8f89d10ea2bdb88b8aa071a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 25 Jul 2013 18:51:16 +0200 Subject: pick up Translation-* even if only compressed available On CD-ROMs Translation-* files are only in compressed form included in the Release file. This used to work while we had no record of Translation-* files in the Release file at all as APT would have just guessed the (compressed) filename and accepted it (unchecked), but now that it checks for the presents of entries and if it finds records it expects the uncompressed to be verifiable. This commit relaxes this requirement again to fix the regression. We are still secure "enough" as we can validate the compressed file we have downloaded, so we don't loose anything by not requiring a hashsum for the uncompressed files to double-check them. Closes: 717665 --- .../test-bug-624218-Translation-file-handling | 55 +++++++++++++--------- 1 file changed, 34 insertions(+), 21 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-624218-Translation-file-handling b/test/integration/test-bug-624218-Translation-file-handling index d146b943c..d3c5b08ac 100755 --- a/test/integration/test-bug-624218-Translation-file-handling +++ b/test/integration/test-bug-624218-Translation-file-handling @@ -14,34 +14,47 @@ 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 +translationslisted() { + msgtest 'No download of non-existent locals' "$1" + 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 existent locals' "$1" + 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 in LC_ALL=C' "$1" + 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 en as forced language' "$1" + 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 of nothing else in forced language' "$1" + 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 no Translation- if forced language is non-existent' "$1" + 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' "$1" + aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass + rm -rf rootdir/var/lib/apt/lists +} + +translationslisted 'with full Index' + + +# only compressed files available (as it happens on CD-ROM) +sed -i '/i18n\/Translation-[^.]*$/ d' $(find aptarchive -name 'Release') +signreleasefiles + +translationslisted 'with partial Index' -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 +# no records at all about Translation files (fallback to guessing) sed -i '/i18n\/Translation-.*$/ d' $(find aptarchive -name 'Release') signreleasefiles -- cgit v1.2.3 From f2380a78aa90ff8a3b76607c0c140810aff84086 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Jul 2013 09:22:52 +0200 Subject: request absolute URIs from proxies again (0.9.9.3 regession) Commit 2b9c9b7f28b18f6ae3e422020e8934872b06c9f3 not only removes keep-alive, but also changes the request URI send to proxies which are required to be absolute URIs rather than the usual absolute paths. Closes: 717891 --- .../test-bug-717891-abolute-uris-for-proxies | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 test/integration/test-bug-717891-abolute-uris-for-proxies (limited to 'test/integration') diff --git a/test/integration/test-bug-717891-abolute-uris-for-proxies b/test/integration/test-bug-717891-abolute-uris-for-proxies new file mode 100755 index 000000000..e9c38492e --- /dev/null +++ b/test/integration/test-bug-717891-abolute-uris-for-proxies @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' + +setupaptarchive +changetowebserver --request-absolute='uri' + +msgtest 'Check that absolute paths are' 'not accepted' +aptget update >/dev/null 2>&1 && msgfail || msgpass + +echo 'Acquire::http::Proxy "http://localhost:8080";' > rootdir/etc/apt/apt.conf.d/99proxy + +msgtest 'Check that requests to proxies are' 'absolute uris' +aptget update >/dev/null 2>&1 && msgpass || msgfail + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + unrelated +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst unrelated (0.5~squeeze1 unstable [all]) +Conf unrelated (0.5~squeeze1 unstable [all])' aptget install unrelated -s -- cgit v1.2.3 From 55732492ddea83e7d97b2e0c3e6799948fc5f152 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 1 Aug 2013 12:58:20 +0200 Subject: unset LANGUAGE for showing [Y/n] answer hints nl_langinfo is used to acquire the YESEXPR of the language used, but it will return the one from LC_MESSAGES, which might be different from the language chosen for display of the question (based on LANGUAGE) so this commit removes the [Y/n] help text from the questions itself and moves it to the prompt creation in which the usage of LC_MESSAGES is forced for it, so that the helptext shown actually represents the characters accepted as input for the question. There is still room for problems of course starting with an untranslated "[Y/n]" but a translated YESEXPR or the problem that the question is asked in a completely different language which might have a conflicting definition of [Y/n] input or the user simple ignores the helptext and assumes that an answer matching the question language is accepted, but the mayority of users will never have this problem to begin with, so we should be fine (or at least a bit finer than before). Closes nothing really, but should at least help a bit with bugs like deb:194614, deb:471102, lp:1205578, and countless others. --- test/integration/test-bug-596498-trusted-unsigned-repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 6ebc4a3bb..5c643c40e 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -27,7 +27,7 @@ aptgetupdate testequal "$PKGTEXT WARNING: The following packages cannot be authenticated! cool -Install these packages without verification [y/N]? N +Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete @@ -37,7 +37,7 @@ aptgetupdate testequal "$PKGTEXT WARNING: The following packages cannot be authenticated! cool -Install these packages without verification [y/N]? N +Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE -- cgit v1.2.3 From 096bd9f59750f6bea754d3a05e240c9eea0f6b53 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 1 Aug 2013 13:19:43 +0200 Subject: prefer native arch over higher priority for providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rational from the buglog: > The problem here is that the Priority field in one of the Packages files > is incorrect due to a mishap with reprepro configuration, […] the > amd64 version is Priority: standard but the arm64 version is Priority: > optional (and has a stray "optional: interpreters" field). > […] > However, Priority is a rather weak property of a package because it's > typically applied via overrides, and it's easy for maintainers of > third-party repositories to misconfigure them so that overrides aren't > applied correctly. It shouldn't be ranked ahead of choosing packages > from the native architecture. In this case, I have no user-mode > emulation for arm64 set up, so choosing m4:arm64 simply won't work. This effectly makes the priority the least interesting data point in chosing a provider, which is in line with the other checks we have already order above priority in the past and also has a certain appeal by the soft irony it provides. Closes: #718482 --- ...prefer-native-architecture-over-higher-priority | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/integration/test-prefer-native-architecture-over-higher-priority (limited to 'test/integration') diff --git a/test/integration/test-prefer-native-architecture-over-higher-priority b/test/integration/test-prefer-native-architecture-over-higher-priority new file mode 100755 index 000000000..2e5696376 --- /dev/null +++ b/test/integration/test-prefer-native-architecture-over-higher-priority @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'arm64' + +insertpackage 'unstable' 'm4' 'amd64' '1' 'Multi-Arch: foreign' 'optional' +insertpackage 'unstable' 'm4' 'arm64' '1' 'Multi-Arch: foreign' 'standard' +insertpackage 'unstable' 'autoconf' 'all' '1' 'Depends: m4' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + m4 +The following NEW packages will be installed: + autoconf m4 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst m4 (1 unstable [amd64]) +Inst autoconf (1 unstable [all]) +Conf m4 (1 unstable [amd64]) +Conf autoconf (1 unstable [all])' aptget install autoconf -s -- cgit v1.2.3 From 1680800209dc85387c4c2da9a1edfcde44f87807 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 7 Aug 2013 18:00:07 +0200 Subject: specific pins below 1000 cause downgrades MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We start your quest by using the version of a package applying to a specific pin, but that version could very well be below the current version, which causes APT to suggest a downgrade even if it is advertised that it never does this below 1000. Its of course questionable what use a specific pin on a package has which has a newer version already installed, but reacting with the suggestion of a downgrade is really not appropriated (even if its kinda likely that this is actually the intend the user has – it could just as well be an outdated pin) and as pinning is complicated enough we should atleast do what is described in the manpage. So we look out for the specific pin and if we haven't seen it at the moment we see the installed version, we ignore the specific pin. Closes: 543966 --- .../test-bug-543966-downgrade-below-1000-pin | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 test/integration/test-bug-543966-downgrade-below-1000-pin (limited to 'test/integration') diff --git a/test/integration/test-bug-543966-downgrade-below-1000-pin b/test/integration/test-bug-543966-downgrade-below-1000-pin new file mode 100755 index 000000000..f602bea95 --- /dev/null +++ b/test/integration/test-bug-543966-downgrade-below-1000-pin @@ -0,0 +1,81 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'base-files' 'all' '5.0.0' +insertinstalledpackage 'base-files' 'all' '5.0.0-1' + +setupaptarchive + +STATUS=$(readlink -f rootdir/var/lib/dpkg/status) +APTARCHIVE="$(readlink -f aptarchive)/" + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Version table: + *** 5.0.0-1 0 + 100 $STATUS + 5.0.0 0 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=0 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 99' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 99 + 100 $STATUS + 5.0.0 99 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=99 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 100' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 100 + 100 $STATUS + 5.0.0 100 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=100 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 999' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 999 + 100 $STATUS + 5.0.0 999 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=999 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 1000' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 1000 + 100 $STATUS + 5.0.0 1000 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=1000 -- cgit v1.2.3 From 29a59c460403820d0f039398194e321b7e0921fc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 9 Aug 2013 22:20:27 +0200 Subject: test Release file handling with expired keys Signing files with expired keys is not as easy as it sounds, so the framework jumps a few loops to do it, but it might come in handy to have an expired key around for later tests even if it is not that different from having no key in regards to APT behaviour. Git-Dch: Ignore --- test/integration/framework | 35 ++++++++++++++++++++----- test/integration/rexexpired.pub | Bin 0 -> 1200 bytes test/integration/rexexpired.sec | Bin 0 -> 2502 bytes test/integration/test-releasefile-verification | 35 +++++++++++++++++++++++-- 4 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 test/integration/rexexpired.pub create mode 100644 test/integration/rexexpired.sec (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 7dd7c20a7..f64b8482c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -711,22 +711,45 @@ setupaptarchive() { signreleasefiles() { local SIGNER="${1:-Joe Sixpack}" + local GPG="gpg --batch --yes --no-default-keyring --trustdb-name rootdir/etc/apt/trustdb.gpg" msgninfo "\tSign archive with $SIGNER key… " - local SECKEYS="" + local REXKEY='keys/rexexpired' + local SECEXPIREBAK="${REXKEY}.sec.bak" + local PUBEXPIREBAK="${REXKEY}.pub.bak" + if [ "${SIGNER}" = 'Rex Expired' ]; then + # the key is expired, so gpg doesn't allow to sign with and the --faked-system-time + # option doesn't exist anymore (and using faketime would add a new obscure dependency) + # therefore we 'temporary' make the key not expired and restore a backup after signing + cp ${REXKEY}.sec $SECEXPIREBAK + cp ${REXKEY}.pub $PUBEXPIREBAK + local SECUNEXPIRED="${REXKEY}.sec.unexpired" + local PUBUNEXPIRED="${REXKEY}.pub.unexpired" + if [ -f "$SECUNEXPIRED" ] && [ -f "$PUBUNEXPIRED" ]; then + cp $SECUNEXPIRED ${REXKEY}.sec + cp $PUBUNEXPIRED ${REXKEY}.pub + else + printf "expire\n1w\nsave\n" | $GPG --keyring ${REXKEY}.pub --secret-keyring ${REXKEY}.sec --command-fd 0 --edit-key "${SIGNER}" >/dev/null 2>&1 || true + cp ${REXKEY}.sec $SECUNEXPIRED + cp ${REXKEY}.pub $PUBUNEXPIRED + fi + fi for KEY in $(find keys/ -name '*.sec'); do - SECKEYS="$SECKEYS --secret-keyring $KEY" + GPG="$GPG --secret-keyring $KEY" done - local PUBKEYS="" for KEY in $(find keys/ -name '*.pub'); do - PUBKEYS="$PUBKEYS --keyring $KEY" + GPG="$GPG --keyring $KEY" done for RELEASE in $(find aptarchive/ -name Release); do - gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" -abs -o ${RELEASE}.gpg ${RELEASE} + $GPG --default-key "$SIGNER" --armor --detach-sign --sign --output ${RELEASE}.gpg ${RELEASE} local INRELEASE="$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')" - gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" --clearsign -o $INRELEASE $RELEASE + $GPG --default-key "$SIGNER" --clearsign --output $INRELEASE $RELEASE # we might have set a specific date for the Release file, so copy it touch -d "$(stat --format "%y" ${RELEASE})" ${RELEASE}.gpg ${INRELEASE} done + if [ -f "$SECEXPIREBAK" ] && [ -f "$PUBEXPIREBAK" ]; then + mv -f $SECEXPIREBAK ${REXKEY}.sec + mv -f $PUBEXPIREBAK ${REXKEY}.pub + fi msgdone "info" } diff --git a/test/integration/rexexpired.pub b/test/integration/rexexpired.pub new file mode 100644 index 000000000..5ab2e489a Binary files /dev/null and b/test/integration/rexexpired.pub differ diff --git a/test/integration/rexexpired.sec b/test/integration/rexexpired.sec new file mode 100644 index 000000000..dc00168cd Binary files /dev/null and b/test/integration/rexexpired.sec differ diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index e56f458d3..daba3919b 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -107,13 +107,24 @@ runtest() { " aptcache show apt installaptnew + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + cp keys/rexexpired.pub rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg + signreleasefiles 'Rex Expired' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Cold archive signed by' 'Rex Expired' + aptget update 2>&1 | grep -E '^W: .* KEYEXPIRED' > /dev/null && msgpass || msgfail + testequal "$(cat ${PKGFILE}) +" aptcache show apt + failaptold + rm rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg prepare ${PKGFILE} rm -rf rootdir/var/lib/apt/lists signreleasefiles 'Marvin Paranoid' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Cold archive signed by' 'Marvin Paranoid' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail + aptget update 2>&1 | grep -E '^W: .* NO_PUBKEY' > /dev/null && msgpass || msgfail testequal "$(cat ${PKGFILE}) " aptcache show apt failaptold @@ -147,10 +158,30 @@ runtest() { signreleasefiles 'Marvin Paranoid' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Good warm archive signed by' 'Marvin Paranoid' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail + aptget update 2>&1 | grep -E '^W: .* NO_PUBKEY' > /dev/null && msgpass || msgfail + testequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold + + prepare ${PKGFILE}-new + cp keys/rexexpired.pub rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg + signreleasefiles 'Rex Expired' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Good warm archive signed by' 'Rex Expired' + aptget update 2>&1 | grep -E '^W: .* KEYEXPIRED' > /dev/null && msgpass || msgfail testequal "$(cat ${PKGFILE}) " aptcache show apt installaptold + rm rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg + + prepare ${PKGFILE}-new + signreleasefiles + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Good warm archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}-new) +" aptcache show apt + installaptnew } runtest2() { -- cgit v1.2.3 From 0440d936d70b1e331d49bbc32735f1b749632604 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Aug 2013 10:01:06 +0200 Subject: add chronic-like testsuccess/testfailure helpers For many commands the output isn't stable (like then dpkg is called) but the exitcode is, so this helper enhances the common && msgpass || msgfail by generating automatically a msgtest and showing the output of the command in case of failure instead of discarding it unconditionally, the later being chronic-like behaviour Git-Dch: Ignore --- test/integration/framework | 34 ++++++++++++++++++++++ test/integration/test-apt-cdrom | 2 +- test/integration/test-apt-get-autoremove | 10 +++---- .../test-bug-407511-fail-invalid-default-release | 4 +-- test/integration/test-bug-602412-dequote-redirect | 4 +-- .../integration/test-bug-604222-new-and-autoremove | 2 +- .../test-bug-604401-files-are-directories | 10 +++---- test/integration/test-bug-611729-mark-as-manual | 20 ++++++------- .../test-bug-612099-multiarch-conflicts | 12 ++++---- test/integration/test-bug-612557-garbage-upgrade | 4 +-- .../test-bug-612958-use-dpkg-multiarch-config | 4 +-- .../test-bug-613420-new-garbage-dependency | 2 +- ...test-bug-64141-install-dependencies-for-on-hold | 2 +- .../test-bug-673536-pre-depends-breaks-loop | 4 +-- .../test-bug-679371-apt-get-autoclean-multiarch | 4 +-- .../test-bug-686346-package-missing-architecture | 4 +-- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 2 +- .../test-bug-717891-abolute-uris-for-proxies | 4 +-- test/integration/test-compressed-indexes | 34 +++++++++++----------- .../test-cve-2013-1051-InRelease-parsing | 2 +- test/integration/test-disappearing-packages | 2 +- test/integration/test-pdiff-usage | 4 +-- test/integration/test-policy-pinning | 8 ++--- test/integration/test-releasefile-valid-until | 32 ++++++++++---------- .../test-ubuntu-bug-761175-remove-purge | 6 ++-- ...st-ubuntu-bug-784473-InRelease-one-message-only | 2 +- 26 files changed, 125 insertions(+), 93 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index f64b8482c..e363977f5 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -928,6 +928,40 @@ testmarkedauto() { aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail } +testsuccess() { + if [ "$1" = '--nomsg' ]; then + shift + else + msgtest 'Test for successful execution of' "$*" + fi + local OUTPUT=$(mktemp) + addtrap "rm $OUTPUT;" + if $@ >${OUTPUT} 2>&1; then + msgpass + else + echo + cat $OUTPUT + msgfail + fi +} + +testfailure() { + if [ "$1" = '--nomsg' ]; then + shift + else + msgtest 'Test for failure in execution of' "$*" + fi + local OUTPUT=$(mktemp) + addtrap "rm $OUTPUT;" + if $@ >${OUTPUT} 2>&1; then + echo + cat $OUTPUT + msgfail + else + msgpass + fi +} + pause() { echo "STOPPED execution. Press enter to continue" local IGNORE diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 6e3533152..85c3a2fee 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -102,5 +102,5 @@ aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && # check that we really can install from a 'cdrom' testdpkgnotinstalled testing -aptget install testing -y > /dev/null 2>&1 +testsuccess aptget install testing -y testdpkginstalled testing diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index c25ce3f58..dc30cde34 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -11,11 +11,11 @@ buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable' buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf' setupaptarchive -aptget install unrelated debhelper -qq 2>&1 > /dev/null +testsuccess aptget install unrelated debhelper -y testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' testmarkedauto 'po-debconf' -aptget remove debhelper -y -qq 2>&1 > /dev/null +testsuccess aptget remove debhelper -y testdpkgnotinstalled 'debhelper' testdpkginstalled 'po-debconf' 'unrelated' @@ -30,15 +30,15 @@ Remv po-debconf [1.0.16]' aptget autoremove -s testdpkginstalled 'po-debconf' echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove -aptget autoremove -y -qq 2>&1 > /dev/null +testsuccess aptget autoremove -y testdpkginstalled 'po-debconf' echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove -aptget autoremove -y -qq 2>&1 > /dev/null +testsuccess aptget autoremove -y testdpkginstalled "po-debconf" rm rootdir/etc/apt/apt.conf.d/00autoremove -aptget autoremove -y -qq 2>&1 > /dev/null +testsuccess aptget autoremove -y testdpkgnotinstalled 'po-debconf' testmarkedauto diff --git a/test/integration/test-bug-407511-fail-invalid-default-release b/test/integration/test-bug-407511-fail-invalid-default-release index 7f23a1e82..3d3b0ada3 100755 --- a/test/integration/test-bug-407511-fail-invalid-default-release +++ b/test/integration/test-bug-407511-fail-invalid-default-release @@ -35,14 +35,14 @@ setupaptarchive passdist() { msgtest 'Test that target-release is accepted' $1 - aptget dist-upgrade -t $1 -qq && msgpass || msgfail + testsuccess --nomsg aptget dist-upgrade -t $1 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 - aptget dist-upgrade -t $1 -qq 2> /dev/null && msgfail || msgpass + testfailure --nomsg aptget dist-upgrade -t $1 } msgtest 'Test that no default-release is active in this test' 'setup' diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect index c20443559..764e13667 100755 --- a/test/integration/test-bug-602412-dequote-redirect +++ b/test/integration/test-bug-602412-dequote-redirect @@ -16,7 +16,7 @@ mv aptarchive/pool aptarchive/newpool mv aptarchive/dists aptarchive/newdists msgtest 'Test redirection works in' 'apt-get update' -aptget update -qq && msgpass || msgfail +testsuccess --nomsg aptget update # check that I-M-S header is kept in redirections testequal 'Hit http://localhost:8080 unstable InRelease @@ -26,4 +26,4 @@ Hit http://localhost:8080 unstable/main Translation-en Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1 msgtest 'Test redirection works in' 'package download' -aptget install unrelated --download-only -qq && msgpass || msgfail +testsuccess --nomsg aptget install unrelated --download-only diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index ea73c5775..b29347f64 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -8,7 +8,7 @@ configarchitecture "i386" setupaptarchive touch rootdir/var/lib/apt/extended_states -aptmark markauto 'libvtk5.4' +testsuccess aptmark markauto 'libvtk5.4' testmarkedauto 'libvtk5.4' testequal "Reading package lists... diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories index aae717a19..e6913edcf 100755 --- a/test/integration/test-bug-604401-files-are-directories +++ b/test/integration/test-bug-604401-files-are-directories @@ -11,7 +11,7 @@ test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/ap msgtest "Directory instead of a file as apt.conf ignored" mkdir -p rootdir/etc/apt/apt.conf -aptconfig dump > /dev/null && msgpass || msgfail +testsuccess --nomsg aptconfig dump rmdir rootdir/etc/apt/apt.conf msgtest "Good link instead of a file as apt.conf ignored" @@ -22,7 +22,7 @@ rm rootdir/etc/apt/apt.conf msgtest "Broken link instead of a file as apt.conf ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf -aptconfig dump > /dev/null && msgpass || msgfail +testsuccess --nomsg aptconfig dump rm rootdir/etc/apt/apt.conf @@ -30,7 +30,7 @@ test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdi msgtest "Directory instead of a file as sources.list ignored" mkdir -p rootdir/etc/apt/sources.list -aptget update --print-uris 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptget update --print-uris rmdir rootdir/etc/apt/sources.list msgtest "Good link instead of a file as sources.list ignored" @@ -49,7 +49,7 @@ test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/ msgtest "Directory instead of a file as preferences ignored" mkdir -p rootdir/etc/apt/preferences -aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptcache policy rmdir rootdir/etc/apt/preferences msgtest "Good link instead of a file as preferences ignored" @@ -62,5 +62,5 @@ rm rootdir/etc/apt/preferences msgtest "Broken link instead of a file as preferences ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences -aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptcache policy rm rootdir/etc/apt/preferences diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual index 9cf01610c..e3d454f97 100755 --- a/test/integration/test-bug-611729-mark-as-manual +++ b/test/integration/test-bug-611729-mark-as-manual @@ -15,21 +15,21 @@ buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b" setupaptarchive # dpkg freaks out if the last package is removed so keep one around -aptget install peace-dpkg -y -qq 2>&1 > /dev/null +testsuccess aptget install peace-dpkg -y testdpkginstalled peace-dpkg testmarkedauto -aptget install a -y -qq 2>&1 > /dev/null +testsuccess aptget install a -y testdpkginstalled a b testdpkgnotinstalled c testmarkedauto 'b' -aptget remove a -y -qq 2>&1 > /dev/null +testsuccess aptget remove a -y testdpkgnotinstalled a c testdpkginstalled b testmarkedauto 'b' -aptget install c -y -qq 2>&1 > /dev/null +testsuccess aptget install c -y testdpkgnotinstalled a testdpkginstalled b c testmarkedauto 'b' @@ -50,7 +50,7 @@ testmarkedauto 'b' rm rootdir/var/log/apt/history.log -aptget install b --reinstall -y -qq 2>&1 > /dev/null +testsuccess aptget install b --reinstall -y testdpkgnotinstalled a testdpkginstalled b c testmarkedauto 'b' @@ -67,24 +67,24 @@ b set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b testmarkedauto -aptget remove b -y -qq 2>&1 > /dev/null +testsuccess aptget remove b -y testdpkgnotinstalled a b c testmarkedauto -aptget install a b -y -qq 2>&1 > /dev/null +testsuccess aptget install a b -y testdpkginstalled a b testdpkgnotinstalled c testmarkedauto -aptget purge a b -y -qq 2>&1 > /dev/null +testsuccess aptget purge a b -y testdpkgnotinstalled a b c testmarkedauto -aptget install b c -y -qq 2>&1 > /dev/null +testsuccess aptget install b c -y testdpkgnotinstalled a testdpkginstalled b c testmarkedauto -aptget install a -y -qq 2>&1 > /dev/null +testsuccess aptget install a -y testdpkginstalled a b c testmarkedauto diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index 530012e5d..b91804826 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -15,7 +15,7 @@ buildsimplenativepackage 'foobar' 'amd64' '1.0' 'stable' 'Depends: libc6' setupaptarchive -aptget install libc6:i386 -t stable -y -qq 2>&1 > /dev/null +testsuccess aptget install libc6:i386 -t stable -y testdpkginstalled libc6:i386 testequal 'Reading package lists... Building dependency tree... @@ -79,8 +79,8 @@ Conf libc6 (2.0 testing [all])' aptget upgrade -t testing -s # as APT (here i386) disagree about the native architecture, so # we fake it here: #aptget upgrade -y -qq 2>&1 > /dev/null -aptget purge libc6 -y -qq 2>&1 >/dev/null -aptget install libc6:i386 -y -qq 2>&1 >/dev/null +testsuccess aptget purge libc6 -y +testsuccess aptget install libc6:i386 -y testdpkginstalled libc6:all testequal 'Reading package lists... @@ -129,7 +129,7 @@ buildsimplenativepackage 'foobar-same' 'amd64' '1.0' 'stable' 'Depends: libc6-sa setupaptarchive -aptget install libc6-same:i386 -t stable -y -qq 2>&1 > /dev/null +testsuccess aptget install libc6-same:i386 -t stable -y testdpkginstalled libc6-same:i386 testequal 'Reading package lists... @@ -177,8 +177,8 @@ Conf libc6-same (2.0 testing [all])' aptget upgrade -t testing -s # as APT (here i386) disagree about the native architecture, so # we fake it here: #aptget upgrade -y -qq 2>&1 > /dev/null -aptget purge libc6-same -y -qq 2>&1 >/dev/null -aptget install libc6-same:i386 -y -qq 2>&1 >/dev/null +testsuccess aptget purge libc6-same -y +testsuccess aptget install libc6-same:i386 -y testdpkginstalled libc6-same:all diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index 8efd1687a..910b3b149 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -13,7 +13,7 @@ insertpackage 'unstable' 'libreoffice-common' 'all' '1:3.3.0-2' 'Conflicts: open setupaptarchive touch rootdir/var/lib/apt/extended_states -aptmark markauto python-uno openoffice.org-common +testsuccess aptmark markauto python-uno openoffice.org-common #aptmark unmarkauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common @@ -32,7 +32,7 @@ The following packages will be upgraded: After this operation, 53.2 MB disk space will be freed. E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno -aptmark markauto openoffice.org-emailmerge +testsuccess aptmark markauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge testequal 'Reading package lists... diff --git a/test/integration/test-bug-612958-use-dpkg-multiarch-config b/test/integration/test-bug-612958-use-dpkg-multiarch-config index 18b964636..4d1f00ca0 100755 --- a/test/integration/test-bug-612958-use-dpkg-multiarch-config +++ b/test/integration/test-bug-612958-use-dpkg-multiarch-config @@ -14,13 +14,13 @@ insertinstalledpackage 'libapt' 'armel' '1.0' testpass() { rm rootdir/var/cache/apt/*.bin msgtest 'Test architecture handling' "$1 with $2" - aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail + testsuccess --nomsg aptcache show libapt:$2 } testfail() { rm rootdir/var/cache/apt/*.bin msgtest 'Test architecture handling' "$1 with $2" - aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass + testfailure --nomsg aptcache show libapt:$2 } testpass 'no config' 'i386' diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 7a08871ca..9d9f1096a 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -15,7 +15,7 @@ insertpackage 'unstable' 'openoffice.org-officebean' 'all' '1:3.3.0-5' 'Depends: setupaptarchive touch rootdir/var/lib/apt/extended_states -aptmark markauto openoffice.org-officebean +testsuccess aptmark markauto openoffice.org-officebean testmarkedauto openoffice.org-officebean testequal "Reading package lists... diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold index e2d206fdd..9a9e7be10 100755 --- a/test/integration/test-bug-64141-install-dependencies-for-on-hold +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -31,7 +31,7 @@ The following packages will be upgraded: After this operation, 0 B of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only -aptmark hold apt -qq +testsuccess aptmark hold apt testequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-bug-673536-pre-depends-breaks-loop b/test/integration/test-bug-673536-pre-depends-breaks-loop index e9d3c4de6..f6a90b21f 100755 --- a/test/integration/test-bug-673536-pre-depends-breaks-loop +++ b/test/integration/test-bug-673536-pre-depends-breaks-loop @@ -15,9 +15,9 @@ setupaptarchive # we check with 'real' packages here as the simulation reports a 'Conf broken' # which is technical correct for the simulation, but testing errormsg is ugly -aptget install basic=1 -qq > /dev/null +testsuccess aptget install basic=1 -y testdpkginstalled basic testdpkgnotinstalled common -aptget dist-upgrade -qq > /dev/null +testsuccess aptget dist-upgrade -y testdpkginstalled basic common diff --git a/test/integration/test-bug-679371-apt-get-autoclean-multiarch b/test/integration/test-bug-679371-apt-get-autoclean-multiarch index ba6857b73..b62d437aa 100755 --- a/test/integration/test-bug-679371-apt-get-autoclean-multiarch +++ b/test/integration/test-bug-679371-apt-get-autoclean-multiarch @@ -14,8 +14,8 @@ setupaptarchive changetowebserver -aptget update -qq -aptget install pkgall pkgnative pkgforeign -y -qq > /dev/null +testsuccess aptget update +testsuccess aptget install pkgall pkgnative pkgforeign -y testdpkginstalled pkgall pkgnative pkgforeign diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index b2c9ec9ee..3b02811ca 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -58,13 +58,13 @@ Building dependency tree... # pkgd has no update with an architecture testdpkginstalled pkgd msgtest 'Test apt-get purge' 'pkgd' -aptget purge pkgd -y >/dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget purge pkgd -y testdpkgnotinstalled pkgd # there is a pkgb with an architecture testdpkginstalled pkgb msgtest 'Test apt-get purge' 'pkgb:none' -aptget purge pkgb:none -y >/dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget purge pkgb:none -y testdpkgnotinstalled pkgb # check that dependencies are created after the none package exists in the cache diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index a89cb7191..af65397ea 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -42,7 +42,7 @@ enablehookversion 3 observehook() { rm -f ${hook}-v2.list ${hook}-v3.list msgtest 'Observe hooks while' "$*" - aptget "$@" -y --force-yes >/dev/null 2>&1 && msgpass || msgfail + testsuccess --nomsg aptget "$@" -y --force-yes } observehook install stuff -t stable diff --git a/test/integration/test-bug-717891-abolute-uris-for-proxies b/test/integration/test-bug-717891-abolute-uris-for-proxies index e9c38492e..ac1d6ec11 100755 --- a/test/integration/test-bug-717891-abolute-uris-for-proxies +++ b/test/integration/test-bug-717891-abolute-uris-for-proxies @@ -12,12 +12,12 @@ setupaptarchive changetowebserver --request-absolute='uri' msgtest 'Check that absolute paths are' 'not accepted' -aptget update >/dev/null 2>&1 && msgfail || msgpass +testfailure --nomsg aptget update echo 'Acquire::http::Proxy "http://localhost:8080";' > rootdir/etc/apt/apt.conf.d/99proxy msgtest 'Check that requests to proxies are' 'absolute uris' -aptget update >/dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget update testequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index a5e885745..c6f5ab49e 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -46,10 +46,10 @@ testrun() { msgpass fi msgtest "Check if package is downloadable" - aptget install -d testpkg -qq && msgpass || msgfail - msgtest "\tdeb file is present"; test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail + testsuccess --nomsg aptget install -d testpkg + msgtest "\tdeb file is present"; testsuccess --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb aptget clean - msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail + msgtest "\tdeb file is gone"; testfailure --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb fi rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin testequal "$GOODSHOW" aptcache show testpkg @@ -62,9 +62,9 @@ testrun() { testequal "$GOODSHOWSRC" aptcache showsrc testpkg 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 - msgtest "\tdirectory is present"; test -d testpkg-1.0 && msgpass || msgfail + testsuccess --nomsg aptget source testpkg + msgtest "\tdsc file is present"; testsuccess --nomsg test -f testpkg_1.0.dsc + msgtest "\tdirectory is present"; testsuccess --nomsg test -d testpkg-1.0 rm -rf testpkg-1.0 } @@ -72,11 +72,11 @@ echo 'Acquire::GzipIndexes "false";' > rootdir/etc/apt/apt.conf.d/02compressinde msgmsg "File: Test with uncompressed indexes" testrun -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "File: Test with uncompressed indexes (update unchanged with pdiffs)" testrun -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "File: Test with uncompressed indexes (update unchanged without pdiffs)" testrun @@ -84,21 +84,21 @@ rm -rf rootdir/var/lib/apt/lists echo 'Acquire::CompressionTypes::Order:: "gz"; Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex -aptget update -qq +testsuccess aptget update msgmsg "File: Test with compressed indexes" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "File: Test with compressed indexes (update unchanged with pdiffs)" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "File: Test with compressed indexes (update unchanged without pdiffs)" testrun "compressed" rm rootdir/etc/apt/apt.conf.d/02compressindex changetowebserver -aptget update -qq +testsuccess aptget update 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 @@ -106,11 +106,11 @@ testequal "$GOODPOLICY" aptcache policy testpkg msgmsg "HTTP: Test with uncompressed indexes" testrun -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "HTTP: Test with uncompressed indexes (update unchanged with pdiffs)" testrun -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "HTTP: Test with uncompressed indexes (update unchanged without pdiffs)" testrun @@ -118,14 +118,14 @@ rm -rf rootdir/var/lib/apt/lists echo 'Acquire::CompressionTypes::Order:: "gz"; Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex -aptget update -qq +testsuccess aptget update msgmsg "HTTP: Test with compressed indexes" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "HTTP: Test with compressed indexes (update unchanged with pdiffs)" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "HTTP: Test with compressed indexes (update unchanged without pdiffs)" testrun "compressed" diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index 6764fefff..41b27f691 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -14,7 +14,7 @@ setupaptarchive changetowebserver ARCHIVE='http://localhost:8080/' msgtest 'Initial apt-get update should work with' 'InRelease' -aptget update -qq && msgpass || msgfail +testsuccess --nomsg aptget update # check that the setup is correct testequal "good-pkg: diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index d2ac4edc6..09dbf7014 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -29,7 +29,7 @@ rm -rf "$BUILDDIR" setupaptarchive -aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null +testsuccess aptget install old-pkg=1.0 --trivial-only testmarkedauto # old-pkg is manual installed diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index e45326970..994489ee5 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -11,7 +11,7 @@ buildaptarchive setupflataptarchive changetowebserver signreleasefiles -aptget update -qq +testsuccess aptget update testnopackage newstuff PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')" @@ -38,7 +38,7 @@ SHA1-Patches: generatereleasefiles '+1hour' signreleasefiles find aptarchive -name 'Packages*' -type f -delete -aptget update -qq +testsuccess aptget update testnopackage oldstuff testequal "$(cat ${PKGFILE}-new) diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 9e1ea4ac5..8eb4bcbad 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -228,16 +228,16 @@ testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=ButAutomat testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t stable rm rootdir/etc/apt/preferences -aptget install coolstuff -qq > /dev/null 2> /dev/null +testsuccess aptget install coolstuff -y testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades -aptget dist-upgrade -qq > /dev/null 2> /dev/null +testsuccess aptget dist-upgrade -y testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports -aptget install coolstuff -t backports -qq > /dev/null 2> /dev/null +testsuccess aptget install coolstuff -t backports -y testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades -aptget dist-upgrade -qq > /dev/null 2> /dev/null +testsuccess aptget dist-upgrade -y testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index 680a370cb..e673d5f71 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -32,64 +32,64 @@ aptgetupdate() { setupreleasefile msgtest 'Release file is accepted as it has' 'no Until' -aptgetupdate && msgpass || msgfail +testsuccess --nomsg aptgetupdate setupreleasefile msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid' -aptgetupdate -o Acquire::Max-ValidTime=3600 && msgpass || msgfail +testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600 setupreleasefile 'now - 3 days' 'now + 1 day' msgtest 'Release file is accepted as it has' 'good Until' -aptgetupdate && msgpass || msgfail +testsuccess --nomsg aptgetupdate setupreleasefile 'now - 7 days' 'now - 4 days' msgtest 'Release file is rejected as it has' 'bad Until' -aptgetupdate && msgfail || msgpass +testfailure --nomsg aptgetupdate 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 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 +testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 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 +testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 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 +testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 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 +testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 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 +testfailure --nomsg aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 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 +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge index f55c6e909..14648e9b8 100755 --- a/test/integration/test-ubuntu-bug-761175-remove-purge +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -18,12 +18,10 @@ setupaptarchive testdpkgnotinstalled compiz-core -msgtest 'Install package' 'compiz-core' -aptget install compiz-core -qq 2>&1 >/dev/null && msgpass || msgfail +testsuccess aptget install compiz-core testdpkginstalled compiz-core -msgtest 'Remove package' 'compiz-core' -aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail +testsuccess aptget remove compiz-core -y testdpkgnotinstalled compiz-core msgtest 'Check that conffiles are still around for' 'compiz-core' diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only index fad5488fb..e9d684309 100755 --- a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only +++ b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only @@ -28,7 +28,7 @@ MD5Sum: done msgtest 'The unsigned garbage before signed block is' 'ignored' -aptget update -qq > /dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget update ROOTDIR="$(readlink -f .)" testequal "Package files: -- cgit v1.2.3 From ffcccd62f0d5822a71e24baf84126af5c93a5e69 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Aug 2013 12:40:37 +0200 Subject: fix: --print-uris removes authentication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The constructors of our (clear)sign-acquire-items move a pre-existent file for error-recovery away, which gets restored or discarded later as the acquire progresses, but --print-uris never really starts the acquire process, so the files aren't restored (as they should). To fix this both get a destructor which checks for signs of acquire doing anything and if it hasn't the file is restored. Note that these virtual destructors theoretically break the API, but only with classes extending the sign-acquire-items and nobody does this, as it would be insane for library users to fiddle with Acquire internals – and these classes are internals. Closes: 719263 --- test/integration/test-bug-602412-dequote-redirect | 2 +- ...st-bug-719263-print-uris-removes-authentication | 41 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 test/integration/test-bug-719263-print-uris-removes-authentication (limited to 'test/integration') diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect index 764e13667..bcebb57b8 100755 --- a/test/integration/test-bug-602412-dequote-redirect +++ b/test/integration/test-bug-602412-dequote-redirect @@ -26,4 +26,4 @@ Hit http://localhost:8080 unstable/main Translation-en Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1 msgtest 'Test redirection works in' 'package download' -testsuccess --nomsg aptget install unrelated --download-only +testsuccess --nomsg aptget install unrelated --download-only -y diff --git a/test/integration/test-bug-719263-print-uris-removes-authentication b/test/integration/test-bug-719263-print-uris-removes-authentication new file mode 100755 index 000000000..1c1a27ceb --- /dev/null +++ b/test/integration/test-bug-719263-print-uris-removes-authentication @@ -0,0 +1,41 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'unrelated' 'all' '1' +buildsimplenativepackage 'unrelated' 'all' '2' 'unstable' + +setupaptarchive + +testnoact() { + cp -a rootdir/var/lib/dpkg/status rootdir/var/lib/dpkg/status-backup-noact + touch rootdir/var/lib/apt/extended_states + testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be upgraded: + unrelated +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst unrelated [1] (2 unstable [all]) +Conf unrelated (2 unstable [all])' aptget install unrelated -s + testsuccess aptget install unrelated -y + testdpkginstalled unrelated + cp -a rootdir/var/lib/dpkg/status-backup-noact rootdir/var/lib/dpkg/status +} + +testnoact +testsuccess aptget update --print-uris +testnoact + +# same thing, just not with InRelease this time +rm -rf rootdir/var/lib/apt/lists +testsuccess aptget update -o Acquire::TryInRelease=0 + +testnoact +testsuccess aptget update --print-uris -o Acquire::TryInRelease=0 +testnoact -- cgit v1.2.3 From 7a2690a3bf59244fff417ab494f68fd9301b74d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Jul 2013 22:57:44 +0200 Subject: fix output redirection order First redirect output to a file, then redirect other outputs to this output, not the other way around as this will not work. Git-Dch: Ignore --- test/integration/framework | 6 +++--- test/integration/skip-avoid-avoiding-breaks-predepends | 2 +- test/integration/test-bug-612099-multiarch-conflicts | 4 ++-- test/integration/test-bug-618288-multiarch-same-lockstep | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index e363977f5..005e31bd3 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -177,7 +177,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 - if ! $(which dpkg) --assert-multi-arch 2>&1 > /dev/null; then + if ! $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it… fi echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf @@ -225,7 +225,7 @@ configdpkg() { echo -n > rootdir/var/lib/dpkg/status fi fi - if $(which dpkg) --assert-multi-arch 2>&1 > /dev/null; then + if $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then local ARCHS="$(getarchitectures)" if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then DPKGARCH="$(dpkg --print-architecture)" @@ -851,7 +851,7 @@ testequalor2() { echo "$2" > $COMPAREFILE2 shift 2 msgtest "Test for equality OR of" "$*" - $* 2>&1 1> $COMPAREAGAINST + $* >$COMPAREAGAINST 2>&1 (checkdiff $COMPAREFILE1 $COMPAREAGAINST 1> /dev/null || checkdiff $COMPAREFILE2 $COMPAREAGAINST 1> /dev/null) && msgpass || ( echo "\n${CINFO}Diff against OR 1${CNORMAL}" "$(checkdiff $COMPAREFILE1 $COMPAREAGAINST)" \ diff --git a/test/integration/skip-avoid-avoiding-breaks-predepends b/test/integration/skip-avoid-avoiding-breaks-predepends index a47e8bc2b..ed231bc3f 100755 --- a/test/integration/skip-avoid-avoiding-breaks-predepends +++ b/test/integration/skip-avoid-avoiding-breaks-predepends @@ -17,5 +17,5 @@ Pre-Depends: looping (>= 1.15)' setupaptarchive -aptget dist-upgrade -y -o Debug::pkgOrderList=1 #-qq 2>&1 > /dev/null +aptget dist-upgrade -y -o Debug::pkgOrderList=1 #-qq >/dev/null 2>&1 testdpkginstalled looping loop1 loop2 diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index b91804826..20dc3a7e5 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -78,7 +78,7 @@ Conf libc6 (2.0 testing [all])' aptget upgrade -t testing -s # FIXME: on amd64 systems this test wouldn't run with a real upgrade # as APT (here i386) disagree about the native architecture, so # we fake it here: -#aptget upgrade -y -qq 2>&1 > /dev/null +#aptget upgrade -y -qq >/dev/null 2>&1 testsuccess aptget purge libc6 -y testsuccess aptget install libc6:i386 -y testdpkginstalled libc6:all @@ -176,7 +176,7 @@ Conf libc6-same (2.0 testing [all])' aptget upgrade -t testing -s # FIXME: on amd64 systems this test wouldn't run with a real upgrade # as APT (here i386) disagree about the native architecture, so # we fake it here: -#aptget upgrade -y -qq 2>&1 > /dev/null +#aptget upgrade -y -qq >/dev/null 2>&1 testsuccess aptget purge libc6-same -y testsuccess aptget install libc6-same:i386 -y testdpkginstalled libc6-same:all diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep index fde075172..e0305b64b 100755 --- a/test/integration/test-bug-618288-multiarch-same-lockstep +++ b/test/integration/test-bug-618288-multiarch-same-lockstep @@ -16,7 +16,7 @@ buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' '' buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required' setupaptarchive -aptget dist-upgrade -s 2>&1 > output.apt +aptget dist-upgrade -s >output.apt 2>&1 # order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together LS_U_AMD="$(grep -o -n '^Inst libsame ' output.apt | cut -d: -f1)" -- cgit v1.2.3 From 80f3aeb04d043356bd98de7714fc164b3fff3861 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Aug 2013 00:36:52 +0200 Subject: make the keyring locations in apt-key configurable Might come in handy for more than just a simple testcase. --- test/integration/test-apt-key | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 test/integration/test-apt-key (limited to 'test/integration') diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key new file mode 100755 index 000000000..5beb6f220 --- /dev/null +++ b/test/integration/test-apt-key @@ -0,0 +1,39 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +msgtest 'Check that paths in list output are not' 'double-slashed' +aptkey list 2>&1 | grep -q '//' && msgfail || msgpass + +msgtest 'Check that paths in finger output are not' 'double-slashed' +aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass + +echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub"; +APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir/etc/apt/apt.conf.d/aptkey.conf + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +testequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) " not changed +gpg: Total number processed: 1 +gpg: unchanged: 1' aptkey --fakeroot update + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +testsuccess aptkey --fakeroot add ./keys/rexexpired.pub + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13] +pub 2048R/DBAC8DAE 2010-08-18' + +msgtest 'Execute update again to trigger removal of' 'Rex Expired key' +testsuccess --nomsg aptkey --fakeroot update + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' -- cgit v1.2.3 From 804d4a0d92a2e107aad38198ac08f1d2d64b5e53 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Aug 2013 15:51:42 +0200 Subject: ensure that testcases exiting because of set -e aren't successful Git-Dch: Ignore --- test/integration/framework | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 005e31bd3..72c899e32 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -131,13 +131,23 @@ exitwithstatus() { exit $((EXIT_CODE <= 255 ? EXIT_CODE : 255)); } +shellsetedetector() { + local exit_status=$? + if [ "$exit_status" != '0' ]; then + echo >&2 "${CERROR}E: Looks like the testcases ended prematurely with exitcode: ${exit_status}${CNORMAL}" + if [ "$EXIT_CODE" = '0' ]; then + EXIT_CODE="$exit_status" + fi + fi +} + addtrap() { if [ "$1" = 'prefix' ]; then CURRENTTRAP="$2 $CURRENTTRAP" else CURRENTTRAP="$CURRENTTRAP $1" fi - trap "$CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + trap "shellsetedetector; $CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM } setupenvironment() { -- cgit v1.2.3 From 04937adc655ceda0b3367f540e76df10296cfba1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Aug 2013 16:19:37 +0200 Subject: let apt-key del work better with softlink and single key keyrings Having fragement files means there is a good chance that there is one key per keyring, so deal with that as well as with setups in which keyrings are linked into trusted.gpg.d as we can't just modify those files (they might be in /usr for example). --- test/integration/test-apt-key | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index 5beb6f220..68b3f9710 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -37,3 +37,71 @@ testsuccess --nomsg aptkey --fakeroot update aptkey list | grep '^pub' > aptkey.list testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring' +testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +testsuccess aptkey --fakeroot del DBAC8DAE +testempty aptkey list + +# start from a clean plate again +cleanplate() { + rm -rf rootdir/etc/apt/trusted.gpg.d/ rootdir/etc/apt/trusted.gpg + mkdir rootdir/etc/apt/trusted.gpg.d/ +} + +msgtest 'Test key removal with' 'single key in real file' +cleanplate +cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +testempty aptkey list +testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ + +msgtest 'Test key removal with' 'single key in softlink' +cleanplate +ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +testempty aptkey list +testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess test -L rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ + +cleanplate +testsuccess aptkey --fakeroot add ./keys/joesixpack.pub +testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18 +pub 2048R/528144E2 2011-01-16' +cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse + +msgtest 'Test key removal with' 'multi key in real file' +cleanplate +cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16' +testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ + +msgtest 'Test key removal with' 'multi key in softlink' +cleanplate +ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16' +testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ +testsuccess test ! -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ + +msgtest 'Test key removal with' 'multiple files including key' +cleanplate +cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16' +testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ +testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ -- cgit v1.2.3