From 53ea1b56efc41e6b1bea6157f01f90ac552db82e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 10 Feb 2012 15:56:50 +0100 Subject: Fix the testcases to work with and configure dpkg correctly in a multi-arch environment It's not a complete and the "fixed" test is fixed more like a hack as we have communication problems with dpkg if dpkg and APT disagree on the interpretation of the native architecture, see also: http://lists.debian.org/debian-dpkg/2012/02/msg00051.html --- test/integration/framework | 64 ++++++++++++++++------ .../test-bug-612099-multiarch-conflicts | 23 ++++++-- 2 files changed, 64 insertions(+), 23 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index d7526a100..9f741877a 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -114,9 +114,9 @@ addtrap() { setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) - local TESTDIR=$(readlink -f $(dirname $0)) + TESTDIRECTORY=$(readlink -f $(dirname $0)) msgninfo "Preparing environment for ${CCMD}$(basename $0)${CINFO} in ${TMPWORKINGDIRECTORY}… " - BUILDDIRECTORY="${TESTDIR}/../../build/bin" + BUILDDIRECTORY="${TESTDIRECTORY}/../../build/bin" test -x "${BUILDDIRECTORY}/apt-get" || msgdie "You need to build tree first" local OLDWORKINGDIRECTORY=$(pwd) addtrap "cd /; rm -rf $TMPWORKINGDIRECTORY; cd $OLDWORKINGDIRECTORY;" @@ -126,25 +126,19 @@ setupenvironment() { mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d mkdir -p var/cache var/lib var/log mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers - local STATUSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/status-/' -e 's/^skip-/status-/') - if [ -f "${TESTDIR}/${STATUSFILE}" ]; then - cp "${TESTDIR}/${STATUSFILE}" var/lib/dpkg/status - else - touch var/lib/dpkg/status - fi touch var/lib/dpkg/available mkdir -p usr/lib/apt ln -s ${BUILDDIRECTORY}/methods usr/lib/apt/methods cd .. local PACKAGESFILE=$(echo "$(basename $0)" | sed -e 's/^test-/Packages-/' -e 's/^skip-/Packages-/') - if [ -f "${TESTDIR}/${PACKAGESFILE}" ]; then - cp "${TESTDIR}/${PACKAGESFILE}" aptarchive/Packages + if [ -f "${TESTDIRECTORY}/${PACKAGESFILE}" ]; then + cp "${TESTDIRECTORY}/${PACKAGESFILE}" 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 + if [ -f "${TESTDIRECTORY}/${SOURCESSFILE}" ]; then + cp "${TESTDIRECTORY}/${SOURCESSFILE}" aptarchive/Sources fi - cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/ + cp $(find $TESTDIRECTORY -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 echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf @@ -156,7 +150,9 @@ setupenvironment() { echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf - echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it… + if ! $(which dpkg) --assert-multi-arch; then + echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it… + fi echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C @@ -177,6 +173,10 @@ getarchitecture() { fi } +getarchitectures() { + echo "$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" +} + configarchitecture() { local CONFFILE=rootdir/etc/apt/apt.conf.d/01multiarch.conf rm -f $CONFFILE @@ -186,6 +186,30 @@ configarchitecture() { echo "APT::Architectures:: \"$(getarchitecture $1)\";" >> $CONFFILE shift done + configdpkg +} + +configdpkg() { + if [ ! -e rootdir/var/lib/dpkg/status ]; then + local STATUSFILE=$(echo "$(basename $0)" | sed -e 's/^test-/status-/' -e 's/^skip-/status-/') + if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then + cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status + else + echo -n > rootdir/var/lib/dpkg/status + fi + fi + if $(which dpkg) --assert-multi-arch; then + local ARCHS="$(getarchitectures)" + if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then + DPKGARCH="$(dpkg --print-architecture)" + for ARCH in ${ARCHS}; do + if [ "${ARCH}" != "${DPKGARCH}" ]; then dpkg --add-architecture ${ARCH}; fi + done + if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then + insertinstalledpackage 'dpkg' "all" '1.16.2~wipmultiarch~fake' + fi + fi + fi } setupsimplenativepackage() { @@ -350,7 +374,7 @@ createaptftparchiveconfig() { local ARCHS="$(find pool/ -name '*.deb' | grep -oE '_[a-z0-9-]+\.deb$' | sort | uniq | sed -e '/^_all.deb$/ d' -e 's#^_\([a-z0-9-]*\)\.deb$#\1#' | tr '\n' ' ')" if [ -z "$ARCHS" ]; then # the pool is empty, so we will operate on faked packages - let us use the configured archs - ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + ARCHS="$(getarchitectures)" fi echo -n 'Dir { ArchiveDir "' >> ftparchive.conf @@ -432,7 +456,7 @@ insertpackage() { local ARCHS="" for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do if [ "$arch" = "all" ]; then - ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + ARCHS="$(getarchitectures)" else ARCHS="$arch" fi @@ -486,7 +510,8 @@ insertinstalledpackage() { local VERSION="$3" local DEPENDENCIES="$4" local PRIORITY="${5:-optional}" - local FILE="rootdir/var/lib/dpkg/status" + local FILE='rootdir/var/lib/dpkg/status' + local INFO='rootdir/var/lib/dpkg/info' for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do echo "Package: $NAME Status: install ok installed @@ -502,6 +527,11 @@ Version: $VERSION" >> $FILE YOU did something horribly wrong! They are autogenerated und used only by testcases for APT and surf no other propose… " >> $FILE + if [ "$(dpkg-query -W --showformat='${Multi-Arch}')" = 'same' ]; then + echo -n > ${INFO}/${NAME}:${arch}.list + else + echo -n > ${INFO}/${NAME}.list + fi done } diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index dd9efb785..530012e5d 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -16,7 +16,7 @@ buildsimplenativepackage 'foobar' 'amd64' '1.0' 'stable' 'Depends: libc6' setupaptarchive aptget install libc6:i386 -t stable -y -qq 2>&1 > /dev/null -testdpkginstalled libc6 +testdpkginstalled libc6:i386 testequal 'Reading package lists... Building dependency tree... Reading state information... @@ -75,8 +75,13 @@ The following packages will be upgraded: 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Inst libc6 [1.0] (2.0 testing [all]) Conf libc6 (2.0 testing [all])' aptget upgrade -t testing -s -aptget upgrade -y -qq 2>&1 > /dev/null -testdpkginstalled libc6 +# FIXME: on amd64 systems this test wouldn't run with a real upgrade +# as APT (here i386) disagree about the native architecture, so +# we fake it here: +#aptget upgrade -y -qq 2>&1 > /dev/null +aptget purge libc6 -y -qq 2>&1 >/dev/null +aptget install libc6:i386 -y -qq 2>&1 >/dev/null +testdpkginstalled libc6:all testequal 'Reading package lists... Building dependency tree... @@ -125,7 +130,7 @@ buildsimplenativepackage 'foobar-same' 'amd64' '1.0' 'stable' 'Depends: libc6-sa setupaptarchive aptget install libc6-same:i386 -t stable -y -qq 2>&1 > /dev/null -testdpkginstalled libc6-same +testdpkginstalled libc6-same:i386 testequal 'Reading package lists... Building dependency tree... @@ -168,8 +173,14 @@ The following packages will be upgraded: 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Inst libc6-same [1.0] (2.0 testing [all]) Conf libc6-same (2.0 testing [all])' aptget upgrade -t testing -s -aptget upgrade -y -qq 2>&1 > /dev/null -testdpkginstalled libc6-same +# FIXME: on amd64 systems this test wouldn't run with a real upgrade +# as APT (here i386) disagree about the native architecture, so +# we fake it here: +#aptget upgrade -y -qq 2>&1 > /dev/null +aptget purge libc6-same -y -qq 2>&1 >/dev/null +aptget install libc6-same:i386 -y -qq 2>&1 >/dev/null +testdpkginstalled libc6-same:all + testequal "Reading package lists... Building dependency tree... -- cgit v1.2.3 From 5834d7a103cb8b68cd6eb072b4b789ca679a2d71 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 11 Feb 2012 19:46:52 +0100 Subject: fix the hold-testcase as it has problems with 'foreign' operations --- ...ages-bug-64141-install-dependencies-for-on-hold | 42 ---------------------- test/integration/framework | 2 +- ...atus-bug-64141-install-dependencies-for-on-hold | 33 ----------------- ...test-bug-64141-install-dependencies-for-on-hold | 20 ++++++++--- 4 files changed, 16 insertions(+), 81 deletions(-) delete mode 100644 test/integration/Packages-bug-64141-install-dependencies-for-on-hold delete mode 100644 test/integration/status-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 deleted file mode 100644 index 7005fa4f4..000000000 --- a/test/integration/Packages-bug-64141-install-dependencies-for-on-hold +++ /dev/null @@ -1,42 +0,0 @@ -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/framework b/test/integration/framework index 9f741877a..350ee112e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -166,7 +166,7 @@ getarchitecture() { if [ -n "$ARCH" ]; then echo $ARCH else - dpkg-architecture -qDEB_BUILD_ARCH + dpkg --print-architecture fi else echo $1 diff --git a/test/integration/status-bug-64141-install-dependencies-for-on-hold b/test/integration/status-bug-64141-install-dependencies-for-on-hold deleted file mode 100644 index c82ebd19c..000000000 --- a/test/integration/status-bug-64141-install-dependencies-for-on-hold +++ /dev/null @@ -1,33 +0,0 @@ -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 index 4633ffcc3..e2d206fdd 100755 --- a/test/integration/test-bug-64141-install-dependencies-for-on-hold +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -4,7 +4,19 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'native' 'strange-arch' + +insertpackage 'unstable' 'unrelated' 'strange-arch' '1' + +insertinstalledpackage 'apt' 'native' '0.8.9' 'Depends: libc6 (>= 2.3.4)' +insertinstalledpackage 'libc6' 'native' '2.4.1-1' +insertinstalledpackage 'oldcrap' 'all' '1-1' + +insertpackage 'unstable' 'apt' 'native' '0.8.10' 'Depends: libc6 (>= 2.10), libdb4.8 +Breaks: oldcrap' +insertpackage 'unstable' 'libc6' 'native' '2.11.2-7' +insertpackage 'unstable' 'libdb4.8' 'native' '4.8.30-3' + setupaptarchive testequal 'Reading package lists... @@ -16,11 +28,10 @@ The following NEW packages will be installed: 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. +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 -echo 'apt hold' | dpkg --set-selections +aptmark hold apt -qq testequal 'Reading package lists... Building dependency tree... @@ -29,6 +40,5 @@ The following packages have been kept back: 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 8e3900d0d7efc11d538b944ed1d9e4e3d5286ff6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Feb 2012 19:40:13 +0100 Subject: * apt-pkg/acquire-item.cc: - drop support for i18n/Index file (introduced in 0.8.11) and use the Release file instead to get the Translations (Closes: #649314) * ftparchive/writer.cc: - add 'Translation-*' to the default patterns i18n/Index was never used outside debian - and even here it isn't used consistently as only 'main' has such a file. As the Release file now includes the Translation-* files we therefore drop support for i18n/Index. A version supporting it was never part of a debian release and still supporting it would mean that we get 99% of the time a 404 as response to the request anyway and confuse archive maintainers who want to provide all files APT tries to acquire. --- test/integration/framework | 3 --- test/integration/test-bug-624218-Translation-file-handling | 9 +-------- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 350ee112e..99088b59b 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -572,9 +572,6 @@ generatereleasefiles() { # both should be given in notation date/touch can understand msgninfo "\tGenerate Release files… " 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 SUITE="$(echo "$dir" | cut -d'/' -f 4)" local CODENAME="$(getcodenamefromsuite $SUITE)" diff --git a/test/integration/test-bug-624218-Translation-file-handling b/test/integration/test-bug-624218-Translation-file-handling index a1e708d2e..d146b943c 100755 --- a/test/integration/test-bug-624218-Translation-file-handling +++ b/test/integration/test-bug-624218-Translation-file-handling @@ -42,16 +42,9 @@ msgtest 'Download of nothing if none is forced' 'with Index' aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass rm -rf rootdir/var/lib/apt/lists -sed -i '/i18n\/Index$/ d' $(find aptarchive -name 'Release') +sed -i '/i18n\/Translation-.*$/ d' $(find aptarchive -name 'Release') signreleasefiles -# we have to try as not every archive includes the i18n Index in the Release file - if it has one at all -msgtest 'Download no Translation- if forced language is non-existent' 'with not-announced Index' -aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass -rm -rf rootdir/var/lib/apt/lists - -find aptarchive -name 'Index' -delete - msgtest 'Download of en as forced language' 'without Index' aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail rm -rf rootdir/var/lib/apt/lists -- cgit v1.2.3 From 0c73b84b001028338c0862c045c0cc4e6b191fcb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Feb 2012 20:44:31 +0100 Subject: * cmdline/apt-get.cc: - if a package can't be removed as it is not installed, suggest to the user an (installed) multiarch silbing with 'Did you mean?' --- .../test-suggest-installed-multiarch-silbing | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 test/integration/test-suggest-installed-multiarch-silbing (limited to 'test') diff --git a/test/integration/test-suggest-installed-multiarch-silbing b/test/integration/test-suggest-installed-multiarch-silbing new file mode 100755 index 000000000..ca6d7bd2e --- /dev/null +++ b/test/integration/test-suggest-installed-multiarch-silbing @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' 'armel' + +insertinstalledpackage 'foo' 'i386' '1' +insertpackage 'unstable' 'foo' 'amd64,i386' '1' + +insertinstalledpackage 'foo2' 'i386' '1' +insertpackage 'unstable' 'foo2' 'i386' '1' + +insertinstalledpackage 'foo3' 'amd64' '1' +insertpackage 'unstable' 'foo3' 'amd64,i386' '1' + +insertinstalledpackage 'samefoo' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'samefoo' 'amd64,i386,armel' '1' 'Multi-Arch: same' + +insertinstalledpackage 'samefoo2' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'samefoo2' 'amd64,i386,armel' '1' 'Multi-Arch: same' + +setupaptarchive + +testequal "Reading package lists... +Building dependency tree... +Package 'foo' is not installed, so not removed. Did you mean 'foo:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove foo -s + +testequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + foo2:i386 +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv foo2:i386 [1]" aptget remove foo2 -s + +testequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + foo3 +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv foo3 [1]" aptget remove foo3 -s + +testequal "Reading package lists... +Building dependency tree... +Package 'foo3:i386' is not installed, so not removed. Did you mean 'foo3'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove foo3:i386 -s + +testequalor2 "Reading package lists... +Building dependency tree... +Package 'samefoo:armel' is not installed, so not removed. Did you mean 'samefoo'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." "Reading package lists... +Building dependency tree... +Package 'samefoo:armel' is not installed, so not removed. Did you mean 'samefoo:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo:armel -s + +testequal "Reading package lists... +Building dependency tree... +Package 'samefoo2' is not installed, so not removed. Did you mean 'samefoo2:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo2 -s + +testequal "Reading package lists... +Building dependency tree... +Package 'samefoo2:armel' is not installed, so not removed. Did you mean 'samefoo2:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo2:armel -s -- cgit v1.2.3 From ca5e41fdced7a5566b07dfc2d6adc67d74fa2d93 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Feb 2012 21:20:57 +0100 Subject: improve 'error' message for packages which are only referenced e.g. in a Depends line and are now requested for removal --- test/integration/test-suggest-installed-multiarch-silbing | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/integration/test-suggest-installed-multiarch-silbing b/test/integration/test-suggest-installed-multiarch-silbing index ca6d7bd2e..d55d250aa 100755 --- a/test/integration/test-suggest-installed-multiarch-silbing +++ b/test/integration/test-suggest-installed-multiarch-silbing @@ -21,6 +21,10 @@ insertpackage 'unstable' 'samefoo' 'amd64,i386,armel' '1' 'Multi-Arch: same' insertinstalledpackage 'samefoo2' 'i386' '1' 'Multi-Arch: same' insertpackage 'unstable' 'samefoo2' 'amd64,i386,armel' '1' 'Multi-Arch: same' +insertinstalledpackage 'mozplugger' 'i386' '1' 'Depends: iceweasel | fireweasel' +insertinstalledpackage 'fireweasel' 'i386' '1' +insertpackage 'unstable' 'mozplugger' 'i386,amd64' '1' 'Depends: iceweasel | fireweasel' + setupaptarchive testequal "Reading package lists... @@ -64,3 +68,13 @@ testequal "Reading package lists... Building dependency tree... Package 'samefoo2:armel' is not installed, so not removed. Did you mean 'samefoo2:i386'? 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo2:armel -s + +testequal "Reading package lists... +Building dependency tree... +Package 'iceweasel' is not installed, so not removed +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove iceweasel -s + +testequal "Reading package lists... +Building dependency tree... +Package 'fireweasel' is not installed, so not removed. Did you mean 'fireweasel:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove fireweasel:amd64 -s -- cgit v1.2.3 From c2ef3ce3748cc31e3431d3beb00153546a5e50c0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 27 Feb 2012 12:51:31 +0100 Subject: fix the string in the testcases --- test/integration/test-bug-549968-install-depends-of-not-installed | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index 78c0801f2..8c434b3ce 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -14,13 +14,13 @@ setupaptarchive # We check the Markers here as the autoremove nuker will also # prevent it, but to late - its better to fail earlier -testequal 'Reading package lists... +testequal "Reading package lists... Building dependency tree... MarkInstall coolstuff [ i386 ] < none -> 1.0 > ( other ) FU=1 Ignore MarkInstall of extracoolstuff [ i386 ] < none -> 1.0 > ( other ) as its mode (Keep) is protected -Package extracoolstuff is not installed, so not removed +Package 'extracoolstuff' is not installed, so not removed The following NEW packages will be installed: coolstuff 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst coolstuff (1.0 unstable [all]) -Conf coolstuff (1.0 unstable [all])' aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s +Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s -- cgit v1.2.3 From d73840dc51fe0762e0d170c47e07e13211a0de95 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 3 Mar 2012 11:40:22 +0100 Subject: allow msgtest to be used with only one parameter --- test/integration/framework | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 99088b59b..a738d27cc 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -29,7 +29,8 @@ msgtest() { while [ -n "$1" ]; do echo -n "${CINFO}$1${CCMD} " >&2; echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} " >&2; - shift 2 + shift + if [ -n "$1" ]; then shift; else break; fi done echo -n "…${CNORMAL} " >&2; } -- cgit v1.2.3 From 440d3d654a5f85e8b5c0472e91f425fbac9541b8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 3 Mar 2012 11:43:21 +0100 Subject: * apt-pkg/packagemanager.cc: - do not try to a void a breaks if the broken package pre-depends on the breaker, but let dpkg auto-deconfigure it --- .../skip-avoid-avoiding-breaks-predepends | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 test/integration/skip-avoid-avoiding-breaks-predepends (limited to 'test') diff --git a/test/integration/skip-avoid-avoiding-breaks-predepends b/test/integration/skip-avoid-avoiding-breaks-predepends new file mode 100755 index 000000000..a47e8bc2b --- /dev/null +++ b/test/integration/skip-avoid-avoiding-breaks-predepends @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'native' + +insertinstalledpackage 'looping' 'native' '1' +insertinstalledpackage 'loop1' 'native' '1' 'Depends: loop2 (= 1)' +insertinstalledpackage 'loop2' 'native' '1' 'Depends: loop1 (= 1)' + +buildsimplenativepackage 'looping' 'native' '1.15.7.2' 'stable' 'Breaks: loop2 (<= 1)' +buildsimplenativepackage 'loop1' 'native' '2' 'stable' 'Depends: loop2 (= 2)' +buildsimplenativepackage 'loop2' 'native' '2' 'stable' 'Depends: loop1 (= 2) +Pre-Depends: looping (>= 1.15)' + +setupaptarchive + +aptget dist-upgrade -y -o Debug::pkgOrderList=1 #-qq 2>&1 > /dev/null +testdpkginstalled looping loop1 loop2 -- cgit v1.2.3 From 43c1ca5d1eb8101e3a52d19a2175c14817e6dd14 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 3 Mar 2012 11:44:06 +0100 Subject: testcase for CVE-2012-0214 --- test/integration/test-releasefile-verification | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 8bf02a78f..4f65cfa3b 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -153,6 +153,35 @@ runtest() { installaptold } +runtest2() { + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Joe Sixpack' + msgtest 'Cold archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + + # New .deb but now an unsigned archive. For example MITM to circumvent + # package verification. + prepare ${PKGFILE}-new + find aptarchive/ -name InRelease -delete + find aptarchive/ -name Release.gpg -delete + msgtest 'Warm archive signed by' 'nobody' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}-new) +" aptcache show apt + failaptnew + + # Unsigned archive from the beginning must also be detected. + rm -rf rootdir/var/lib/apt/lists + msgtest 'Cold archive signed by' 'nobody' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}-new) +" aptcache show apt + failaptnew +} +runtest2 + + DELETEFILE="InRelease" runtest DELETEFILE="Release.gpg" -- cgit v1.2.3