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 a3bbbab7ca5f94391b2158cfe9deb85eb335e29a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 16 Jul 2011 16:48:03 +0200 Subject: * apt-pkg/policy.cc: - emit an error on unknown APT::Default-Release value (Closes: #407511) --- test/integration/framework | 23 +++++++++-- .../test-bug-407511-fail-invalid-default-release | 47 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 3 deletions(-) create mode 100755 test/integration/test-bug-407511-fail-invalid-default-release (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 96cdb5f5e..702e352a3 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -481,6 +481,10 @@ buildaptarchivefromfiles() { generatereleasefiles } +# can be overridden by testcases for their pleasure +getcodenamefromsuite() { echo -n "$1"; } +getreleaseversionfromsuite() { true; } + generatereleasefiles() { msgninfo "\tGenerate Release files… " local DATE="${1:-now}" @@ -489,9 +493,22 @@ generatereleasefiles() { aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index done for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do - local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" - aptftparchive -qq release $dir -o APT::FTPArchive::Release::Suite="${CODENAME}" -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference - if [ "$CODENAME" = "experimental" -o "$CODENAME" = "experimental2" ]; then + local SUITE="$(echo "$dir" | cut -d'/' -f 4)" + local CODENAME="$(getcodenamefromsuite $SUITE)" + local VERSION="$(getreleaseversionfromsuite $SUITE)" + if [ -z "$VERSION" ]; then + aptftparchive -qq release $dir \ + -o APT::FTPArchive::Release::Suite="${SUITE}" \ + -o APT::FTPArchive::Release::Codename="${CODENAME}" \ + | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + else + aptftparchive -qq release $dir \ + -o APT::FTPArchive::Release::Suite="${SUITE}" \ + -o APT::FTPArchive::Release::Codename="${CODENAME}" \ + -o APT::FTPArchive::Release::Version="${VERSION}" \ + | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + fi + if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then sed -i '/^Date: / a\ NotAutomatic: yes' $dir/Release fi diff --git a/test/integration/test-bug-407511-fail-invalid-default-release b/test/integration/test-bug-407511-fail-invalid-default-release new file mode 100755 index 000000000..d0a73af7d --- /dev/null +++ b/test/integration/test-bug-407511-fail-invalid-default-release @@ -0,0 +1,47 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'cool' 'all' '1.0-1' + +getcodenamefromsuite() { + if [ "$SUITE" = 'unstable' ]; then + echo -n 'sid' + else + echo -n "$SUITE" + fi +} +getreleaseversionfromsuite() { + if [ "$SUITE" = 'unstable' ]; then + echo -n '42.0' + else + echo -n '0.8.15' + fi +} + +setupaptarchive + +passdist() { + msgtest "Test that target-release is accepted" $1 + aptget dist-upgrade -t $1 -qq && msgpass || msgfail +} + +faildist() { + msgtest "Test that target-release is refused" $1 + aptget dist-upgrade -t $1 -qq 2> /dev/null && msgfail || msgpass +} + +passdist unstable +passdist sid +faildist sidd +faildist stable +passdist 42.0 +passdist 42.* +passdist 42* +passdist 4*.0 +faildist 21.0 +faildist 21* -- cgit v1.2.3 From c3182c823bdba037e7f1daaffde8b44155ff4f48 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 25 Jul 2011 13:40:50 +0200 Subject: update the testcase to reflect that native is always on top if it is not in the config provided list of Architectures --- test/libapt/getarchitectures_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/libapt/getarchitectures_test.cc b/test/libapt/getarchitectures_test.cc index 1500caeed..e3ca7bbc2 100644 --- a/test/libapt/getarchitectures_test.cc +++ b/test/libapt/getarchitectures_test.cc @@ -39,6 +39,12 @@ int main(int argc,char *argv[]) _config->Set("APT::Architecture", "armel"); vec = APT::Configuration::getArchitectures(false); equals(vec.size(), 2); + equals(vec[0], "armel"); + equals(vec[1], "i386"); + + _config->Set("APT::Architectures::2", "armel"); + vec = APT::Configuration::getArchitectures(false); + equals(vec.size(), 2); equals(vec[0], "i386"); equals(vec[1], "armel"); -- cgit v1.2.3 From fce1153321e432ed4a64e9742a8fc1c5558124e4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 25 Jul 2011 13:55:23 +0200 Subject: the order of languages after "none" is not important, so ignore it in tests --- test/libapt/assert.h | 42 ++++++++++++++++++++++++++++++++++++---- test/libapt/getlanguages_test.cc | 4 ++-- 2 files changed, 40 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/libapt/assert.h b/test/libapt/assert.h index 5da76ae0a..92b662dfa 100644 --- a/test/libapt/assert.h +++ b/test/libapt/assert.h @@ -1,9 +1,9 @@ #include -#define equals(x,y) assertEquals(x, y, __LINE__) +#define equals(x,y) assertEquals(y, x, __LINE__) template < typename X, typename Y > -void OutputAssert(X expect, char const* compare, Y get, unsigned long const &line) { +void OutputAssertEqual(X expect, char const* compare, Y get, unsigned long const &line) { std::cerr << "Test FAILED: »" << expect << "« " << compare << " »" << get << "« at line " << line << std::endl; } @@ -11,11 +11,45 @@ template < typename X, typename Y > void assertEquals(X expect, Y get, unsigned long const &line) { if (expect == get) return; - OutputAssert(expect, "==", get, line); + OutputAssertEqual(expect, "==", get, line); } void assertEquals(unsigned int const &expect, int const &get, unsigned long const &line) { if (get < 0) - OutputAssert(expect, "==", get, line); + OutputAssertEqual(expect, "==", get, line); assertEquals(expect, get, line); } + +void assertEquals(int const &expect, unsigned int const &get, unsigned long const &line) { + if (expect < 0) + OutputAssertEqual(expect, "==", get, line); + assertEquals(expect, get, line); +} + + +#define equalsOr2(x,y,z) assertEqualsOr2(y, z, x, __LINE__) + +template < typename X, typename Y > +void OutputAssertEqualOr2(X expect1, X expect2, char const* compare, Y get, unsigned long const &line) { + std::cerr << "Test FAILED: »" << expect1 << "« or »" << expect2 << "« " << compare << " »" << get << "« at line " << line << std::endl; +} + +template < typename X, typename Y > +void assertEqualsOr2(X expect1, X expect2, Y get, unsigned long const &line) { + if (expect1 == get || expect2 == get) + return; + OutputAssertEqualOr2(expect1, expect2, "==", get, line); +} + +void assertEqualsOr2(unsigned int const &expect1, unsigned int const &expect2, int const &get, unsigned long const &line) { + if (get < 0) + OutputAssertEqualOr2(expect1, expect2, "==", get, line); + assertEqualsOr2(expect1, expect2, get, line); +} + +void assertEqualsOr2(int const &expect1, int const &expect2, unsigned int const &get, unsigned long const &line) { + if (expect1 < 0 && expect2 < 0) + OutputAssertEqualOr2(expect1, expect2, "==", get, line); + assertEqualsOr2(expect1, expect2, get, line); +} + diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index 707142aef..3d63e0e74 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -138,8 +138,8 @@ int main(int argc,char *argv[]) equals(vec[1], "de"); equals(vec[2], "en"); equals(vec[3], "none"); - equals(vec[4], "pt"); - equals(vec[5], "tr"); + equalsOr2(vec[4], "pt", "tr"); + equalsOr2(vec[5], "tr", "pt"); _config->Set("Dir::State::lists", "/non-existing-dir"); _config->Set("Acquire::Languages::1", "none"); -- cgit v1.2.3 From 234675b71a2caab5c7cc0dc3b32a241683d3b3d2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 25 Jul 2011 14:40:22 +0200 Subject: implement MultiarchCross for build-dep and source (Closes: #632221) --- test/integration/framework | 22 +++ .../test-bug-632221-cross-dependency-satisfaction | 183 +++++++++++++++++++++ 2 files changed, 205 insertions(+) create mode 100755 test/integration/test-bug-632221-cross-dependency-satisfaction (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 702e352a3..fa451cf4f 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -151,6 +151,7 @@ setupenvironment() { configarchitecture() { local CONFFILE=rootdir/etc/apt/apt.conf.d/01multiarch.conf + rm -f $CONFFILE echo "APT::Architecture \"$1\";" > $CONFFILE shift while [ -n "$1" ]; do @@ -429,6 +430,27 @@ Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE done } +insertsource() { + local RELEASE="$1" + local NAME="$2" + local ARCH="$3" + local VERSION="$4" + local DEPENDENCIES="$5" + local ARCHS="" + local SPATH="aptarchive/dists/${RELEASE}/main/source" + mkdir -p $SPATH + local FILE="${SPATH}/Sources" + echo "Package: $NAME +Binary: $NAME +Version: $VERSION +Maintainer: Joe Sixpack +Architecture: $ARCH" >> $FILE + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE + echo "Files: + d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc + d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz" >> $FILE +} + insertinstalledpackage() { local NAME="$1" local ARCH="$2" diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction new file mode 100755 index 000000000..58de44843 --- /dev/null +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -0,0 +1,183 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'armel' + +insertinstalledpackage 'build-essential' 'all' '11.5' + +insertpackage 'unstable' 'doxygen' 'amd64,armel' '1.0' +insertpackage 'unstable' 'libc6' 'amd64,armel' '1.0' 'Multi-Arch: same' +insertpackage 'unstable' 'libc6-dev' 'amd64,armel' '1.0' 'Depends: libc6 +Multi-Arch: same' +insertpackage 'unstable' 'cool' 'amd64,armel' '1.0' 'Multi-Arch: allowed' +insertpackage 'unstable' 'amdboot' 'amd64' '1.0' +insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign' + +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot cool doxygen foreigner libc6 libc6-dev +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +Inst amdboot (1.0 unstable [amd64]) +Inst cool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [amd64]) +Inst foreigner (1.0 unstable [amd64]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf amdboot (1.0 unstable [amd64]) +Conf cool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [amd64]) +Conf foreigner (1.0 unstable [amd64]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot cool doxygen foreigner libc6 libc6:armel libc6-dev libc6-dev:armel +0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. +Inst amdboot (1.0 unstable [amd64]) +Inst cool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [amd64]) +Inst foreigner (1.0 unstable [amd64]) +Inst libc6:armel (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev:armel (1.0 unstable [armel]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf amdboot (1.0 unstable [amd64]) +Conf cool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [amd64]) +Conf foreigner (1.0 unstable [amd64]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6:armel (1.0 unstable [armel]) +Conf libc6-dev (1.0 unstable [amd64]) +Conf libc6-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a armel + +configarchitecture 'armel' 'amd64' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot:amd64 cool doxygen foreigner libc6 libc6-dev +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +Inst amdboot:amd64 (1.0 unstable [amd64]) +Inst cool (1.0 unstable [armel]) +Inst doxygen (1.0 unstable [armel]) +Inst foreigner (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [armel]) +Inst libc6-dev (1.0 unstable [armel]) +Conf amdboot:amd64 (1.0 unstable [amd64]) +Conf cool (1.0 unstable [armel]) +Conf doxygen (1.0 unstable [armel]) +Conf foreigner (1.0 unstable [armel]) +Conf libc6 (1.0 unstable [armel]) +Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot:amd64 cool doxygen foreigner libc6:amd64 libc6 libc6-dev:amd64 + libc6-dev +0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. +Inst amdboot:amd64 (1.0 unstable [amd64]) +Inst cool (1.0 unstable [armel]) +Inst doxygen (1.0 unstable [armel]) +Inst foreigner (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [armel]) +Inst libc6:amd64 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [armel]) +Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Conf amdboot:amd64 (1.0 unstable [amd64]) +Conf cool (1.0 unstable [armel]) +Conf doxygen (1.0 unstable [armel]) +Conf foreigner (1.0 unstable [armel]) +Conf libc6:amd64 (1.0 unstable [amd64]) +Conf libc6 (1.0 unstable [armel]) +Conf libc6-dev:amd64 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s -a amd64 + +configarchitecture 'amd64' 'armel' + +insertinstalledpackage 'cool' 'amd64' '0.5' +insertinstalledpackage 'foreigner' 'armel' '0.5' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot doxygen libc6 libc6-dev +0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded. +Inst amdboot (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [amd64]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf amdboot (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [amd64]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot doxygen libc6 libc6:armel libc6-dev libc6-dev:armel +0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. +Inst amdboot (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [amd64]) +Inst libc6:armel (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev:armel (1.0 unstable [armel]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf amdboot (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [amd64]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6:armel (1.0 unstable [armel]) +Conf libc6-dev (1.0 unstable [amd64]) +Conf libc6-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a armel + +configarchitecture 'armel' 'amd64' + +# cool 0.5 is not M-A: allowed, so amd64 is not acceptable +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + cool:amd64 +The following NEW packages will be installed: + amdboot:amd64 cool doxygen libc6 libc6-dev +0 upgraded, 5 newly installed, 1 to remove and 1 not upgraded. +Remv cool:amd64 [0.5] +Inst amdboot:amd64 (1.0 unstable [amd64]) +Inst cool (1.0 unstable [armel]) +Inst doxygen (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [armel]) +Inst libc6-dev (1.0 unstable [armel]) +Conf amdboot:amd64 (1.0 unstable [amd64]) +Conf cool (1.0 unstable [armel]) +Conf doxygen (1.0 unstable [armel]) +Conf libc6 (1.0 unstable [armel]) +Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + amdboot:amd64 doxygen libc6:amd64 libc6 libc6-dev:amd64 libc6-dev +0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. +Inst amdboot:amd64 (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [armel]) +Inst libc6 (1.0 unstable [armel]) +Inst libc6:amd64 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [armel]) +Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Conf amdboot:amd64 (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [armel]) +Conf libc6:amd64 (1.0 unstable [amd64]) +Conf libc6 (1.0 unstable [armel]) +Conf libc6-dev:amd64 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s -a amd64 + + -- cgit v1.2.3 From ae6ea526d65eb560b825677e8aac4a3fa15934e4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 27 Jul 2011 23:50:55 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - do not assume that the last char on a line is a \n (Closes: #633350) --- ...est-bug-633350-do-not-kill-last-char-in-Release | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/integration/test-bug-633350-do-not-kill-last-char-in-Release (limited to 'test') diff --git a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release new file mode 100755 index 000000000..3d3835507 --- /dev/null +++ b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release @@ -0,0 +1,27 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'cool' 'amd64' '1.0' + +setupaptarchive 2> /dev/null + +echo 'NotAutomatic: yes' >> aptarchive/dists/unstable/Release + +signreleasefiles +find aptarchive/dists -name 'InRelease' -delete + +rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt + +OUTPUT="$(aptget update 2>&1)" +msgtest 'Check that parsing happens without warnings' 'with missing newline' +if echo "${OUTPUT}" | grep '^W:' > /dev/null; then + msgfail + echo "${OUTPUT}" +else + msgpass +fi -- cgit v1.2.3