From 9b78cda6873104b80ffdbc8b5d3965575ce0a31d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 18:55:46 +0100 Subject: add a way to add packages to generate a dists style environment without actually building all these packages --- test/integration/framework | 70 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 2422f0886..5d849bda2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -307,6 +307,37 @@ buildaptftparchivedirectorystructure() { done } +insertpackage() { + local RELEASE="$1" + local NAME="$2" + local ARCH="$3" + local VERSION="$4" + local DEPENDENCIES="$5" + local ARCHS="$ARCH" + if [ "$ARCHS" = "all" ]; then + ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + fi + for BUILDARCH in $ARCHS; do + local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}" + mkdir -p $PPATH aptarchive/dists/${RELEASE}/main/source + touch aptarchive/dists/${RELEASE}/main/source/Sources + local FILE="${PPATH}/Packages" + echo "Package: $NAME +Priority: optional +Section: other +Installed-Size: 23356 +Maintainer: Joe Sixpack +Architecture: $ARCH +Version: $VERSION" >> $FILE + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + YOU did something horribly wrong! They are autogenerated + und used only by testcases for APT and surf no other propose… +" >> $FILE + done +} + buildaptarchivefromincoming() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on incoming packages…" cd aptarchive @@ -315,36 +346,33 @@ buildaptarchivefromincoming() { [ -e dists ] || buildaptftparchivedirectorystructure msgninfo "\tGenerate Packages, Sources and Contents files… " aptftparchive -qq generate ftparchive.conf - msgdone "info" - msgninfo "\tGenerate Release files… " - for dir in $(find ./dists -mindepth 1 -maxdepth 1 -type d); do - aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="$(echo "$dir" | cut -d'/' -f 3)" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference - done cd - > /dev/null msgdone "info" + generatereleasefiles } buildaptarchivefromfiles() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…" - cd aptarchive - if [ -f Packages ]; then - msgninfo "\tPackages file… " - cat Packages | gzip > Packages.gz - cat Packages | bzip2 > Packages.bz2 - cat Packages | lzma > Packages.lzma - msgdone "info" - fi - if [ -f Sources ]; then - msgninfo "\tSources file… " - cat Sources | gzip > Sources.gz - cat Sources | bzip2 > Sources.bz2 - cat Sources | lzma > Sources.lzma + find aptarchive -name 'Packages' -o -name 'Sources' | while read line; do + msgninfo "\t${line} file… " + cat ${line} | gzip > ${line}.gz + cat ${line} | bzip2 > ${line}.bz2 + cat ${line} | lzma > ${line}.lzma msgdone "info" + done + generatereleasefiles +} + +generatereleasefiles() { + msgninfo "\tGenerate Release files… " + if [ -e aptarchive/dists ]; then + for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do + aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="$(echo "$dir" | cut -d'/' -f 4)" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + done + else + aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference fi - msgninfo "\tRelease file… " - aptftparchive -qq release . | sed -e '/0 Release$/ d' > Release # remove the self reference msgdone "info" - cd .. } setupdistsaptarchive() { -- cgit v1.2.3 From 35faae110d5b0265fa2f8ea7f4e092b736161397 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 18:56:36 +0100 Subject: if the codename is "experimental" add NotAutomatic:yes by default --- test/integration/framework | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 5d849bda2..63962858a 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -367,7 +367,12 @@ generatereleasefiles() { msgninfo "\tGenerate Release files… " if [ -e aptarchive/dists ]; then for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do - aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="$(echo "$dir" | cut -d'/' -f 4)" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" + aptftparchive -qq release $dir -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference + if [ "$CODENAME" = "experimental" ]; then + sed -i '/^Date: / a\ +NotAutomatic: yes' $dir/Release + fi done else aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference -- cgit v1.2.3 From 898d27df204e3aadaba9692bcdcfbc50599801f9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:12:12 +0100 Subject: add a very simple testcase to ensure that the action modifiers are only interpreted if a package with this name doesn't exist: e.g. g++ --- .../Packages-bug-593360-modifiers-in-names | 42 ++++++++++++++ .../integration/test-bug-593360-modifiers-in-names | 64 ++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 test/integration/Packages-bug-593360-modifiers-in-names create mode 100755 test/integration/test-bug-593360-modifiers-in-names (limited to 'test') diff --git a/test/integration/Packages-bug-593360-modifiers-in-names b/test/integration/Packages-bug-593360-modifiers-in-names new file mode 100644 index 000000000..d2ac8d4e1 --- /dev/null +++ b/test/integration/Packages-bug-593360-modifiers-in-names @@ -0,0 +1,42 @@ +Package: g++ +Priority: optional +Section: devel +Installed-Size: 40 +Maintainer: Debian GCC Maintainers +Architecture: i386 +Source: gcc-defaults (1.96) +Version: 4:4.4.5-1 +Filename: pool/main/g/gcc-defaults/g++_4.4.5-1_i386.deb +Size: 1372 +MD5sum: 37e129a4b130e8b96a9b9d5b26a3fffa +SHA1: d98768d1547389a563e60433268143f42578c3e6 +SHA256: 18d933972392d233127bdd766cfcaaaa2e35f57de47c7af678d599be9613d562 +Description: The GNU C++ compiler + +Package: apt +Priority: important +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team +Architecture: all +Version: 0.8.8 +Filename: pool/main/a/apt/apt_0.8.8_i386.deb +Size: 2140632 +MD5sum: 4283aa3bb751253faf1b2204e0229e4f +SHA1: 59d432f56901faa86e814a436b8da010ee1c7b8a +SHA256: 072dcf4359dce9698aeaa54366eb20513f860c2bb6d44a95973c0b2ad413bfab +Description: Advanced front-end for dpkg + +Package: apt+ +Priority: important +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team +Architecture: all +Version: 0.8.8 +Filename: pool/main/a/apt/apt_0.8.8_i386.deb +Size: 2140632 +MD5sum: 4283aa3bb751253faf1b2204e0229e4f +SHA1: 59d432f56901faa86e814a436b8da010ee1c7b8a +SHA256: 072dcf4359dce9698aeaa54366eb20513f860c2bb6d44a95973c0b2ad413bfab +Description: Advanced front-end for dpkg diff --git a/test/integration/test-bug-593360-modifiers-in-names b/test/integration/test-bug-593360-modifiers-in-names new file mode 100755 index 000000000..c12503b0d --- /dev/null +++ b/test/integration/test-bug-593360-modifiers-in-names @@ -0,0 +1,64 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + g++ +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst g++ (4:4.4.5-1 localhost [i386]) +Conf g++ (4:4.4.5-1 localhost [i386])' aptget install g++ -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + g++ +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst g++ (4:4.4.5-1 localhost [i386]) +Conf g++ (4:4.4.5-1 localhost [i386])' aptget install g+++ -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + g++ +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst g++ (4:4.4.5-1 localhost [i386]) +Conf g++ (4:4.4.5-1 localhost [i386])' aptget purge g+++ -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + apt +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst apt (0.8.8 localhost [all]) +Conf apt (0.8.8 localhost [all])' aptget install apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + apt+ +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst apt+ (0.8.8 localhost [all]) +Conf apt+ (0.8.8 localhost [all])' aptget install apt+ -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + apt+ +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst apt+ (0.8.8 localhost [all]) +Conf apt+ (0.8.8 localhost [all])' aptget install apt++ -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + apt+ +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst apt+ (0.8.8 localhost [all]) +Conf apt+ (0.8.8 localhost [all])' aptget purge apt++ -s -- cgit v1.2.3 From f425d4d5d65b317b84fd56ea40f469ca008b7773 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:14:26 +0100 Subject: ensure that the build methods are used and not these on the system --- test/integration/framework | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 63962858a..bc427c544 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -116,6 +116,7 @@ setupenvironment() { echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf echo "Debug::NoLocking \"true\";" >> aptconfig.conf echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf + echo "Dir::Bin::Methods \"${BUILDDIRECTORY}/methods\";" >> aptconfig.conf echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf echo "DPKG::options:: \"dpkg\";" >> aptconfig.conf echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf -- cgit v1.2.3 From 0dc05bf095ebe2908f7d9096b3914b8c988c023e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:15:19 +0100 Subject: =?UTF-8?q?$!=20doesn't=20worked=20on=20the=20first=20try=20someho?= =?UTF-8?q?w,=20now=20it=20does=20and=20its=20(a=20lot)=20cleaner=20than?= =?UTF-8?q?=20using=20this=20ps=20"magic"=20as=20this=20fails=20now=20and?= =?UTF-8?q?=20then=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/integration/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index bc427c544..a0bad4170 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -445,7 +445,7 @@ signreleasefiles() { changetowebserver() { if which weborf > /dev/null; then weborf -xb aptarchive/ 2>&1 > /dev/null & - CURRENTTRAP="kill $(ps | grep weborf | sed -e 's#^[ ]*##' | cut -d' ' -f 1); $CURRENTTRAP" + CURRENTTRAP="kill $!; $CURRENTTRAP" trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM local APTARCHIVE="file://$(readlink -f ./aptarchive)" for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do -- cgit v1.2.3 From a02f24e046d58b723a9283211cb558605a024bdf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:22:29 +0100 Subject: show dependencies of essential packages which are going to remove only if they cause the remove of this essential (Closes: #601961) --- test/integration/status-bug-601961-install-info | 42 +++++++++++++++++++++++++ test/integration/test-bug-601961-install-info | 38 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 test/integration/status-bug-601961-install-info create mode 100755 test/integration/test-bug-601961-install-info (limited to 'test') diff --git a/test/integration/status-bug-601961-install-info b/test/integration/status-bug-601961-install-info new file mode 100644 index 000000000..c43cffab7 --- /dev/null +++ b/test/integration/status-bug-601961-install-info @@ -0,0 +1,42 @@ +Package: dpkg +Status: install ok installed +Essential: yes +Priority: required +Section: admin +Installed-Size: 6432 +Maintainer: Dpkg Developers +Architecture: i386 +Version: 1.15.8.5 +Description: Debian package management system + +Package: findutils +Status: install ok installed +Essential: yes +Priority: required +Section: utils +Installed-Size: 1704 +Maintainer: Andreas Metzler +Architecture: i386 +Version: 4.4.2-1+b1 +Depends: dpkg (>= 1.15.4) | install-info, essentialpkg +Description: utilities for finding files--find, xargs + +Package: install-info +Status: install ok installed +Priority: important +Section: doc +Installed-Size: 256 +Maintainer: Debian TeX maintainers +Architecture: i386 +Version: 4.13a.dfsg.1-6 +Description: Manage installed documentation in info format + +Package: essentialpkg +Status: install ok installed +Priority: important +Section: other +Installed-Size: 256 +Maintainer: Joe Sixpack +Architecture: i386 +Version: 4.13a.dfsg.1-6 +Description: ultra hypercool important package diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info new file mode 100755 index 000000000..b91bf3615 --- /dev/null +++ b/test/integration/test-bug-601961-install-info @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + findutils +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + findutils +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +After this operation, 1745 kB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation.' aptget remove findutils --trivial-only + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + install-info +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +After this operation, 262 kB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation.' aptget remove install-info --trivial-only + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + essentialpkg findutils +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + findutils essentialpkg (due to findutils) +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +After this operation, 2007 kB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation.' aptget remove essentialpkg --trivial-only -- cgit v1.2.3 From ceabaaa1f96eeb433a0530dc8f9d590bc57aa161 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:22:54 +0100 Subject: add usage info for create-test-data script --- test/integration/create-test-data | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/integration/create-test-data b/test/integration/create-test-data index ff9405502..b93218b7c 100755 --- a/test/integration/create-test-data +++ b/test/integration/create-test-data @@ -1,6 +1,11 @@ #!/bin/sh set +e # its okay to fail in these script, most of the time the apt* stuff will generate errors +if [ -z "$1" -o -z "$2" ]; then + echo "Usage: $0 file codename pkg…" + exit 1 +fi + local TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework BUILDDIRECTORY="${TESTDIR}/../../build/bin" @@ -16,6 +21,11 @@ TMPGEN=$WORKDIR/Packages export LANG=C LISTOFPKGS=$(aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0 2> /dev/null | awk '/^Inst/ {print $2}' | sed -e "s#\$#/$CODENAME#") +if [ -z "$LISTOFPKGS" ]; then + echo "List of packages is empty: run apt-get install command again for you now" + aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0 + exit 1 +fi aptcache show $LISTOFPKGS --no-all-versions 2> /dev/null > $TMPGEN sed -i $TMPGEN \ -e '/^ / d' \ -- cgit v1.2.3 From b6b5a542bd5a2580fff3d3ec2ce91a41e9622d6d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:23:54 +0100 Subject: add framework code to run the installed aptitude with the current build library in the test environment --- test/integration/framework | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index a0bad4170..8abefc814 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -78,6 +78,15 @@ aptkey() { runapt apt-key $*; } dpkg() { $(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $* } +aptitude() { + if [ -f ./aptconfig.conf ]; then + APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + elif [ -f ../aptconfig.conf ]; then + APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + else + LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which aptitude) $* + fi +} setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) -- cgit v1.2.3 From 4a4ea26c2d0f89c13e0ccf6fb2d96ad1caa6427d Mon Sep 17 00:00:00 2001 From: Andres Mejia Date: Tue, 30 Nov 2010 19:25:39 +0100 Subject: Add support for providing and autocopying Sources files along the way of status and Packages files with a testcase --- test/integration/framework | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 8abefc814..7af59deb0 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -119,6 +119,12 @@ setupenvironment() { else touch aptarchive/Packages fi + local SOURCESSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Sources-/' -e 's/^skip-/Sources-/') + if [ -f "${TESTDIR}/${SOURCESSFILE}" ]; then + cp "${TESTDIR}/${SOURCESSFILE}" aptarchive/Sources + else + touch aptarchive/Sources + fi cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/ ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf -- cgit v1.2.3 From db4b5f77e1f9f64a54baeff74c0400f0134c1d0d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 19:29:22 +0100 Subject: do not touch Packages and Sources in the framework if the files do not exist to not generate sources.list entries later for them --- test/integration/framework | 4 ---- test/integration/test-bug-595691-empty-and-broken-archive-files | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 7af59deb0..aa8cdacc6 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -116,14 +116,10 @@ setupenvironment() { local PACKAGESFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Packages-/' -e 's/^skip-/Packages-/') if [ -f "${TESTDIR}/${PACKAGESFILE}" ]; then cp "${TESTDIR}/${PACKAGESFILE}" aptarchive/Packages - else - touch aptarchive/Packages fi local SOURCESSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Sources-/' -e 's/^skip-/Sources-/') if [ -f "${TESTDIR}/${SOURCESSFILE}" ]; then cp "${TESTDIR}/${SOURCESSFILE}" aptarchive/Sources - else - touch aptarchive/Sources fi cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/ ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg 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 11a5025d2..66792899a 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -7,6 +7,7 @@ setupenvironment configarchitecture "i386" buildaptarchive +touch aptarchive/Packages setupflataptarchive testaptgetupdate() { -- cgit v1.2.3 From a8dfff90aa740889eb99d00fde5d70908d9fd88a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Dec 2010 14:02:29 +0100 Subject: keep not installed garbage packages uninstalled instead of showing in the autoremove section and installing those (Closes: #604222) --- .../Packages-bug-604222-new-and-autoremove | 68 ++++++++++++++++++++++ .../status-bug-604222-new-and-autoremove | 10 ++++ .../integration/test-bug-604222-new-and-autoremove | 66 +++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 test/integration/Packages-bug-604222-new-and-autoremove create mode 100644 test/integration/status-bug-604222-new-and-autoremove create mode 100755 test/integration/test-bug-604222-new-and-autoremove (limited to 'test') diff --git a/test/integration/Packages-bug-604222-new-and-autoremove b/test/integration/Packages-bug-604222-new-and-autoremove new file mode 100644 index 000000000..fdff9d702 --- /dev/null +++ b/test/integration/Packages-bug-604222-new-and-autoremove @@ -0,0 +1,68 @@ +Package: dummy-archive +Priority: extra +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team +Architecture: i386 +Version: 0.invalid.0 +Source: dummy-archive +Depends: libavcodec52, libvtk5-dev | libopenal-dev +Filename: pool/main/d/dummy/dummy_5.4.2-8_i386.deb +Size: 2280898 +MD5sum: 569719746f7ec4b96209a6152af20c00 +Description: some dummy package + +Package: libvtk5-dev +Priority: optional +Section: libdevel +Installed-Size: 13812 +Maintainer: A. Maitland Bottoms +Architecture: i386 +Source: vtk +Version: 5.4.2-8 +Depends: libvtk5.4 (= 5.4.2-8) +Filename: pool/main/v/vtk/libvtk5-dev_5.4.2-8_i386.deb +Size: 2280898 +MD5sum: 569719746f7ec4b96209a6152af20c00 +Description: VTK header files for building C++ code + +Package: libvtk5.4 +Priority: optional +Section: libs +Installed-Size: 39372 +Maintainer: A. Maitland Bottoms +Architecture: i386 +Source: vtk +Version: 5.4.2-8 +Depends: libavcodec52 (>= 4:0.5.1-1) +Filename: pool/main/v/vtk/libvtk5.4_5.4.2-8_i386.deb +Size: 13070848 +MD5sum: 3ba7abc3d58ec44e35ae71879406563d +Description: Visualization Toolkit - A high level 3D visualization library + +Package: libopenal-dev +Priority: optional +Section: libdevel +Installed-Size: 140 +Maintainer: Debian Games Team +Architecture: i386 +Source: openal-soft +Version: 1:1.12.854-2 +Filename: pool/main/o/openal-soft/libopenal-dev_1.12.854-2_i386.deb +Size: 21014 +MD5sum: e0bda4fbf5a3d38ef510a23a1642587f +Description-de: Software-Implementierung der OpenAL-API (Entwicklungsdateien) + +Package: libavcodec52 +Priority: optional +Section: libs +Installed-Size: 10772 +Maintainer: Debian multimedia packages maintainers +Architecture: i386 +Source: ffmpeg +Version: 4:0.5.2-6 +Conflicts: libvtk5-dev +Filename: pool/main/f/ffmpeg/libavcodec52_0.5.2-6_i386.deb +Size: 4001600 +MD5sum: a50aae4c8e8b9dd29612407e61bedc22 +Description-de: Ffmpeg-Codec-Bibliothek diff --git a/test/integration/status-bug-604222-new-and-autoremove b/test/integration/status-bug-604222-new-and-autoremove new file mode 100644 index 000000000..03cf4d307 --- /dev/null +++ b/test/integration/status-bug-604222-new-and-autoremove @@ -0,0 +1,10 @@ +Package: libvtk5.4 +Status: install ok installed +Priority: optional +Section: libs +Installed-Size: 39372 +Maintainer: A. Maitland Bottoms +Architecture: i386 +Source: vtk +Version: 5.4.2-7 +Description: Visualization Toolkit - A high level 3D visualization library diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove new file mode 100755 index 000000000..fa6dcdc70 --- /dev/null +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +echo 'Package: libvtk5.4 +Auto-Installed: 1 +Architecture: i386' > rootdir/var/lib/apt/extended_states + +testequal "Reading package lists... +Building dependency tree... +Reading state information... +The following package was automatically installed and is no longer required: + libvtk5.4 +Use 'apt-get autoremove' to remove them. +The following NEW packages will be installed: + libavcodec52 +0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Inst libavcodec52 (4:0.5.2-6 localhost [i386]) +Conf libavcodec52 (4:0.5.2-6 localhost [i386])" aptget install libavcodec52 -s + +testequal "Reading package lists... +Building dependency tree... +Reading state information... +The following package was automatically installed and is no longer required: + libvtk5.4 +Use 'apt-get autoremove' to remove them. +The following extra packages will be installed: + libavcodec52 libopenal-dev libvtk5.4 +The following NEW packages will be installed: + dummy-archive libavcodec52 libopenal-dev +The following packages will be upgraded: + libvtk5.4 +1 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/19.4 MB of archives. +After this operation, 17.3 MB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only + +echo -n > rootdir/var/lib/dpkg/status +rm rootdir/var/lib/apt/extended_states + +CONFLICTING='Reading package lists... +Building dependency tree... + MarkInstall dummy-archive [ i386 ] < none -> 0.invalid.0 > ( admin ) FU=1 + MarkInstall libavcodec52 [ i386 ] < none -> 4:0.5.2-6 > ( libs ) FU=0 + MarkInstall libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0 + MarkInstall libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=0 + MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0 + MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0 + MarkDelete libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=1 +The following extra packages will be installed: + libavcodec52 libopenal-dev +The following NEW packages will be installed: + dummy-archive libavcodec52 libopenal-dev +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/6304 kB of archives. +After this operation, 17.3 MB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' + +testequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=0 +testequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=1 +testequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=small -- cgit v1.2.3 From 2c085486d34c45e123c24b0e36294245fd5bf734 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Dec 2010 17:06:34 +0100 Subject: * apt-pkg/depcache.cc: - add SetCandidateRelease() to set a candidate version and the candidates of dependencies if needed to a specified release (Closes: #572709) - change pkg/release behavior to use the new SetCandidateRelease so installing packages from experimental or backports is easier --- test/integration/framework | 10 +- test/integration/test-release-candidate-switching | 435 ++++++++++++++++++++++ 2 files changed, 441 insertions(+), 4 deletions(-) create mode 100755 test/integration/test-release-candidate-switching (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index aa8cdacc6..4bbe1b408 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -134,6 +134,7 @@ setupenvironment() { echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf + echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C msgdone "info" } @@ -337,10 +338,11 @@ insertpackage() { echo "Package: $NAME Priority: optional Section: other -Installed-Size: 23356 +Installed-Size: 42 Maintainer: Joe Sixpack Architecture: $ARCH -Version: $VERSION" >> $FILE +Version: $VERSION +Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} If you find such a package installed on your system, @@ -380,8 +382,8 @@ generatereleasefiles() { if [ -e aptarchive/dists ]; then 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::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference - if [ "$CODENAME" = "experimental" ]; then + 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 sed -i '/^Date: / a\ NotAutomatic: yes' $dir/Release fi diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching new file mode 100755 index 000000000..ea601ae8b --- /dev/null +++ b/test/integration/test-release-candidate-switching @@ -0,0 +1,435 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'libc6' 'i386' '2.11.2-7+sid' +insertpackage 'unstable' 'phonon-backend-xine' 'i386' '4:4.6.0really4.4.2-1+sid' 'Provides: phonon-backend' +insertpackage 'unstable' 'phonon-backend-xine2' 'i386' '4:4.6.0really4.4.2-1+sid' +insertpackage 'unstable' 'phonon-backend-xine3' 'i386' '4:4.6.0really4.4.2-1+sid' +insertpackage 'unstable' 'phonon-backend-xine4' 'i386' '4:4.6.0really4.4.2-1+sid' +insertpackage 'unstable' 'phonon-backend-null' 'i386' '4:4.20.0+sid' 'Provides: phonon-backend' +insertpackage 'unstable' 'intermediatepkg' 'all' '1.0' + +insertpackage 'unstable' 'amarok-common' 'all' '2.3.1-1+sid' +insertpackage 'unstable' 'amarok-utils' 'i386' '2.3.1-1+sid' +insertpackage 'unstable' 'libmtp8' 'i386' '0.3.1+sid' +insertpackage 'unstable' 'amarok' 'i386' '2.3.1-1+sid' 'Depends: amarok-common (= 2.3.1-1+sid), amarok-utils (= 2.3.1-1+sid), phonon-backend-xine | phonon-backend, libmtp8 (>= 0.3.1), libc6' + +insertpackage 'experimental' 'amarok-common' 'all' '2.3.2-2+exp' +insertpackage 'experimental' 'amarok-utils' 'i386' '2.3.2-2+exp' +insertpackage 'experimental' 'libmtp8' 'i386' '0.3.3+exp' +insertpackage 'experimental' 'phonon-backend-xine' 'i386' '5:4.6.0+exp' 'Provides: phonon-backend' +insertpackage 'experimental' 'phonon-backend-xine2' 'i386' '5:4.6.0+exp' 'Depends: uninstallablepkg +Provides: phonon-backend-broken' +insertpackage 'experimental' 'phonon-backend-xine3' 'i386' '5:4.6.0+exp' 'Depends: intermediatepkg (>= 1.5)' +insertpackage 'experimental' 'phonon-backend-xine4' 'i386' '5:4.6.0+exp' 'Depends: intermediateuninstallablepkg (= 2.0) +Provides: phonon-backend-broken' +insertpackage 'experimental' 'intermediatepkg' 'all' '2.0' 'Depends: libc6' +insertpackage 'experimental' 'intermediateuninstallablepkg' 'all' '2.0' 'Depends: uninstallablepkg' +insertpackage 'experimental' 'phonon-backend-null' 'i386' '5:4.20.0+exp' 'Provides: phonon-backend' +insertpackage 'experimental' 'amarok' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), amarok-utils (= 2.3.2-2+exp), phonon-backend-xine | phonon-backend, libmtp8 (>= 0.3.1), libc6' + +insertpackage 'experimental2' 'phonon-backend-xine' 'i386' '5:4.00.0+exp' 'Provides: phonon-backend' +insertpackage 'experimental2' 'amarok-less' 'i386' '2.3.2-2+exp' 'Depends: amarok-common, phonon-backend-xine (>= 5:4.00.0+exp), libmtp8, libc6, amarok-utils' +insertpackage 'experimental' 'amarok-higher' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine (>= 5:4.6.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' + +insertpackage 'experimental' 'amarok-null' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine (= 1:1.0-1) | phonon-backend, libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-null2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-null (= 1:1.0-1) | phonon-backend, libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-null2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-null (= 1:1.0-1) | phonon-backend, libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-xine' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-xine2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine2 (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-xine3' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine3 (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-xine4' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine4 (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' +insertpackage 'experimental' 'amarok-broken' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-broken | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' + +insertpackage 'experimental' 'amarok-recommends' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp) +Recommends: amarok-utils (= 2.3.2-2+exp), phonon-backend-xine | phonon-backend, libmtp8 (>= 0.3.1), libc6' +insertpackage 'experimental' 'amarok-recommends2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp) +Recommends: amarok-utils (= 2.30.2-2+exp), phonon-backend-xine | phonon-backend, libmtp8 (>= 0.3.1), libc6' + +insertpackage 'experimental' 'uninstallablepkg' 'all' '1.0' 'Depends: libmtp8 (>= 10:0.20.1), amarok-utils (= 2.3.2-2+exp)' + +setupaptarchive + +testequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + amarok-common (2.3.1-1+sid) + amarok-utils (2.3.1-1+sid) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +The following NEW packages will be installed: + amarok (2.3.1-1+sid) + amarok-common (2.3.1-1+sid) + amarok-utils (2.3.1-1+sid) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok --trivial-only -V -q=0 + +testequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.3+exp) + phonon-backend-xine (4.6.0+exp) +The following NEW packages will be installed: + amarok (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.3+exp) + phonon-backend-xine (4.6.0+exp) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok -t experimental --trivial-only -V -q=0 + +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' +The following extra packages will be installed: + amarok (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +The following NEW packages will be installed: + amarok (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok/experimental --trivial-only -V -q=0 + +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-null' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-null (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+sid) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-null (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+sid) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-null/experimental --trivial-only -V -q=0 + +# do not select the same version multiple times +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' +The following extra packages will be installed: + amarok (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-null (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +The following NEW packages will be installed: + amarok (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-null (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded. +After this operation, 301 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok/experimental amarok-null/experimental --trivial-only -V -q=0 + +# … but thighten the version if needed +# in theory, the second line is wrong, but printing the right version is too much of a hassle +# (we have to check if later in the Changed list is another change and if so use this version +# instead of the current candidate) - and it wouldn't be (really) useful anyway… +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental2 [i386]) for 'amarok-less' +Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-less' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-higher' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-higher' +Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-higher' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-higher' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-higher (2.3.2-2+exp) + amarok-less (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0+exp) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-higher (2.3.2-2+exp) + amarok-less (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0+exp) +0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded. +After this operation, 301 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-less/experimental2 amarok-higher/experimental --trivial-only -V -q=0 + +# phonon-backend-null can't be used directly, but as it provides it is still fine… +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null2' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-null2' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null2' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-null2 (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+sid) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-null2 (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+sid) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-null2/experimental --trivial-only -V -q=0 + +# if an or-group satisfier is already found, do not set others +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine' +Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-xine' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0+exp) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0+exp) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-xine/experimental --trivial-only -V -q=0 + +# … but proceed testing if the first doesn't work out +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine2' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine2' +Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-xine2' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine2' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine2 (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+exp) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine2 (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+exp) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-xine2/experimental --trivial-only -V -q=0 + +# sometimes, the second level need to be corrected, too +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine3' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine3' +Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine3' because of 'amarok-xine3' +Selected version '2.0' (experimental [all]) for 'intermediatepkg' because of 'phonon-backend-xine3' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine3' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine3 (2.3.2-2+exp) + intermediatepkg (2.0) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine3 (4.6.0+exp) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine3 (2.3.2-2+exp) + intermediatepkg (2.0) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine3 (4.6.0+exp) +0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded. +After this operation, 301 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-xine3/experimental --trivial-only -V -q=0 + +# … but proceed testing if the first doesn't work out even in second deep +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine4' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine4' +Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-xine4' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine4' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine4 (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+exp) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + amarok-xine4 (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+exp) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-xine4/experimental --trivial-only -V -q=0 + +# providers can be broken, too +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-broken' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-broken' +Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-broken' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-broken' +The following extra packages will be installed: + amarok-broken (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+exp) +The following NEW packages will be installed: + amarok-broken (2.3.2-2+exp) + amarok-common (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-null (4.20.0+exp) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-broken/experimental --trivial-only -V -q=0 + +# switch the candidate for recommends too if they should be installed +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-recommends' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-recommends (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-recommends (2.3.2-2+exp) + amarok-utils (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. +After this operation, 258 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-recommends/experimental --trivial-only -V -q=0 -o APT::Install-Recommends=1 + +# … or not if not +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-recommends (2.3.2-2+exp) +Recommended packages: + amarok-utils (2.3.1-1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) + phonon-backend () + libmtp8 (0.3.1+sid) + libc6 (2.11.2-7+sid) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-recommends (2.3.2-2+exp) +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +After this operation, 86.0 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-recommends/experimental --trivial-only -V -q=0 -o APT::Install-Recommends=0 + +# but broken recommends are not the end of the world +# FIXME: the version output for recommend packages is a bit strange… but what would be better? +testequal "Reading package lists... +Building dependency tree... +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends2' +Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends2' +The following extra packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-recommends2 (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +Recommended packages: + amarok-utils (2.3.1-1+sid) +The following NEW packages will be installed: + amarok-common (2.3.2-2+exp) + amarok-recommends2 (2.3.2-2+exp) + libc6 (2.11.2-7+sid) + libmtp8 (0.3.1+sid) + phonon-backend-xine (4.6.0really4.4.2-1+sid) +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +After this operation, 215 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install amarok-recommends2/experimental --trivial-only -V -q=0 -o APT::Install-Recommends=1 + +# if one depends doesn't work, we don't need to look deeper… +testequal "Reading package lists... +Building dependency tree... +Selected version '1.0' (experimental [all]) for 'uninstallablepkg' +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + uninstallablepkg : Depends: libmtp8 (>= 10:0.20.1) but it is not going to be installed + Depends: amarok-utils (= 2.3.2-2+exp) but 2.3.1-1+sid is to be installed +E: Broken packages" aptget install uninstallablepkg/experimental --trivial-only -V -q=0 -- cgit v1.2.3 From 6a2512be4addf9a874cc72c40d1ec56206fdd2fb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Dec 2010 18:05:52 +0100 Subject: really do not show packages in the extra section if they were requested on the commandline, e.g. with a modifier --- test/integration/test-release-candidate-switching | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'test') diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index ea601ae8b..5736945ab 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -39,7 +39,6 @@ insertpackage 'experimental' 'amarok-higher' 'i386' '2.3.2-2+exp' 'Depends: amar insertpackage 'experimental' 'amarok-null' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine (= 1:1.0-1) | phonon-backend, libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' insertpackage 'experimental' 'amarok-null2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-null (= 1:1.0-1) | phonon-backend, libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' -insertpackage 'experimental' 'amarok-null2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-null (= 1:1.0-1) | phonon-backend, libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' insertpackage 'experimental' 'amarok-xine' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' insertpackage 'experimental' 'amarok-xine2' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine2 (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' insertpackage 'experimental' 'amarok-xine3' 'i386' '2.3.2-2+exp' 'Depends: amarok-common (= 2.3.2-2+exp), phonon-backend-xine3 (= 5:4.6.0+exp) | phonon-backend-null (= 5:4.20.0+exp), libmtp8 (>= 0.3.1), libc6, amarok-utils (= 2.3.2-2+exp)' @@ -99,7 +98,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' The following extra packages will be installed: - amarok (2.3.2-2+exp) amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -123,7 +121,6 @@ Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null' The following extra packages will be installed: amarok-common (2.3.2-2+exp) - amarok-null (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) @@ -147,9 +144,7 @@ Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' The following extra packages will be installed: - amarok (2.3.2-2+exp) amarok-common (2.3.2-2+exp) - amarok-null (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) @@ -180,8 +175,6 @@ Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' b Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-higher' The following extra packages will be installed: amarok-common (2.3.2-2+exp) - amarok-higher (2.3.2-2+exp) - amarok-less (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) @@ -206,7 +199,6 @@ Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null2' The following extra packages will be installed: amarok-common (2.3.2-2+exp) - amarok-null2 (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) @@ -232,7 +224,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because The following extra packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) - amarok-xine (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) phonon-backend-xine (4.6.0+exp) @@ -257,7 +248,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because The following extra packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) - amarok-xine2 (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) phonon-backend-null (4.20.0+exp) @@ -283,7 +273,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because The following extra packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) - amarok-xine3 (2.3.2-2+exp) intermediatepkg (2.0) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) @@ -310,7 +299,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because The following extra packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) - amarok-xine4 (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) phonon-backend-null (4.20.0+exp) @@ -333,7 +321,6 @@ Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-broken' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-broken' The following extra packages will be installed: - amarok-broken (2.3.2-2+exp) amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -358,7 +345,6 @@ Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-recommends' The following extra packages will be installed: amarok-common (2.3.2-2+exp) - amarok-recommends (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) @@ -381,7 +367,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' The following extra packages will be installed: amarok-common (2.3.2-2+exp) - amarok-recommends (2.3.2-2+exp) Recommended packages: amarok-utils (2.3.1-1+sid) phonon-backend-xine (4.6.0really4.4.2-1+sid) @@ -403,7 +388,6 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends2' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends2' The following extra packages will be installed: amarok-common (2.3.2-2+exp) - amarok-recommends2 (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) phonon-backend-xine (4.6.0really4.4.2-1+sid) -- cgit v1.2.3 From b99d5aeff24b0b8477e5699ce391bfd63478d742 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 5 Dec 2010 12:46:56 +0100 Subject: experimental is an incomplete archive, so try to get the packages which could not be installed from experimental from unstable instead --- test/integration/create-test-data | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/create-test-data b/test/integration/create-test-data index b93218b7c..581b62910 100755 --- a/test/integration/create-test-data +++ b/test/integration/create-test-data @@ -26,7 +26,7 @@ if [ -z "$LISTOFPKGS" ]; then aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0 exit 1 fi -aptcache show $LISTOFPKGS --no-all-versions 2> /dev/null > $TMPGEN +aptcache show $LISTOFPKGS --no-all-versions 2> $WORKDIR/error.lst > $TMPGEN sed -i $TMPGEN \ -e '/^ / d' \ -e '/^SHA1: / d' -e '/^SHA256: / d' \ @@ -34,6 +34,10 @@ sed -i $TMPGEN \ -e '/^Xul-Appid: / d' \ -e '/^Status: / d' +if [ "$CODENAME" = "experimental" ]; then + aptcache show $(cat $WORKDIR/error.lst | cut -d"'" -f 4 | sed -e 's#$#/sid#') --no-all-versions 2> /dev/null >> $TMPGEN +fi + if echo "$GENERATE" | grep '^status-' > /dev/null; then sed -i $TMPGEN -e '/^Package: / a\ Status: install ok installed' \ -- cgit v1.2.3 From 36f1098aed548651a32a2c15cc9ad80c4330b4d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 12 Jan 2011 17:09:04 +0100 Subject: * apt-pkg/contrib/fileutl.cc: - add a RealFileExists method and check that your configuration files are real files to avoid endless loops if not (Closes: #604401) --- .../test-bug-604401-files-are-directories | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 test/integration/test-bug-604401-files-are-directories (limited to 'test') diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories new file mode 100755 index 000000000..917fb106f --- /dev/null +++ b/test/integration/test-bug-604401-files-are-directories @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/apt/apt.conf.d/000move-away-apt.conf + +msgtest "Directory instead of a file as apt.conf ignored" +mkdir -p rootdir/etc/apt/apt.conf +aptconfig dump > /dev/null && msgpass || msgfail +rmdir rootdir/etc/apt/apt.conf + +msgtest "Good link instead of a file as apt.conf ignored" +echo 'Test::APT::Link "good";' > rootdir/etc/apt/good-link.conf +ln -s rootdir/etc/apt/good-link.conf rootdir/etc/apt/apt.conf +test -n "$(aptconfig shell TestLink 'Test::APT::Link')" && msgfail || msgpass +rm rootdir/etc/apt/apt.conf + +msgtest "Broken link instead of a file as apt.conf ignored" +ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf +aptconfig dump > /dev/null && msgpass || msgfail +rm rootdir/etc/apt/apt.conf + + +test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdir/etc/apt/sources.list.d/000move-away-sources.list + +msgtest "Directory instead of a file as sources.list ignored" +mkdir -p rootdir/etc/apt/sources.list +aptget update --print-uris 2> /dev/null && msgpass || msgfail +rmdir rootdir/etc/apt/sources.list + +msgtest "Good link instead of a file as sources.list ignored" +echo 'deb file:///tmp/debian sid main' > rootdir/etc/apt/good-link.list +ln -s rootdir/etc/apt/good-link.list rootdir/etc/apt/sources.list +test -n "$(aptget update --print-uris)" && msgfail || msgpass +rm rootdir/etc/apt/sources.list + +msgtest "Broken link instead of a file as sources.list ignored" +ln -s /tmp/doesnt-exist rootdir/etc/apt/sources.list +test -n "$(aptget update --print-uris)" && msgfail || msgpass +rm rootdir/etc/apt/sources.list + + +test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/etc/apt/preferences.d/000move-away-preferences + +msgtest "Directory instead of a file as preferences ignored" +mkdir -p rootdir/etc/apt/preferences +aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +rmdir rootdir/etc/apt/preferences + +msgtest "Good link instead of a file as preferences ignored" +echo 'Package: apt +Pin: release a=now +Pin-Value: 1000' > rootdir/etc/apt/good-link.pref +ln -s rootdir/etc/apt/good-link.pref rootdir/etc/apt/preferences +test -n "$(aptcache policy | grep 1000)" && msgfail || msgpass +rm rootdir/etc/apt/preferences + +msgtest "Broken link instead of a file as preferences ignored" +ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences +aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +rm rootdir/etc/apt/preferences -- cgit v1.2.3 From c55b8a54780c4db6a5fa270ddd2d05ab837f6ffb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 13 Jan 2011 17:16:11 +0100 Subject: * apt-pkg/cacheiterator.h: - do not segfault if cache is not build (Closes: #254770) --- ...test-bug-254770-segfault-if-cache-not-buildable | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 test/integration/test-bug-254770-segfault-if-cache-not-buildable (limited to 'test') diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable new file mode 100755 index 000000000..25c564daa --- /dev/null +++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable @@ -0,0 +1,57 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +CURRENTTRAP="chmod a+x rootdir/var/lib/dpkg; $CURRENTTRAP" +trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +chmod a-x rootdir/var/lib/dpkg + +testsegfault() { + rm -f rootdir/var/cache/apt/*.bin + msgtest "No segfault in" "$*" + local TEST="$($* 2>&1 | grep -v 'E:')" + if [ -z "$TEST" ]; then + msgpass + else + echo + echo $TEST + msgfail + fi +} + +echo 'quiet 2;' > rootdir/etc/apt/apt.conf.d/00be-quiet + +testsegfault aptcache gencaches +testsegfault aptcache showpkg +testsegfault aptcache showsrc +testsegfault aptcache stats +testsegfault aptcache dump +testsegfault aptcache dumpavail +testsegfault aptcache unmet +testsegfault aptcache search +testsegfault aptcache show apt +testsegfault aptcache depends apt +testsegfault aptcache rdepends apt +testsegfault aptcache pkgnames apt +testsegfault aptcache dotty apt +testsegfault aptcache xvcg apt +testsegfault aptcache policy apt + +testsegfault aptget update +testsegfault aptget upgrade +testsegfault aptget dselect-upgrade +testsegfault aptget dist-upgrade +testsegfault aptget install apt +testsegfault aptget remove apt +testsegfault aptget purge apt +testsegfault aptget source apt +testsegfault aptget build-dep apt +testsegfault aptget check +testsegfault aptget clean +testsegfault aptget autoclean +testsegfault aptget autoremove -- cgit v1.2.3 From 491058e3570ec66769c4e7e9797f549c6d724848 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 13 Jan 2011 23:22:17 +0100 Subject: ignore non-regular files in GetListOfFilesInDir (Closes: #594694) --- test/libapt/run-tests | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/libapt/run-tests b/test/libapt/run-tests index f5fc03446..a66de386d 100755 --- a/test/libapt/run-tests +++ b/test/libapt/run-tests @@ -39,6 +39,11 @@ do "${tmppath}/invälid.conf" \ "${tmppath}/invalíd" \ "${tmppath}/01invalíd" + mkdir "${tmppath}/invaliddir" \ + "${tmppath}/directory.conf" \ + "${tmppath}/directory.list" \ + "${tmppath}/directory.wron" \ + "${tmppath}/directory.list.disabled" ln -s "${tmppath}/anormalfile" "${tmppath}/linkedfile.list" ln -s "${tmppath}/non-existing-file" "${tmppath}/brokenlink.list" elif [ $name = "getLanguages${EXT}" ]; then -- cgit v1.2.3 From cbd5fc0a6c666768ab8a127b9caabc6ee7a95b64 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 14 Jan 2011 00:48:33 +0100 Subject: Add a testcase to verify that packages which are held back by dpkg are not causing installation/removal of other packages (#64141) --- ...ages-bug-64141-install-dependencies-for-on-hold | 42 ++++++++++++++++++++++ ...atus-bug-64141-install-dependencies-for-on-hold | 33 +++++++++++++++++ ...test-bug-64141-install-dependencies-for-on-hold | 34 ++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 test/integration/Packages-bug-64141-install-dependencies-for-on-hold create mode 100644 test/integration/status-bug-64141-install-dependencies-for-on-hold create mode 100755 test/integration/test-bug-64141-install-dependencies-for-on-hold (limited to 'test') diff --git a/test/integration/Packages-bug-64141-install-dependencies-for-on-hold b/test/integration/Packages-bug-64141-install-dependencies-for-on-hold new file mode 100644 index 000000000..7005fa4f4 --- /dev/null +++ b/test/integration/Packages-bug-64141-install-dependencies-for-on-hold @@ -0,0 +1,42 @@ +Package: apt +Priority: important +Section: admin +Installed-Size: 6048 +Maintainer: APT Development Team +Architecture: i386 +Version: 0.8.10 +Provides: libapt-pkg4.10 +Depends: libc6 (>= 2.10), libdb4.8 +Breaks: oldcrap +Filename: pool/main/a/apt/apt_0.8.10_i386.deb +Size: 2160758 +MD5sum: 5aa2234f7b91056d430669cddf6e6e50 +Description: Advanced front-end for dpkg + +Package: libc6 +Priority: required +Section: libs +Installed-Size: 9356 +Maintainer: GNU Libc Maintainers +Architecture: i386 +Source: eglibc +Version: 2.11.2-7 +Provides: glibc-2.11-1 +Filename: pool/main/e/eglibc/libc6_2.11.2-7_i386.deb +Size: 3880868 +MD5sum: c48fd2854fc62125824267d086600793 +Description: Embedded GNU C Library: Shared libraries + +Package: libdb4.8 +Priority: standard +Section: libs +Installed-Size: 1488 +Maintainer: Clint Adams +Architecture: i386 +Source: db4.8 +Version: 4.8.30-3 +Depends: libc6 (>= 2.3.6-6~) +Filename: pool/main/d/db4.8/libdb4.8_4.8.30-3_i386.deb +Size: 681988 +MD5sum: 0d58c15898a95436d2ec480aa22693ff +Description: Berkeley v4.8 Database Libraries [runtime] diff --git a/test/integration/status-bug-64141-install-dependencies-for-on-hold b/test/integration/status-bug-64141-install-dependencies-for-on-hold new file mode 100644 index 000000000..c82ebd19c --- /dev/null +++ b/test/integration/status-bug-64141-install-dependencies-for-on-hold @@ -0,0 +1,33 @@ +Package: apt +Status: install ok installed +Priority: important +Section: admin +Installed-Size: 6048 +Maintainer: APT Development Team +Architecture: i386 +Version: 0.8.9 +Provides: libapt-pkg4.10 +Depends: libc6 (>= 2.3.4) +Description: Advanced front-end for dpkg + +Package: libc6 +Status: install ok installed +Priority: required +Section: libs +Installed-Size: 9356 +Maintainer: GNU Libc Maintainers +Architecture: i386 +Source: eglibc +Version: 2.3.5-7 +Provides: glibc-2.11-1 +Description: Embedded GNU C Library: Shared libraries + +Package: oldcrap +Status: install ok installed +Priority: extra +Section: oldlibs +Installed-Size: 1 +Maintainer: Joe Sixpack +Architecture: all +Version: 1-1 +Description: Old crappy nothing package diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold new file mode 100755 index 000000000..4633ffcc3 --- /dev/null +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + oldcrap +The following NEW packages will be installed: + libdb4.8 +The following packages will be upgraded: + apt libc6 +2 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Need to get 0 B/6724 kB of archives. +After this operation, 1523 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only + +echo 'apt hold' | dpkg --set-selections + +testequal 'Reading package lists... +Building dependency tree... +The following packages have been kept back: + apt +The following packages will be upgraded: + libc6 +1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +Need to get 0 B/3881 kB of archives. +After this operation, 0 B of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only -o Test='hold-back-apt' -- cgit v1.2.3 From caffd4807f612e931ecca8f7d9b0c0c10de27ce6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 15 Jan 2011 20:28:03 +0100 Subject: * methods/rred.cc: - operate optional on gzip compressed pdiffs * apt-pkg/acquire-item.cc: - don't uncompress downloaded pdiff files before feeding it to rred --- test/integration/test-pdiff-usage | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index a70b6122c..eb1818bcd 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -44,6 +44,7 @@ sed -i aptarchive/Release \ -e "/^SHA256:/ a\ \ $(sha256sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" signreleasefiles +rm -f aptarchive/Packages aptarchive/Packages.gz aptarchive/Packages.bz2 aptarchive/Packages.lzma aptget update -qq testnopackage oldstuff -- cgit v1.2.3 From 39cc82288036a005226564fadd05ef19ef0037bb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 16 Jan 2011 13:33:24 +0100 Subject: implement i quiet run-tests mode which prints only one line per testcase --- test/integration/framework | 4 ++++ test/integration/run-tests | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 4bbe1b408..5d54e49b6 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -39,6 +39,10 @@ fi if [ $MSGLEVEL -le 2 ]; then msgmsg() { true; } msgnmsg() { true; } + msgtest() { true; } + msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; } + msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; } + msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; } fi if [ $MSGLEVEL -le 3 ]; then msginfo() { true; } diff --git a/test/integration/run-tests b/test/integration/run-tests index c7ea0a61a..5644f0a05 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -2,7 +2,19 @@ set -e DIR=$(readlink -f $(dirname $0)) +if [ "$1" = "-q" ]; then + export MSGLEVEL=2 +elif [ "$1" = "-v" ]; then + export MSGLEVEL=5 +fi for testcase in $(run-parts --list $DIR | grep '/test-'); do - echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" + if [ "$1" = "-q" ]; then + echo -n "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" + else + echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" + fi ${testcase} + if [ "$1" = "-q" ]; then + echo + fi done -- cgit v1.2.3 From fe0f7911b650918e1d511b3453664a07f6d966d0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 20 Jan 2011 14:53:52 +0100 Subject: - try downloading clearsigned InRelease before trying Release.gpg * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles --- test/integration/Packages-releasefile-verification | 18 +++ .../Packages-releasefile-verification-new | 21 +++ test/integration/framework | 7 + test/integration/marvinparanoid.pub | Bin 0 -> 629 bytes test/integration/marvinparanoid.sec | Bin 0 -> 1280 bytes .../test-bug-595691-empty-and-broken-archive-files | 32 ++--- test/integration/test-releasefile-verification | 160 +++++++++++++++++++++ 7 files changed, 218 insertions(+), 20 deletions(-) create mode 100644 test/integration/Packages-releasefile-verification create mode 100644 test/integration/Packages-releasefile-verification-new create mode 100644 test/integration/marvinparanoid.pub create mode 100644 test/integration/marvinparanoid.sec create mode 100755 test/integration/test-releasefile-verification (limited to 'test') diff --git a/test/integration/Packages-releasefile-verification b/test/integration/Packages-releasefile-verification new file mode 100644 index 000000000..29a385f4f --- /dev/null +++ b/test/integration/Packages-releasefile-verification @@ -0,0 +1,18 @@ +Package: apt +Version: 0.7.25.3 +Architecture: i386 +Maintainer: APT Development Team +Installed-Size: 5244 +Replaces: libapt-pkg-dev (<< 0.3.7), libapt-pkg-doc (<< 0.3.7) +Provides: libapt-pkg-libc6.9-6-4.8 +Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, bzip2, lzma, python-apt +Filename: apt.deb +Size: 0 +MD5sum: d41d8cd98f00b204e9800998ecf8427e +Description: Advanced front-end for dpkg + This is Debian's next generation front-end for the dpkg package manager. + It provides the apt-get utility and APT dselect method that provides a + simpler, safer way to install and upgrade packages. + . + APT features complete installation ordering, multiple source capability + and several other unique features, see the Users Guide in apt-doc. diff --git a/test/integration/Packages-releasefile-verification-new b/test/integration/Packages-releasefile-verification-new new file mode 100644 index 000000000..e3b2edf1f --- /dev/null +++ b/test/integration/Packages-releasefile-verification-new @@ -0,0 +1,21 @@ +Package: apt +Priority: important +Section: admin +Installed-Size: 5672 +Maintainer: APT Development Team +Architecture: i386 +Version: 0.8.0~pre1 +Replaces: manpages-pl (<< 20060617-3~) +Provides: libapt-pkg4.10 +Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, bzip2, lzma, python-apt +Conflicts: python-apt (<< 0.7.93.2~) +Filename: apt.deb +Size: 0 +MD5sum: d41d8cd98f00b204e9800998ecf8427e +Description: Advanced front-end for dpkg + This is Debian's next generation front-end for the dpkg package manager. + It provides the apt-get utility and APT dselect method that provides a + simpler, safer way to install and upgrade packages. + . + APT features complete installation ordering, multiple source capability + and several other unique features, see the Users Guide in apt-doc. diff --git a/test/integration/framework b/test/integration/framework index 5d54e49b6..cb3fca35d 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -383,6 +383,7 @@ buildaptarchivefromfiles() { generatereleasefiles() { msgninfo "\tGenerate Release files… " + local DATE="${1:-now}" if [ -e aptarchive/dists ]; then for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do local CODENAME="$(echo "$dir" | cut -d'/' -f 4)" @@ -395,6 +396,11 @@ NotAutomatic: yes' $dir/Release else aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference fi + if [ "$DATE" != "now" ]; then + for release in $(find ./aptarchive -name 'Release'); do + touch -d "$1" $release + done + fi msgdone "info" } @@ -455,6 +461,7 @@ signreleasefiles() { done for RELEASE in $(find aptarchive/ -name Release); do gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" -abs -o ${RELEASE}.gpg ${RELEASE} + gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" --clearsign -o "$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')" $RELEASE done msgdone "info" } diff --git a/test/integration/marvinparanoid.pub b/test/integration/marvinparanoid.pub new file mode 100644 index 000000000..9a59c2e40 Binary files /dev/null and b/test/integration/marvinparanoid.pub differ diff --git a/test/integration/marvinparanoid.sec b/test/integration/marvinparanoid.sec new file mode 100644 index 000000000..ff54e8680 Binary files /dev/null and b/test/integration/marvinparanoid.sec differ 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 66792899a..c5379dca0 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -74,28 +74,24 @@ testoverfile() { setupcompressor "$1" createemptyfile 'en' - testaptgetupdate "Get:1 file: Release.gpg [] -Get:2 file: Release [] + testaptgetupdate "Get:1 file: InRelease [] Ign file:$(readlink -f aptarchive)/ Translation-en Reading package lists..." "empty file en.$COMPRESS over file" createemptyarchive 'en' - testaptgetupdate "Get:1 file: Release.gpg [] -Get:2 file: Release [] + testaptgetupdate "Get:1 file: InRelease [] Reading package lists..." "empty archive en.$COMPRESS over file" createemptyarchive 'Packages' # FIXME: Why omits the file transport the Packages Get line? #Get:3 file: Packages [] testaptgetupdate "Ign file:$(readlink -f aptarchive)/ Translation-en -Get:1 file: Release.gpg [] -Get:2 file: Release [] +Get:1 file: InRelease [] Reading package lists..." "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' testaptgetupdate "Ign file:$(readlink -f aptarchive)/ Translation-en -Get:1 file: Release.gpg [] -Get:2 file: Release [] +Get:1 file: InRelease [] Err file: Packages Undetermined Error W: Failed to fetch file:$(readlink -f aptarchive/Packages.$COMPRESS) Undetermined Error @@ -107,33 +103,29 @@ testoverhttp() { setupcompressor "$1" createemptyfile 'en' - testaptgetupdate "Get:1 http://localhost Release.gpg [] + testaptgetupdate "Get:1 http://localhost InRelease [] Get:2 http://localhost/ Translation-en -Get:3 http://localhost Release [] +Get:3 http://localhost Packages [] Ign http://localhost/ Translation-en -Get:4 http://localhost Packages [] Reading package lists..." "empty file en.$COMPRESS over http" createemptyarchive 'en' - testaptgetupdate "Get:1 http://localhost Release.gpg [] + testaptgetupdate "Get:1 http://localhost InRelease [] Get:2 http://localhost/ Translation-en [] -Get:3 http://localhost Release [] -Get:4 http://localhost Packages [] +Get:3 http://localhost Packages [] Reading package lists..." "empty archive en.$COMPRESS over http" createemptyarchive 'Packages' - testaptgetupdate "Get:1 http://localhost Release.gpg [] + testaptgetupdate "Get:1 http://localhost InRelease [] Ign http://localhost/ Translation-en -Get:2 http://localhost Release [] -Get:3 http://localhost Packages [] +Get:2 http://localhost Packages [] Reading package lists..." "empty archive Packages.$COMPRESS over http" createemptyfile 'Packages' #FIXME: we should response with a good error message instead - testaptgetupdate "Get:1 http://localhost Release.gpg [] + testaptgetupdate "Get:1 http://localhost InRelease [] Ign http://localhost/ Translation-en -Get:2 http://localhost Release [] -Get:3 http://localhost Packages +Get:2 http://localhost Packages Err http://localhost Packages Undetermined Error W: Failed to fetch http://localhost:8080/Packages.$COMPRESS Undetermined Error diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification new file mode 100755 index 000000000..961c49895 --- /dev/null +++ b/test/integration/test-releasefile-verification @@ -0,0 +1,160 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +buildaptarchive +setupflataptarchive +changetowebserver + +prepare() { + local DATE="${2:-now}" + if [ "$DATE" = 'now' -a "$1" = "${PKGFILE}-new" ]; then + DATE='now + 6 days' + fi + for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do + touch -d 'now - 6 hours' $release + done + rm -rf rootdir/var/cache/apt/archives + rm -f rootdir/var/cache/apt/*.bin + cp $1 aptarchive/Packages + find aptarchive -name 'Release' -delete + cat aptarchive/Packages | gzip > aptarchive/Packages.gz + cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 + cat aptarchive/Packages | lzma > aptarchive/Packages.lzma + generatereleasefiles "$DATE" +} + +installaptold() { + testequal 'Reading package lists... +Building dependency tree... +Suggested packages: + aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt +The following NEW packages will be installed: + apt +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +After this operation, 5370 kB of additional disk space will be used. +Get:1 http://localhost/ apt 0.7.25.3 +Download complete and in download only mode' aptget install apt -dy +} + +installaptnew() { + testequal 'Reading package lists... +Building dependency tree... +Suggested packages: + aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt +The following NEW packages will be installed: + apt +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +After this operation, 5808 kB of additional disk space will be used. +Get:1 http://localhost/ apt 0.8.0~pre1 +Download complete and in download only mode' aptget install apt -dy +} + +failaptold() { + testequal 'Reading package lists... +Building dependency tree... +Suggested packages: + aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt +The following NEW packages will be installed: + apt +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +After this operation, 5370 kB of additional disk space will be used. +WARNING: The following packages cannot be authenticated! + apt +E: There are problems and -y was used without --force-yes' aptget install apt -dy +} + +failaptnew() { + testequal 'Reading package lists... +Building dependency tree... +Suggested packages: + aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt +The following NEW packages will be installed: + apt +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +After this operation, 5808 kB of additional disk space will be used. +WARNING: The following packages cannot be authenticated! + apt +E: There are problems and -y was used without --force-yes' aptget install apt -dy +} + +# fake our downloadable file +touch aptarchive/apt.deb + +PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')" + +runtest() { + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Joe Sixpack' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Cold archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold + + prepare ${PKGFILE}-new + signreleasefiles 'Joe Sixpack' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Good warm archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}-new) +" aptcache show apt + installaptnew + + + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Marvin Paranoid' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Cold archive signed by' 'Marvin Paranoid' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail + testequal "$(cat ${PKGFILE}) +" aptcache show apt + failaptold + + prepare ${PKGFILE}-new + # weborf doesn't support If-Range + for release in $(find rootdir/var/lib/apt/lists/partial/ -name '*Release'); do + rm $release + touch $release + done + signreleasefiles 'Joe Sixpack' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Bad warm archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}-new) +" aptcache show apt + installaptnew + + + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Joe Sixpack' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Cold archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold + + prepare ${PKGFILE}-new + signreleasefiles 'Marvin Paranoid' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Good warm archive signed by' 'Marvin Paranoid' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail + testequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold +} + +DELETEFILE="InRelease" +runtest +DELETEFILE="Release.gpg" +runtest -- cgit v1.2.3 From b720d0bd5308b65dc08b930005c2d9b6dfc31bb9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 20 Jan 2011 16:02:15 +0100 Subject: ensure that tempfiles used for comparision are removed --- test/integration/framework | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index cb3fca35d..f55cfddfa 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -92,6 +92,11 @@ aptitude() { fi } +addtrap() { + CURRENTTRAP="$CURRENTTRAP $1" + trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +} + setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) local TESTDIR=$(readlink -f $(dirname $0)) @@ -99,8 +104,7 @@ setupenvironment() { BUILDDIRECTORY="${TESTDIR}/../../build/bin" test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first" local OLDWORKINGDIRECTORY=$(pwd) - CURRENTTRAP="cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY" - trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + addtrap "cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY;" cd $TMPWORKINGDIRECTORY mkdir rootdir aptarchive keys cd rootdir @@ -469,8 +473,7 @@ signreleasefiles() { changetowebserver() { if which weborf > /dev/null; then weborf -xb aptarchive/ 2>&1 > /dev/null & - CURRENTTRAP="kill $!; $CURRENTTRAP" - trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + addtrap "kill $!;" local APTARCHIVE="file://$(readlink -f ./aptarchive)" for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#" @@ -504,17 +507,18 @@ testfileequal() { testequal() { local COMPAREFILE=$(mktemp) + addtrap "rm $COMPAREFILE;" echo "$1" > $COMPAREFILE shift msgtest "Test for equality of" "$*" $* 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail - rm $COMPAREFILE } testequalor2() { local COMPAREFILE1=$(mktemp) local COMPAREFILE2=$(mktemp) local COMPAREAGAINST=$(mktemp) + addtrap "rm $COMPAREFILE1 $COMPAREFILE2 $COMPAREAGAINST;" echo "$1" > $COMPAREFILE1 echo "$2" > $COMPAREFILE2 shift 2 @@ -525,7 +529,6 @@ testequalor2() { ( echo "\n${CINFO}Diff against OR 1${CNORMAL}" "$(checkdiff $COMPAREFILE1 $COMPAREAGAINST)" \ "\n${CINFO}Diff against OR 2${CNORMAL}" "$(checkdiff $COMPAREFILE2 $COMPAREAGAINST)" && msgfail ) - rm $COMPAREFILE1 $COMPAREFILE2 $COMPAREAGAINST } testshowvirtual() { @@ -542,11 +545,11 @@ N: Can't select versions from package '$1' as it purely virtual" VIRTUAL="${VIRTUAL} N: No packages found" local COMPAREFILE=$(mktemp) + addtrap "rm $COMPAREFILE;" local ARCH=$(dpkg-architecture -qDEB_HOST_ARCH_CPU) eval `apt-config shell ARCH APT::Architecture` echo "$VIRTUAL" | sed -e "s/:$ARCH//" -e 's/:all//' > $COMPAREFILE aptcache show -q=0 $PACKAGE 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail - rm $COMPAREFILE } testnopackage() { -- cgit v1.2.3 From b761356f9a73e34325a0d85427300b58737c4d98 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 21 Jan 2011 22:03:42 +0100 Subject: avoid building simple packages with debhelper to speed it up a bit --- test/integration/framework | 48 ++++++++++++++++++++++++++++++-- test/integration/test-compressed-indexes | 6 ++-- 2 files changed, 49 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index f55cfddfa..5b83e7519 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -219,9 +219,53 @@ buildsimplenativepackage() { else DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)" fi - setupsimplenativepackage "$NAME" "$ARCH" "$VERSION" "$RELEASE" "$DEPENDENCIES" "$DESCRIPTION" "$SECTION" - buildpackage "incoming/${NAME}-${VERSION}" "$RELEASE" "$DISTSECTION" + local BUILDDIR=incoming/${NAME}-${VERSION} + + msgninfo "Build package ${NAME} in ${VERSIOM} for ${RELEASE} in ${DISTSECTION}… " + mkdir -p $BUILDDIR/debian/source + echo "* most suckless software product ever" > ${BUILDDIR}/FEATURES + echo "#!/bin/sh +echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME} + + echo "Copyleft by Joe Sixpack $(date +%Y)" > ${BUILDDIR}/debian/copyright + echo "$NAME ($VERSION) $RELEASE; urgency=low + + * Initial release + + -- Joe Sixpack $(date -R)" > ${BUILDDIR}/debian/changelog + echo "Source: $NAME +Section: $SECTION +Priority: optional +Maintainer: Joe Sixpack +Standards-Version: 3.9.1 + +Package: $NAME +Architecture: $ARCH" > ${BUILDDIR}/debian/control + test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control + if [ -z "$DESCRIPTION" ]; then + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + YOU did something horribly wrong! They are autogenerated + und used only by testcases for APT and surf no other propose…" >> ${BUILDDIR}/debian/control + else + echo "Description: $DESCRIPTION" >> ${BUILDIR}/debian/control + fi + echo '3.0 (native)' > ${BUILDDIR}/debian/source/format + local SRCS="$( (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')" + + mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin + cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} + cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian/tmp/usr/bin + (cd ${BUILDDIR}; dpkg-gencontrol) + (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) + + dpkg-deb --build ${BUILDDIR}/debian/tmp incoming > /dev/null + echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> incoming/${RELEASE}.${DISTSECTION}.pkglist + for SRC in $SRCS; do + echo "pool/${SRC}" >> incoming/${RELEASE}.${DISTSECTION}.srclist + done rm -rf "incoming/${NAME}-${VERSION}" + msgdone "info" } buildpackage() { diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index be33edbb7..99943574e 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -16,11 +16,11 @@ local GOODPOLICY="$(aptcache policy testpkg)" local GOODSHOWSRC="$(aptcache showsrc testpkg) " -test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 +test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken' testequal "$GOODSHOW" aptcache show testpkg -test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4 +test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4 || msgdie 'policy is broken' testequal "$GOODPOLICY" aptcache policy testpkg -test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4 +test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4 || msgdie 'showsrc is broken' testequal "$GOODSHOWSRC" aptcache showsrc testpkg -- cgit v1.2.3 From 321dfa5e570389c489b0f7f0f34ab983cebe7463 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 24 Jan 2011 15:41:57 +0100 Subject: do not add Index file by hand now that ftparchive does it by itself --- test/integration/test-pdiff-usage | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index eb1818bcd..0a8293018 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -23,7 +23,6 @@ cat aptarchive/Packages | gzip > aptarchive/Packages.gz cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 cat aptarchive/Packages | lzma > aptarchive/Packages.lzma rm -rf aptarchive/Packages.diff -aptftparchive release aptarchive/ > aptarchive/Release mkdir -p aptarchive/Packages.diff PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)" diff -e ${PKGFILE} ${PKGFILE}-new > ${PATCHFILE} || true @@ -36,15 +35,9 @@ SHA1-History: SHA1-Patches: 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28 $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX -sed -i aptarchive/Release \ - -e "/^MD5Sum:/ a\ - \ $(md5sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" \ - -e "/^SHA1:/ a\ - \ $(sha1sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" \ - -e "/^SHA256:/ a\ - \ $(sha256sum $PATCHINDEX | cut -d' ' -f 1) $(stat -c%s $PATCHINDEX) Packages.diff/Index" +generatereleasefiles signreleasefiles -rm -f aptarchive/Packages aptarchive/Packages.gz aptarchive/Packages.bz2 aptarchive/Packages.lzma +find aptarchive -name 'Packages*' -type f -delete aptget update -qq testnopackage oldstuff -- cgit v1.2.3 From 18331adf730dca4a587f99605edff71436379ea6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Jan 2011 12:39:42 +0100 Subject: enable the split out of LongDescriptions per default in the testcases --- test/integration/framework | 7 ++++++- test/integration/run-tests | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 5b83e7519..b95667670 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -221,7 +221,7 @@ buildsimplenativepackage() { fi local BUILDDIR=incoming/${NAME}-${VERSION} - msgninfo "Build package ${NAME} in ${VERSIOM} for ${RELEASE} in ${DISTSECTION}… " + msgninfo "Build package ${NAME} in ${VERSION} for ${RELEASE} in ${DISTSECTION}… " mkdir -p $BUILDDIR/debian/source echo "* most suckless software product ever" > ${BUILDDIR}/FEATURES echo "#!/bin/sh @@ -319,6 +319,8 @@ Default { Packages::Compress ". gzip bzip2 lzma"; Sources::Compress ". gzip bzip2 lzma"; Contents::Compress ". gzip bzip2 lzma"; + Translation::Compress ". gzip bzip2 lzma"; + LongDescription "false"; }; TreeDefault { Directory "pool/"; @@ -433,6 +435,9 @@ generatereleasefiles() { msgninfo "\tGenerate Release files… " local DATE="${1:-now}" if [ -e aptarchive/dists ]; then + for dir in $(find ./aptarchive/dists -mindepth 3 -maxdepth 3 -type d -name 'i18n'); do + 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 diff --git a/test/integration/run-tests b/test/integration/run-tests index 5644f0a05..7314e6b61 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -5,7 +5,7 @@ DIR=$(readlink -f $(dirname $0)) if [ "$1" = "-q" ]; then export MSGLEVEL=2 elif [ "$1" = "-v" ]; then - export MSGLEVEL=5 + export MSGLEVEL=4 fi for testcase in $(run-parts --list $DIR | grep '/test-'); do if [ "$1" = "-q" ]; then -- cgit v1.2.3 From 5d88572318ed7e271101b1ae8f2cc139a1a3f705 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 26 Jan 2011 16:19:30 +0100 Subject: - change the internal handling of Extensions in pkgAcqIndex - add a special uncompressed compression type to prefer those files * methods/{gzip,bzip}.cc: - print a good error message if FileSize() is zero --- test/integration/test-bug-595691-empty-and-broken-archive-files | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test') 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 c5379dca0..398d0cd1b 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -56,6 +56,7 @@ setupcompressor() { lzma) COMPRESS="lzma";; esac echo "Acquire::CompressionTypes::Order { \"${COMPRESS}\"; }; +Dir::Bin::uncompressed \"/does/not/exist\"; Dir::Bin::gzip \"/does/not/exist\"; Dir::Bin::bzip2 \"/does/not/exist\"; Dir::Bin::lzma \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor @@ -93,8 +94,8 @@ Reading package lists..." "empty archive Packages.$COMPRESS over file" testaptgetupdate "Ign file:$(readlink -f aptarchive)/ Translation-en Get:1 file: InRelease [] Err file: Packages - Undetermined Error -W: Failed to fetch file:$(readlink -f aptarchive/Packages.$COMPRESS) Undetermined Error + Empty files can't be valid archives +W: Failed to fetch ${COMPRESSOR}:$(readlink -f aptarchive/Packages.$COMPRESS) Empty files can't be valid archives E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over file" } @@ -127,8 +128,8 @@ Reading package lists..." "empty archive Packages.$COMPRESS over http" Ign http://localhost/ Translation-en Get:2 http://localhost Packages Err http://localhost Packages - Undetermined Error -W: Failed to fetch http://localhost:8080/Packages.$COMPRESS Undetermined Error + Empty files can't be valid archives +W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages) Empty files can't be valid archives E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over http" } -- cgit v1.2.3 From ab53c018fbc7aa01c0d89586c0aa98bc944dd9e4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 28 Jan 2011 12:22:37 +0100 Subject: - download and use i18n/Index to choose which Translations to download * apt-pkg/aptconfiguration.cc: - remove the inbuilt Translation files whitelist --- .../test-bug-595691-empty-and-broken-archive-files | 28 ++++----- .../test-bug-601016-description-translation | 1 + test/libapt/getlanguages_test.cc | 71 ++++++++++++---------- 3 files changed, 55 insertions(+), 45 deletions(-) (limited to 'test') 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 398d0cd1b..684559aa7 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -32,7 +32,7 @@ createemptyarchive() { fi touch aptarchive/Packages echo -n "" | $COMPRESSOR > aptarchive/${1}.$COMPRESS - aptftparchive release aptarchive/ > aptarchive/Release + generatereleasefiles signreleasefiles rm -f aptarchive/Packages } @@ -43,7 +43,7 @@ createemptyfile() { echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS fi touch aptarchive/Packages aptarchive/${1}.$COMPRESS - aptftparchive release aptarchive/ > aptarchive/Release + generatereleasefiles signreleasefiles rm -f aptarchive/Packages } @@ -76,7 +76,7 @@ testoverfile() { createemptyfile 'en' testaptgetupdate "Get:1 file: InRelease [] -Ign file:$(readlink -f aptarchive)/ Translation-en +Ign file: Translation-en Reading package lists..." "empty file en.$COMPRESS over file" createemptyarchive 'en' @@ -86,13 +86,13 @@ Reading package lists..." "empty archive en.$COMPRESS over file" createemptyarchive 'Packages' # FIXME: Why omits the file transport the Packages Get line? #Get:3 file: Packages [] - testaptgetupdate "Ign file:$(readlink -f aptarchive)/ Translation-en -Get:1 file: InRelease [] + testaptgetupdate "Get:1 file: InRelease [] +Ign file: Translation-en Reading package lists..." "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' - testaptgetupdate "Ign file:$(readlink -f aptarchive)/ Translation-en -Get:1 file: InRelease [] + testaptgetupdate "Get:1 file: InRelease [] +Ign file: Translation-en Err file: Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:$(readlink -f aptarchive/Packages.$COMPRESS) Empty files can't be valid archives @@ -105,28 +105,28 @@ testoverhttp() { createemptyfile 'en' testaptgetupdate "Get:1 http://localhost InRelease [] -Get:2 http://localhost/ Translation-en -Get:3 http://localhost Packages [] -Ign http://localhost/ Translation-en +Get:2 http://localhost Packages [] +Get:3 http://localhost Translation-en +Ign http://localhost Translation-en Reading package lists..." "empty file en.$COMPRESS over http" createemptyarchive 'en' testaptgetupdate "Get:1 http://localhost InRelease [] -Get:2 http://localhost/ Translation-en [] -Get:3 http://localhost Packages [] +Get:2 http://localhost Packages [] +Get:3 http://localhost Translation-en [] Reading package lists..." "empty archive en.$COMPRESS over http" createemptyarchive 'Packages' testaptgetupdate "Get:1 http://localhost InRelease [] -Ign http://localhost/ Translation-en Get:2 http://localhost Packages [] +Ign http://localhost Translation-en Reading package lists..." "empty archive Packages.$COMPRESS over http" createemptyfile 'Packages' #FIXME: we should response with a good error message instead testaptgetupdate "Get:1 http://localhost InRelease [] -Ign http://localhost/ Translation-en Get:2 http://localhost Packages +Ign http://localhost Translation-en Err http://localhost Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages) Empty files can't be valid archives diff --git a/test/integration/test-bug-601016-description-translation b/test/integration/test-bug-601016-description-translation index a31e42ee1..2a323a201 100755 --- a/test/integration/test-bug-601016-description-translation +++ b/test/integration/test-bug-601016-description-translation @@ -57,6 +57,7 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg testrun() { echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages export LC_ALL="" + rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/ setupaptarchive testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE} testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE} diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index 3559aae0c..707142aef 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -26,16 +26,18 @@ int main(int argc,char *argv[]) env[1] = ""; std::vector vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); // Special: Check if the cache is actually in use env[0] = "en_GB.UTF-8"; vec = APT::Configuration::getLanguages(false, true, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); env[0] = "en_GB.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); @@ -52,19 +54,21 @@ int main(int argc,char *argv[]) env[0] = "tr_DE@euro"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "tr"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "tr_DE"); + equals(vec[1], "tr"); + equals(vec[2], "en"); env[0] = "de_NO"; - env[1] = "se_NO:en_GB:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en"; + env[1] = "de_NO:en_GB:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 5); - equals(vec[0], "de"); - equals(vec[1], "en_GB"); - equals(vec[2], "nb"); - equals(vec[3], "no"); - equals(vec[4], "en"); + equals(vec.size(), 6); + equals(vec[0], "de_NO"); + equals(vec[1], "de"); + equals(vec[2], "en_GB"); + equals(vec[3], "nb_NO"); + equals(vec[4], "nb"); + equals(vec[5], "en"); env[0] = "pt_PR.UTF-8"; env[1] = ""; @@ -76,9 +80,10 @@ int main(int argc,char *argv[]) env[0] = "ast_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); // bogus, but syntactical correct - equals(vec.size(), 2); - equals(vec[0], "ast"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "ast_DE"); + equals(vec[1], "ast"); + equals(vec[2], "en"); env[0] = "C"; vec = APT::Configuration::getLanguages(false, false, env); @@ -113,25 +118,28 @@ int main(int argc,char *argv[]) _config->Set("Acquire::Languages::2", "en"); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); _config->Set("Acquire::Languages::3", "de"); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); _config->Set("Dir::State::lists", argv[1]); vec = APT::Configuration::getLanguages(true, false, env); - equals(vec.size(), 5); - equals(vec[0], "de"); - equals(vec[1], "en"); - equals(vec[2], "none"); - equals(vec[3], "pt"); - equals(vec[4], "tr"); + equals(vec.size(), 6); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); + equals(vec[3], "none"); + equals(vec[4], "pt"); + equals(vec[5], "tr"); _config->Set("Dir::State::lists", "/non-existing-dir"); _config->Set("Acquire::Languages::1", "none"); @@ -140,6 +148,7 @@ int main(int argc,char *argv[]) equals(vec.size(), 0); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(true, false, env); + equals(vec.size(), 2); equals(vec[0], "en"); equals(vec[1], "de"); -- cgit v1.2.3 From 5a635ee4bafd8ba4cde6e50ea256e36d2c55dc64 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 28 Jan 2011 13:26:11 +0100 Subject: ensure that we are building really inside of our tmp directory --- test/integration/framework | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index b95667670..c85914289 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -219,7 +219,7 @@ buildsimplenativepackage() { else DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)" fi - local BUILDDIR=incoming/${NAME}-${VERSION} + local BUILDDIR=${TMPWORKINGDIRECTORY}/incoming/${NAME}-${VERSION} msgninfo "Build package ${NAME} in ${VERSION} for ${RELEASE} in ${DISTSECTION}… " mkdir -p $BUILDDIR/debian/source @@ -259,12 +259,12 @@ Architecture: $ARCH" > ${BUILDDIR}/debian/control (cd ${BUILDDIR}; dpkg-gencontrol) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) - dpkg-deb --build ${BUILDDIR}/debian/tmp incoming > /dev/null - echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> incoming/${RELEASE}.${DISTSECTION}.pkglist + dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. > /dev/null + echo "pool/${NAME}_${VERSION}_${ARCH}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist for SRC in $SRCS; do - echo "pool/${SRC}" >> incoming/${RELEASE}.${DISTSECTION}.srclist + echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist done - rm -rf "incoming/${NAME}-${VERSION}" + rm -rf "${BUILDDIR}" msgdone "info" } -- cgit v1.2.3 From 875bcb3670c43bd4450e27934ba105611e534df0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 1 Feb 2011 10:58:48 +0100 Subject: ensure that we are building the packages in the right architecture --- test/integration/framework | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index c85914289..ee4048a53 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -188,8 +188,12 @@ Maintainer: Joe Sixpack Build-Depends: debhelper (>= 7) Standards-Version: 3.9.1 -Package: $NAME -Architecture: $ARCH" > debian/control +Package: $NAME" > debian/control + if [ "$ARCH" = 'all' ]; then + echo "Architecture: all" >> debian/control + else + echo "Architecture: any" >> debian/control + fi test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> debian/control if [ -z "$DESCRIPTION" ]; then echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} @@ -239,8 +243,12 @@ Priority: optional Maintainer: Joe Sixpack Standards-Version: 3.9.1 -Package: $NAME -Architecture: $ARCH" > ${BUILDDIR}/debian/control +Package: $NAME" > ${BUILDDIR}/debian/control + if [ "$ARCH" = 'all' ]; then + echo "Architecture: all" >> ${BUILDDIR}/debian/control + else + echo "Architecture: any" >> ${BUILDDIR}/debian/control + fi test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control if [ -z "$DESCRIPTION" ]; then echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} @@ -256,7 +264,7 @@ Architecture: $ARCH" > ${BUILDDIR}/debian/control mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian/tmp/usr/bin - (cd ${BUILDDIR}; dpkg-gencontrol) + (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$ARCH) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. > /dev/null -- cgit v1.2.3