From 33b813ce44c7bafeb2a36b66fd004f8d94a2cbe4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 5 Feb 2014 17:35:33 +0100 Subject: move isatty() check into InitOutput() --- test/integration/test-apt-cli-upgrade | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-cli-upgrade b/test/integration/test-apt-cli-upgrade index 163a55576..21ce69413 100755 --- a/test/integration/test-apt-cli-upgrade +++ b/test/integration/test-apt-cli-upgrade @@ -16,8 +16,7 @@ setupaptarchive APTARCHIVE=$(readlink -f ./aptarchive) # default is to allow new dependencies -testequal "Calculating upgrade... Done -The following NEW packages will be installed: +testequal "The following NEW packages will be installed: foo-new-dependency The following packages will be upgraded: foo @@ -28,7 +27,6 @@ Conf foo-new-dependency (2.0 unstable [all]) Conf foo (2.0 unstable [all])" apt upgrade -qq -s # ensure -testequal "Calculating upgrade... Done -The following packages have been kept back: +testequal "The following packages have been kept back: foo 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." apt upgrade -qq -s --no-new-pkgs -- cgit v1.2.3 From a7250ed08e4761dd40870ea7350ca2c83457e890 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 6 Feb 2014 20:48:52 +0100 Subject: fix remaining testcase-bugs from my armel box Git-Dch: Ignore --- test/integration/test-apt-get-autoremove | 10 +-- .../test-architecture-specification-parsing | 82 ++++++++++++---------- ...ight-loop-configure-with-unpacking-new-packages | 29 ++++++-- 3 files changed, 70 insertions(+), 51 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index 68ea1c574..acde4b096 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -42,12 +42,12 @@ testsuccess aptget autoremove -y testdpkgnotinstalled 'po-debconf' testmarkedauto -sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -testfileequal 'rootdir/var/log/apt/history.log' ' -Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic) - +sed rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e 's#), #)\nInstall: #g' | sort -u > apt-history.log +testfileequal 'apt-history.log' ' +Install: debhelper:i386 (8.0.0) +Install: po-debconf:i386 (1.0.16, automatic) +Install: unrelated:i386 (1) Remove: debhelper:i386 (8.0.0) - Remove: po-debconf:i386 (1.0.16)' testsuccess aptget install debhelper -y diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing index 2741509a7..a43354871 100755 --- a/test/integration/test-architecture-specification-parsing +++ b/test/integration/test-architecture-specification-parsing @@ -4,102 +4,106 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture 'amd64' 'armel' -buildsimplenativepackage 'pkg-arch-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !amd64] -Depends: foo [amd64 !amd64]' -buildsimplenativepackage 'pkg-arch-no-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [!amd64 amd64] -Depends: foo [!amd64 amd64]' -buildsimplenativepackage 'pkg-arch-foo-unrelated-no' 'amd64' '1.0' 'stable' 'Build-Depends: foo [!kfreebsd-any amd64] -Depends: foo [!kfreebsd-any amd64]' -buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !kfreebsd-any] -Depends: foo [amd64 !kfreebsd-any]' -buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armhf], bar [arm] -Depends: foo [armhf], bar [arm]' +# we need this construct here as it isn't really possible to fake native arch for dpkg-* tools +NATIVE="$(command dpkg --print-architecture)" +configarchitecture "${NATIVE}" 'armel' + +buildsimplenativepackage 'pkg-arch-foo' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [${NATIVE} !${NATIVE}] +Depends: foo [${NATIVE} !${NATIVE}]" +buildsimplenativepackage 'pkg-arch-no-foo' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!${NATIVE} ${NATIVE}] +Depends: foo [!${NATIVE} ${NATIVE}]" +buildsimplenativepackage 'pkg-arch-foo-unrelated-no' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!kfreebsd-any ${NATIVE}] +Depends: foo [!kfreebsd-any ${NATIVE}]" +buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [${NATIVE} !kfreebsd-any] +Depends: foo [${NATIVE} !kfreebsd-any]" +buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armeb], bar [arm] +Depends: foo [armeb], bar [arm]' -buildsimplenativepackage 'foo' 'amd64' '1.0' 'stable' +buildsimplenativepackage 'foo' "$NATIVE" '1.0' 'stable' insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign' setupaptarchive -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following extra packages will be installed: foo The following NEW packages will be installed: foo pkg-arch-foo 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 stable [amd64]) -Inst pkg-arch-foo (1.0 stable [amd64]) -Conf foo (1.0 stable [amd64]) -Conf pkg-arch-foo (1.0 stable [amd64])' aptget install pkg-arch-foo -s +Inst foo (1.0 stable [${NATIVE}]) +Inst pkg-arch-foo (1.0 stable [${NATIVE}]) +Conf foo (1.0 stable [${NATIVE}]) +Conf pkg-arch-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo -s -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following NEW packages will be installed: pkg-arch-no-foo 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst pkg-arch-no-foo (1.0 stable [amd64]) -Conf pkg-arch-no-foo (1.0 stable [amd64])' aptget install pkg-arch-no-foo -s +Inst pkg-arch-no-foo (1.0 stable [${NATIVE}]) +Conf pkg-arch-no-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-no-foo -s -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following extra packages will be installed: foo The following NEW packages will be installed: foo pkg-arch-foo-unrelated-no 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 stable [amd64]) -Inst pkg-arch-foo-unrelated-no (1.0 stable [amd64]) -Conf foo (1.0 stable [amd64]) -Conf pkg-arch-foo-unrelated-no (1.0 stable [amd64])' aptget install pkg-arch-foo-unrelated-no -s +Inst foo (1.0 stable [${NATIVE}]) +Inst pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}]) +Conf foo (1.0 stable [${NATIVE}]) +Conf pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo-unrelated-no -s -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following extra packages will be installed: foo The following NEW packages will be installed: foo pkg-arch-foo-unrelated-no2 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 stable [amd64]) -Inst pkg-arch-foo-unrelated-no2 (1.0 stable [amd64]) -Conf foo (1.0 stable [amd64]) -Conf pkg-arch-foo-unrelated-no2 (1.0 stable [amd64])' aptget install pkg-arch-foo-unrelated-no2 -s +Inst foo (1.0 stable [${NATIVE}]) +Inst pkg-arch-foo-unrelated-no2 (1.0 stable [${NATIVE}]) +Conf foo (1.0 stable [${NATIVE}]) +Conf pkg-arch-foo-unrelated-no2 (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo-unrelated-no2 -s -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following NEW packages will be installed: foo 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 stable [amd64]) -Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo -s +Inst foo (1.0 stable [${NATIVE}]) +Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo -s testequal 'Reading package lists... Building dependency tree... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep pkg-arch-no-foo -s -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following NEW packages will be installed: foo 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 stable [amd64]) -Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no -s +Inst foo (1.0 stable [${NATIVE}]) +Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo-unrelated-no -s -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... The following NEW packages will be installed: foo 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst foo (1.0 stable [amd64]) -Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no2 -s +Inst foo (1.0 stable [${NATIVE}]) +Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo-unrelated-no2 -s testequal 'Reading package lists... Building dependency tree... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep no-depends -s # this is not really testing APT - more that dpkg is in line with us +configarchitecture 'amd64' 'armel' testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: 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 index 7f3b05e59..5856cd744 100755 --- a/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages +++ b/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages @@ -15,19 +15,18 @@ Breaks: libreoffice-core (>= 3+), libreoffice-core (<= 3~), libreoffice-style-ga 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) +insertpackage 'sid' 'libreoffice' 'amd64' '4' 'Depends: libreoffice-core (= 4)' +insertpackage 'sid' 'libreoffice-core' 'amd64' '4' 'Depends: libreoffice-common (>= 4) Breaks: libreoffice-common (<< 4), libreoffice-style-galaxy (<< 4)' -buildsimplenativepackage 'libreoffice-common' 'all' '4' 'sid' 'Depends: libreoffice-style, ure +insertpackage 'sid' 'libreoffice-common' 'all' '4' '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 +insertpackage 'sid' 'libreoffice-style-galaxy' 'amd64' '4' 'Depends: libreoffice-core Provides: libreoffice-style' - -buildsimplenativepackage 'ure' 'amd64' '4' 'sid' +insertpackage 'sid' 'ure' 'amd64' '4' setupaptarchive -testequal 'Reading package lists... +testequalor2 'Reading package lists... Building dependency tree... The following NEW packages will be installed: ure @@ -43,4 +42,20 @@ 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])' '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-common:amd64 on libreoffice-core:amd64] [libreoffice-common:amd64 on libreoffice-style-galaxy:amd64] [libreoffice-core:amd64 on libreoffice-common: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 34d6ece7566ea4fcda2286478b31641378aefc93 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Feb 2014 17:55:13 +0100 Subject: always cleanup patchfiles at the end of rred call With APT::Get::List-Cleanup disabled the ed-style patch files are lingering in the lists/ directory otherwise. That was kinda okay in the old none-client-merge as the filename was always the same so it was constantly overridden, but now with different names for client-merge quiet a few could pill up on the system and are used by the next call as it picks them up based on the filename. --- test/integration/test-pdiff-usage | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index ad31511b9..afe1ad443 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -31,6 +31,16 @@ wasmergeused() { msgfail fi + msgtest 'No intermediate patch files' 'still exist' + local EDS="$(find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*')" + if [ -z "$EDS" ]; then + msgpass + else + echo + echo "$EDS" + msgfail + fi + msgtest 'Check if the right pdiff merger was used' if grep -q '^pkgAcqIndexMergeDiffs::Done(): rred' $OUTPUT; then if echo "$*" | grep -q -- '-o Acquire::PDiffs::Merge=1'; then @@ -46,7 +56,7 @@ wasmergeused() { } testrun() { - # setup the base + msgmsg "Testcase: setup the base with: $*" find aptarchive -name 'Packages*' -type f -delete cp ${PKGFILE} aptarchive/Packages compressfile 'aptarchive/Packages' @@ -59,7 +69,7 @@ testrun() { testequal "$(cat ${PKGFILE}) " aptcache show apt oldstuff - msgmsg 'Testcase: apply with one patch' + msgmsg "Testcase: apply with one patch: $*" cp ${PKGFILE}-new aptarchive/Packages compressfile 'aptarchive/Packages' mkdir -p aptarchive/Packages.diff @@ -82,13 +92,13 @@ SHA1-Patches: testequal "$(cat ${PKGFILE}-new) " aptcache show apt newstuff - msgmsg 'Testcase: index is already up-to-date' + msgmsg "Testcase: index is already up-to-date: $*" find rootdir/var/lib/apt/lists -name '*.IndexDiff' -type f -delete testsuccess aptget update "$@" testequal "$(cat ${PKGFILE}-new) " aptcache show apt newstuff - msgmsg 'Testcase: apply with two patches' + msgmsg "Testcase: apply with two patches: $*" cp ${PKGFILE}-new aptarchive/Packages echo ' Package: futurestuff @@ -129,7 +139,7 @@ SHA1-Patches: testequal "$(cat Packages-future) " aptcache show apt newstuff futurestuff - msgmsg 'Testcase: patch applying fails, but successful fallback' + msgmsg "Testcase: patch applying fails, but successful fallback: $*" rm -rf rootdir/var/lib/apt/lists cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists cp ${PKGFILE}-new aptarchive/Packages @@ -154,6 +164,10 @@ SHA1-Patches: testequal "$(cat ${PKGFILE}-new) " aptcache show apt newstuff } +echo 'Debug::pkgAcquire::Diffs "true"; +Debug::pkgAcquire::rred "true";' > rootdir/etc/apt/apt.conf.d/rreddebug.conf -testrun -o Debug::pkgAcquire::Diffs=1 -o Debug::pkgAcquire::rred=1 -o Acquire::PDiffs::Merge=0 -testrun -o Debug::pkgAcquire::Diffs=1 -o Debug::pkgAcquire::rred=1 -o Acquire::PDiffs::Merge=1 +testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1 +testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1 +testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0 +testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0 -- cgit v1.2.3 From e209542632e61b9bf07b809c333f1e4b9de7fde9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Feb 2014 18:06:28 +0100 Subject: use VersionSet in download to handle repeats Closes: 738103 --- test/integration/test-apt-get-download | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index c2a5c3d8e..ec809e0ce 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -34,8 +34,13 @@ testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sh # deb:677887 testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms -# deb:736962 - apt-get download foo && -aptget download apt -aptget download apt +# deb:736962 +testsuccess aptget download apt +testsuccess aptget download apt +testsuccess test -s apt_2.0_all.deb + +rm -f apt_1.0_all.deb apt_2.0_all.deb + +# deb:738103 +testsuccess aptget download apt apt apt/unstable apt=2.0 testsuccess test -s apt_2.0_all.deb -rm -f apt_1.0_all.deb -- cgit v1.2.3 From 8f3594c3487800edc2a97af1f3290049776dc556 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 12 Feb 2014 07:59:07 +0100 Subject: Use a APT::VersionSet instead of a VersionList Use a APT::VersionSet instead of a APT::VersionList in DoDownload() to ensure that there is only one version in the set even if the user passes multiple identical name/versions on the commandline (Bug#738103) --- test/integration/test-apt-get-download | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index c2a5c3d8e..0d92283f1 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -39,3 +39,8 @@ aptget download apt aptget download apt testsuccess test -s apt_2.0_all.deb rm -f apt_1.0_all.deb + +# deb:738103 - apt-get download foo foo fails +rm -f apt_*.deb +aptget download apt apt +testsuccess test -s apt_2.0_all.deb -- cgit v1.2.3 From 362b152c38195a3d51406285011fc34238158bda Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 13 Feb 2014 09:51:57 +0100 Subject: remove duplicated apt-get download apt apt test --- test/integration/test-apt-get-download | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 7cce6ef29..be3144e1f 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -45,7 +45,3 @@ rm -f apt_1.0_all.deb apt_2.0_all.deb testsuccess aptget download apt apt apt/unstable apt=2.0 testsuccess test -s apt_2.0_all.deb -# deb:738103 - apt-get download foo foo fails -rm -f apt_*.deb -aptget download apt apt -testsuccess test -s apt_2.0_all.deb -- cgit v1.2.3