From 89a1aa5dd55a3469c92720c7fcb90779f90b61f0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2011 21:23:00 +0200 Subject: add a very dumb pause method to stop test-execution --- test/integration/framework | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index cc5af798c..96cdb5f5e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -708,3 +708,9 @@ testmarkedauto() { fi aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail } + +pause() { + echo "STOPPED execution. Press enter to continue" + local IGNORE + read IGNORE +} -- cgit v1.2.3 From 2e3c9d6452e69dcb5c83732fbda27b747bc997f4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2011 21:29:16 +0200 Subject: * apt-pkg/indexcopy.cc: - Verify that the first line of an InRelease file is a PGP header for a signed message. Otherwise a man-in-the-middle can prefix a valid InRelease file with his own data! (CVE-2011-1829) --- ...st-ubuntu-bug-784473-InRelease-one-message-only | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 test/integration/test-ubuntu-bug-784473-InRelease-one-message-only (limited to 'test') diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only new file mode 100755 index 000000000..d97011914 --- /dev/null +++ b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'apt' 'i386' '0.8.11' + +setupaptarchive + +rm -rf rootdir/var/lib/apt/lists + +find aptarchive/ -name 'Release.gpg' -delete +find aptarchive/ -name 'InRelease' -exec cp {} {}.old \; + +for RELEASE in $(find aptarchive/ -name 'InRelease'); do + (echo 'Origin: Marvin +Label: Marvin +Suite: experimental +Codename: experimental +MD5Sum: + 65fd410587b6978de2277f2912523f09 9360 Packages + d27b294ed172a1fa9dd5a53949914c5d 4076 Packages.bz2 + 2182897e0a2a0c09e760beaae117a015 2023 Packages.diff/Index + 1b895931853981ad8204d2439821b999 4144 Packages.gz'; echo; cat ${RELEASE}.old;) > ${RELEASE} +done +aptget update -qq > /dev/null 2> starts-with-unsigned.msg +sed -i 's#File .*InRelease#File InRelease#' starts-with-unsigned.msg +testfileequal starts-with-unsigned.msg "W: GPG error: file: unstable InRelease: File InRelease doesn't start with a clearsigned message" -- cgit v1.2.3 From 5b7d1ee67575e311871fb73be421ea7fd2f6fd73 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 22:38:59 +0200 Subject: * apt-pkg/policy.cc: - do not segfault in pinning if a package with this name doesn't exist. Thanks to Ferdinand Thommes for the report! --- test/integration/test-pin-non-existent-package | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 test/integration/test-pin-non-existent-package (limited to 'test') diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package new file mode 100755 index 000000000..1031272e2 --- /dev/null +++ b/test/integration/test-pin-non-existent-package @@ -0,0 +1,44 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'apt' 'i386' '0.8.15' + +setupaptarchive + +testcandidate() { + msgtest "Test that the Candidate for $1 is" $2 + test "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" && msgpass || msgfail +} + +testcandidate apt '0.8.15' +testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade + +echo 'Package: apt +Pin: release a=unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences + +testcandidate apt '(none)' +testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade + +echo ' +Package: doesntexist +Pin: release a=unstable +Pin-Priority: 1000' >> rootdir/etc/apt/preferences + +testcandidate apt '(none)' +testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 + +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -- cgit v1.2.3 From e2bba11c9a1858c98954e7c5299d20a6c0966cc7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jun 2011 23:26:38 +0200 Subject: - ensure that only the first specific stanza for a package is used - save all stanzas which had no effect in Unmatched --- test/integration/test-pin-non-existent-package | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package index 1031272e2..bd6ccc476 100755 --- a/test/integration/test-pin-non-existent-package +++ b/test/integration/test-pin-non-existent-package @@ -12,7 +12,13 @@ setupaptarchive testcandidate() { msgtest "Test that the Candidate for $1 is" $2 - test "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" && msgpass || msgfail + if [ "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" ]; then + msgpass + else + echo + aptcache policy $1 + msgfail + fi } testcandidate apt '0.8.15' @@ -36,6 +42,13 @@ Package: doesntexist Pin: release a=unstable Pin-Priority: 1000' >> rootdir/etc/apt/preferences +testcandidate apt '(none)' + +echo ' +Package: apt +Pin: release a=unstable +Pin-Priority: 1000' >> rootdir/etc/apt/preferences + testcandidate apt '(none)' testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 -- cgit v1.2.3 From 9164e147eb78de6b4f8c8ce4b71e93ad71a44725 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 30 Jun 2011 00:03:26 +0200 Subject: allow package:architecure in Package: --- test/integration/test-pin-non-existent-package | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package index bd6ccc476..c91e77844 100755 --- a/test/integration/test-pin-non-existent-package +++ b/test/integration/test-pin-non-existent-package @@ -7,6 +7,7 @@ setupenvironment configarchitecture "i386" insertpackage 'unstable' 'apt' 'i386' '0.8.15' +insertpackage 'unstable' 'arch' 'i386' '1.0' setupaptarchive @@ -55,3 +56,17 @@ testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist testequal 'Reading package lists... Building dependency tree... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade + +echo 'Package: arch:amd64 +Pin: release a=unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences + +testcandidate arch '1.0' + +echo ' +Package: arch:i386 +Pin: release a=unstable +Pin-Priority: -1' >> rootdir/etc/apt/preferences + +testcandidate arch '(none)' + -- cgit v1.2.3 From b41929c0139d0658046fb4e4088a8de167705a99 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 6 Jul 2011 12:46:29 +0200 Subject: * cmdline/apt-get.cc: - restore all important dependencies for garbage packages (LP: #806274) --- .../test-ubuntu-bug-806274-install-suggests | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 test/integration/test-ubuntu-bug-806274-install-suggests (limited to 'test') diff --git a/test/integration/test-ubuntu-bug-806274-install-suggests b/test/integration/test-ubuntu-bug-806274-install-suggests new file mode 100755 index 000000000..fb72f0999 --- /dev/null +++ b/test/integration/test-ubuntu-bug-806274-install-suggests @@ -0,0 +1,81 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'apt' 'i386' '0.8.15' 'Depends: foo +Recommends: bar +Suggests: baz' +insertpackage 'unstable' 'foo' 'i386' '1.0' +insertpackage 'unstable' 'bar' 'i386' '1.0' +insertpackage 'unstable' 'baz' 'i386' '1.0' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + bar foo +Suggested packages: + baz +The following NEW packages will be installed: + apt bar foo +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386]) +Inst bar (1.0 unstable [i386]) +Conf bar (1.0 unstable [i386])' aptget install apt -s --install-recommends --no-install-suggests + + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + bar baz foo +The following NEW packages will be installed: + apt bar baz foo +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386]) +Inst bar (1.0 unstable [i386]) +Inst baz (1.0 unstable [i386]) +Conf bar (1.0 unstable [i386]) +Conf baz (1.0 unstable [i386])' aptget install apt -s --install-recommends --install-suggests + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +Suggested packages: + baz +Recommended packages: + bar +The following NEW packages will be installed: + apt foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386])' aptget install apt -s --no-install-recommends --no-install-suggests + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + baz foo +Recommended packages: + bar +The following NEW packages will be installed: + apt baz foo +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [i386]) +Conf foo (1.0 unstable [i386]) +Inst apt (0.8.15 unstable [i386]) +Conf apt (0.8.15 unstable [i386]) +Inst baz (1.0 unstable [i386]) +Conf baz (1.0 unstable [i386])' aptget install apt -s --no-install-recommends --install-suggests -- cgit v1.2.3 From 953b348cb02fcdccb597b6988f904bfdb696e92e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 14 Jul 2011 11:03:55 +0200 Subject: make ResolveByKeep() more clever and hold back packages that would go into a broken policy state by the upgrade --- test/integration/test-resolve-by-keep-new-recommends | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 test/integration/test-resolve-by-keep-new-recommends (limited to 'test') diff --git a/test/integration/test-resolve-by-keep-new-recommends b/test/integration/test-resolve-by-keep-new-recommends new file mode 100755 index 000000000..8134b76aa --- /dev/null +++ b/test/integration/test-resolve-by-keep-new-recommends @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertinstalledpackage 'foo' 'i386' '1.0' +insertpackage 'unstable' 'foo' 'i386' '2.0' 'Recommends: bar' + +setupaptarchive + +UPGRADE_KEEP="Reading package lists... +Building dependency tree... +The following packages have been kept back: + foo +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." +testequal "$UPGRADE_KEEP" aptget upgrade -s + -- cgit v1.2.3