From 1054d76b2519efc858a9d23301495a763c1f8230 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Sep 2010 18:34:48 +0200 Subject: fix the testcases which were broken by the new space between number and unit --- test/integration/test-bug-591882-conkeror | 8 ++++---- test/integration/test-bug-595691-empty-and-broken-archive-files | 2 +- test/integration/test-ubuntu-bug-614993 | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-591882-conkeror b/test/integration/test-bug-591882-conkeror index b1dbb3a0a..27a217b5f 100755 --- a/test/integration/test-bug-591882-conkeror +++ b/test/integration/test-bug-591882-conkeror @@ -34,8 +34,8 @@ The following packages will be upgraded: perl-base perl-modules readline-common sed ttf-dejavu-core ucf whiptail x11-common zlib1g 87 upgraded, 26 newly installed, 5 to remove and 0 not upgraded. -Need to get 0B/54.4MB of archives. -After this operation, 12.4MB of additional disk space will be used. +Need to get 0 B/54.4 MB of archives. +After this operation, 12.4 MB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." UPGRADESUCCESS="Reading package lists... @@ -66,8 +66,8 @@ The following packages will be upgraded: perl-base perl-modules readline-common sed ttf-dejavu-core ucf whiptail x11-common zlib1g 88 upgraded, 30 newly installed, 4 to remove and 0 not upgraded. -Need to get 0B/62.9MB of archives. -After this operation, 36.0MB of additional disk space will be used. +Need to get 0 B/62.9 MB of archives. +After this operation, 36.0 MB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." # Test that the old behavior can be restored with the option 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 234073759..d982a4981 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -11,7 +11,7 @@ setupflataptarchive testaptgetupdate() { aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true - sed -i -e '/^Fetched / d' -e 's#\[[0-9]*[kMGTPY]*B\]#\[\]#' testaptgetupdate.diff + sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff GIVEN="$1" shift msgtest "Test for correctness of" "apt-get update with $*" diff --git a/test/integration/test-ubuntu-bug-614993 b/test/integration/test-ubuntu-bug-614993 index f54909bc2..d70c65ba2 100755 --- a/test/integration/test-ubuntu-bug-614993 +++ b/test/integration/test-ubuntu-bug-614993 @@ -52,8 +52,8 @@ The following packages will be upgraded: xserver-xorg-video-tseng xserver-xorg-video-vesa xserver-xorg-video-vmware xserver-xorg-video-voodoo 41 upgraded, 5 newly installed, 1 to remove and 3 not upgraded. -Need to get 0B/5505kB of archives. -After this operation, 2294kB disk space will be freed. +Need to get 0 B/5505 kB of archives. +After this operation, 2294 kB disk space will be freed. E: Trivial Only specified but this is not a trivial operation." testequal "$UPGRADE" aptget install xserver-xorg --trivial-only -- cgit v1.2.3 From 01a6e24cd1b601df2f20190b6118c4616e7fedf2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Sep 2010 19:55:04 +0200 Subject: * apt-pkg/depcache.cc: - do not check endpointer packages instead of only those which prevented NeverAutoRemove settings from having an effect (Closes: #598452) --- test/integration/framework | 24 ++++++++++++++++++++++++ test/integration/test-autoremove | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 56 insertions(+), 8 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 59d2f0e85..c09afcbad 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -499,3 +499,27 @@ testnopackage() { fi msgpass } + +testdpkginstalled() { + msgtest "Test for correctly installed package(s) with" "dpkg -l $*" + local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^i]' | wc -l)" + if [ "$PKGS" != 0 ]; then + echo $PKGS + dpkg -l $* | grep '^[a-z]' + msgfail + return 1 + fi + msgpass +} + +testdpkgnoninstalled() { + msgtest "Test for correctly non-installed package(s) with" "dpkg -l $*" + local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^u]' | wc -l)" + if [ "$PKGS" != 0 ]; then + echo + dpkg -l $* | grep '^[a-z]' + msgfail + return 1 + fi + msgpass +} diff --git a/test/integration/test-autoremove b/test/integration/test-autoremove index fb39e979a..7127b3d82 100755 --- a/test/integration/test-autoremove +++ b/test/integration/test-autoremove @@ -4,26 +4,50 @@ set -e local TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'i386' -buildsimplenativepackage "unrelated" "all" "1" "unstable" -buildsimplenativepackage "po-debconf" "all" "1.0.16" "unstable" -buildsimplenativepackage "debhelper" "all" "8.0.0" "unstable" "Depends: po-debconf" +buildsimplenativepackage 'unrelated' 'all' '1' 'unstable' +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 +testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' -testfileequal "rootdir/var/lib/apt/extended_states" "Package: po-debconf +testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: po-debconf Architecture: i386 Auto-Installed: 1 -" +' aptget remove debhelper -y -qq 2>&1 > /dev/null +testdpkgnoninstalled 'debhelper' +testdpkginstalled 'po-debconf unrelated' + +echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + po-debconf +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +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 +testdpkginstalled 'po-debconf' -testfileequal "rootdir/var/lib/apt/extended_states" "" +echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove +aptget autoremove -y -qq 2>&1 > /dev/null +testdpkginstalled "po-debconf" + +rm rootdir/etc/apt/apt.conf.d/00autoremove +aptget autoremove -y -qq 2>&1 > /dev/null +testdpkgnoninstalled 'po-debconf' + +testfileequal 'rootdir/var/lib/apt/extended_states' '' 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" ' +testfileequal 'rootdir/var/log/apt/history.log' ' Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic) Remove: debhelper:i386 (8.0.0) -- cgit v1.2.3