From 016bea8214e1826b289025f03890f70a5805db87 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Nov 2014 12:10:15 +0100 Subject: correct architecture detection for 'rc' packages for purge We were already considering these cases, but the code was flawed, so that packages changing architectures are incorrectly handled and hence the wrong architecture is used to call dpkg with, so that dpkg says the package isn't installed (which it isn't for the requested architecture). Closes: 770898 --- .../test-ubuntu-bug-761175-remove-purge | 62 ++++++++++++++-------- 1 file changed, 41 insertions(+), 21 deletions(-) (limited to 'test/integration/test-ubuntu-bug-761175-remove-purge') diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge index 14648e9b8..0b5a91246 100755 --- a/test/integration/test-ubuntu-bug-761175-remove-purge +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -4,33 +4,53 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture 'native' - -setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable' -BUILDDIR='incoming/compiz-core-1.0' -mkdir -p ${BUILDDIR}/debian/compiz-core/etc -echo 'foo=bar;' > ${BUILDDIR}/compiz.conf -echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install -buildpackage "$BUILDDIR" 'unstable' 'main' 'native' -rm -rf "$BUILDDIR" +configarchitecture 'amd64' 'i386' + +buildcompizpkg() { + setupsimplenativepackage "compiz-core-$1" "$2" "$3" "$4" + BUILDDIR="incoming/compiz-core-$1-$3" + mkdir -p ${BUILDDIR}/debian/compiz-core/etc + echo 'foo=bar;' > ${BUILDDIR}/compiz.conf + echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install + buildpackage "$BUILDDIR" "$4" 'main' "$2" + rm -rf "$BUILDDIR" +} +buildcompizpkg 'native' 'all' '1.0' 'stable' +buildcompizpkg 'all' 'native' '1.0' 'stable' +buildcompizpkg 'native' 'native' '2.0' 'unstable' +buildcompizpkg 'all' 'all' '2.0' 'unstable' setupaptarchive +runtests() { + testdpkgnotinstalled compiz-core-$1 + testsuccess aptget install compiz-core-$1 -t "${2:-unstable}" + testdpkginstalled compiz-core-$1 -testdpkgnotinstalled compiz-core -testsuccess aptget install compiz-core -testdpkginstalled compiz-core - -testsuccess aptget remove compiz-core -y -testdpkgnotinstalled compiz-core - -msgtest 'Check that conffiles are still around for' 'compiz-core' -dpkg -l compiz-core | grep -q '^rc' && msgpass || msgfail + testsuccess aptget remove compiz-core-$1 -y + testdpkgnotinstalled compiz-core-$1 + testdpkgstatus 'rc' '1' "compiz-core-$1" -testequal 'Reading package lists... + testequal "Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: - compiz-core* + compiz-core-$1* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. -Purg compiz-core' aptget purge compiz-core -s +Purg compiz-core-$1" aptget purge compiz-core-$1 -s + testsuccess aptget purge compiz-core-$1 -y + testequal "dpkg-query: no packages found matching compiz-core-$1" dpkg -l compiz-core-$1 +} + +msgmsg 'Test in multi arch environment' +runtests 'native' +runtests 'all' +runtests 'native' 'stable' +runtests 'all' 'stable' + +msgmsg 'Test in single arch environment' +configarchitecture 'amd64' +runtests 'native' +runtests 'all' +runtests 'native' 'stable' +runtests 'all' 'stable' -- cgit v1.2.3 From 25b86db159fbc3c043628e285c0c1ef24dec2c6e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Mar 2015 00:59:44 +0100 Subject: test exitcode as well as string equality We use test{success,failure} now all over the place in the framework, so its only consequencial to do this in the situations in which we test for a specific output as well. Git-Dch: Ignore --- test/integration/test-ubuntu-bug-761175-remove-purge | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration/test-ubuntu-bug-761175-remove-purge') diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge index 0b5a91246..c2e2aadf1 100755 --- a/test/integration/test-ubuntu-bug-761175-remove-purge +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -31,7 +31,7 @@ runtests() { testdpkgnotinstalled compiz-core-$1 testdpkgstatus 'rc' '1' "compiz-core-$1" - testequal "Reading package lists... + testsuccessequal "Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: @@ -39,7 +39,7 @@ The following packages will be REMOVED: 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Purg compiz-core-$1" aptget purge compiz-core-$1 -s testsuccess aptget purge compiz-core-$1 -y - testequal "dpkg-query: no packages found matching compiz-core-$1" dpkg -l compiz-core-$1 + testfailureequal "dpkg-query: no packages found matching compiz-core-$1" dpkg -l compiz-core-$1 } msgmsg 'Test in multi arch environment' -- cgit v1.2.3 From 41fadd29f136627fb5c9e733130b2a57c49fafaf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Apr 2015 10:55:08 +0200 Subject: remove available file to have same dpkg -l behavior dpkg -l < 1.16.2 loads the available file and hence sees a package which later versions do not see, leading to failures on travis-ci. The different versions also have slightly different messages. Git-Dch: Ignore --- test/integration/test-ubuntu-bug-761175-remove-purge | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/integration/test-ubuntu-bug-761175-remove-purge') diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge index c2e2aadf1..d5dfa2acf 100755 --- a/test/integration/test-ubuntu-bug-761175-remove-purge +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -39,7 +39,8 @@ The following packages will be REMOVED: 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Purg compiz-core-$1" aptget purge compiz-core-$1 -s testsuccess aptget purge compiz-core-$1 -y - testfailureequal "dpkg-query: no packages found matching compiz-core-$1" dpkg -l compiz-core-$1 + echo -n '' > rootdir/var/lib/dpkg/available # dpkg -l < 1.16.2 reads the available file by default, where the package can be found + testequalor2 "dpkg-query: no packages found matching compiz-core-$1" "No packages found matching compiz-core-$1." dpkg -l compiz-core-$1 } msgmsg 'Test in multi arch environment' -- cgit v1.2.3