diff options
Diffstat (limited to 'test/integration')
32 files changed, 1164 insertions, 102 deletions
diff --git a/test/integration/create-test-data b/test/integration/create-test-data index 581b62910..effbe1ea3 100755 --- a/test/integration/create-test-data +++ b/test/integration/create-test-data @@ -6,7 +6,7 @@ if [ -z "$1" -o -z "$2" ]; then exit 1 fi -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework BUILDDIRECTORY="${TESTDIR}/../../build/bin" diff --git a/test/integration/framework b/test/integration/framework index fe0ffb64f..cc5af798c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -79,6 +79,7 @@ aptcache() { runapt apt-cache $*; } aptget() { runapt apt-get $*; } aptftparchive() { runapt apt-ftparchive $*; } aptkey() { runapt apt-key $*; } +aptmark() { runapt apt-mark $*; } dpkg() { $(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $* } @@ -137,7 +138,6 @@ setupenvironment() { 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 "Dir::Bin::methods \"${BUILDDIRECTORY}/methods\";" >> aptconfig.conf echo "DPKG::options:: \"dpkg\";" >> aptconfig.conf echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf @@ -145,6 +145,7 @@ setupenvironment() { echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C + export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" msgdone "info" } @@ -218,6 +219,7 @@ buildsimplenativepackage() { local DEPENDENCIES="$5" local DESCRIPTION="$6" local SECTION="${7:-others}" + local PRIORITY="${8:-optional}" local DISTSECTION if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then DISTSECTION="main" @@ -240,7 +242,7 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME} -- Joe Sixpack <joe@example.org> $(date -R)" > ${BUILDDIR}/debian/changelog echo "Source: $NAME Section: $SECTION -Priority: optional +Priority: $PRIORITY Maintainer: Joe Sixpack <joe@example.org> Standards-Version: 3.9.1 @@ -261,18 +263,25 @@ Package: $NAME" > ${BUILDDIR}/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 -DArchitecture=$ARCH) - (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) - - 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}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist done + + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + rm -rf ${BUILDDIR}/debian/tmp + 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/${NAME}-${arch} + (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch) + (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) + + dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. 2> /dev/null > /dev/null + echo "pool/${NAME}_${VERSION}_${arch}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist + done + + mkdir -p ${BUILDDIR}/../${NAME}_${VERSION} + cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}/ + cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}.changelog rm -rf "${BUILDDIR}" msgdone "info" } @@ -325,10 +334,10 @@ createaptftparchiveconfig() { echo -n '"; }; Default { - Packages::Compress ". gzip bzip2 lzma"; - Sources::Compress ". gzip bzip2 lzma"; - Contents::Compress ". gzip bzip2 lzma"; - Translation::Compress ". gzip bzip2 lzma"; + Packages::Compress ". gzip bzip2 lzma xz"; + Sources::Compress ". gzip bzip2 lzma xz"; + Contents::Compress ". gzip bzip2 lzma xz"; + Translation::Compress ". gzip bzip2 lzma xz"; LongDescription "false"; }; TreeDefault { @@ -389,25 +398,55 @@ insertpackage() { 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 + local PRIORITY="${6:-optional}" + local ARCHS="" + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + if [ "$arch" = "all" ]; then + ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')" + else + ARCHS="$arch" + 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: $PRIORITY Section: other Installed-Size: 42 Maintainer: Joe Sixpack <joe@example.org> -Architecture: $ARCH +Architecture: $arch Version: $VERSION -Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE +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, + YOU did something horribly wrong! They are autogenerated + und used only by testcases for APT and surf no other propose… +" >> $FILE + done + done +} + +insertinstalledpackage() { + local NAME="$1" + local ARCH="$2" + local VERSION="$3" + local DEPENDENCIES="$4" + local PRIORITY="${5:-optional}" + local FILE="rootdir/var/lib/dpkg/status" + for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do + echo "Package: $NAME +Status: install ok installed +Priority: $PRIORITY +Section: other +Installed-Size: 42 +Maintainer: Joe Sixpack <joe@example.org> +Architecture: $arch +Version: $VERSION" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed 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… @@ -415,6 +454,7 @@ Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE done } + buildaptarchivefromincoming() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on incoming packages…" cd aptarchive @@ -435,6 +475,7 @@ buildaptarchivefromfiles() { cat ${line} | gzip > ${line}.gz cat ${line} | bzip2 > ${line}.bz2 cat ${line} | lzma > ${line}.lzma + cat ${line} | xz > ${line}.xz msgdone "info" done generatereleasefiles @@ -532,13 +573,22 @@ changetowebserver() { if which weborf > /dev/null; then weborf -xb aptarchive/ 2>&1 > /dev/null & 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/#" - done - return 0 + elif which lighttpd > /dev/null; then + echo "server.document-root = \"$(readlink -f ./aptarchive)\" +server.port = 8080 +server.stat-cache-engine = \"disable\"" > lighttpd.conf + lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' + lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & + addtrap "kill $!;" + else + msgdie 'You have to install weborf or lighttpd first' + return 1 fi - return 1 + 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/#" + done + return 0 } checkdiff() { @@ -624,8 +674,8 @@ testnopackage() { testdpkginstalled() { msgtest "Test for correctly installed package(s) with" "dpkg -l $*" - local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^i]' | wc -l)" - if [ "$PKGS" != 0 ]; then + local PKGS="$(dpkg -l $* | grep '^i' | wc -l)" + if [ "$PKGS" != $# ]; then echo $PKGS dpkg -l $* | grep '^[a-z]' msgfail @@ -634,9 +684,9 @@ testdpkginstalled() { msgpass } -testdpkgnoninstalled() { - msgtest "Test for correctly non-installed package(s) with" "dpkg -l $*" - local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^u]' | wc -l)" +testdpkgnotinstalled() { + msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*" + local PKGS="$(dpkg -l $* 2> /dev/null | grep '^i' | wc -l)" if [ "$PKGS" != 0 ]; then echo dpkg -l $* | grep '^[a-z]' @@ -645,3 +695,16 @@ testdpkgnoninstalled() { fi msgpass } + +testmarkedauto() { + local COMPAREFILE=$(mktemp) + addtrap "rm $COMPAREFILE;" + if [ -n "$1" ]; then + msgtest 'Test for correctly marked as auto-installed' "$*" + while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE + else + msgtest 'Test for correctly marked as auto-installed' 'no package' + echo -n > $COMPAREFILE + fi + aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail +} diff --git a/test/integration/run-tests b/test/integration/run-tests index 7314e6b61..edac07dbf 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -1,6 +1,7 @@ #!/bin/sh set -e +FAIL=0 DIR=$(readlink -f $(dirname $0)) if [ "$1" = "-q" ]; then export MSGLEVEL=2 @@ -13,8 +14,14 @@ for testcase in $(run-parts --list $DIR | grep '/test-'); do else echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" fi - ${testcase} + if ! ${testcase}; then + FAIL=$((FAIL+1)) + echo "$(basename $testcase) ... FAIL" + fi if [ "$1" = "-q" ]; then echo fi done + +echo "failures: $FAIL" +exit $FAIL diff --git a/test/integration/skip-bug-602412-dequote-redirect b/test/integration/skip-bug-602412-dequote-redirect new file mode 100755 index 000000000..a63d36246 --- /dev/null +++ b/test/integration/skip-bug-602412-dequote-redirect @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +if ! which lighttpd > /dev/null; then + msgdie 'You need lighttpd for this testcase, sorry…' + exit 1 +fi + +buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' + +setupaptarchive + +echo "server.modules = ( \"mod_redirect\" ) +server.document-root = \"$(readlink -f ./aptarchive)\" +server.port = 8080 +server.stat-cache-engine = \"disable\" +url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\" )" > lighttpd.conf + +mv aptarchive/pool aptarchive/newpool +lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' +lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & +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/#" +done + +aptget update -qq || msgdie 'apt-get update failed' +aptget install unrelated --download-only -qq || msgdie 'downloading package failed' + diff --git a/test/integration/status-bug-612557-garbage-upgrade b/test/integration/status-bug-612557-garbage-upgrade new file mode 100644 index 000000000..7403d8cca --- /dev/null +++ b/test/integration/status-bug-612557-garbage-upgrade @@ -0,0 +1,34 @@ +Package: python-uno +Status: install ok installed +Priority: optional +Section: python +Installed-Size: 2032 +Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org> +Architecture: i386 +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Description: Python-UNO bridge + +Package: openoffice.org-common +Status: install ok installed +Priority: optional +Section: editors +Installed-Size: 48356 +Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org> +Architecture: all +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Description: office productivity suite -- arch-independent files + +Package: openoffice.org-emailmerge +Status: install ok installed +Priority: optional +Section: editors +Installed-Size: 1652 +Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org> +Architecture: all +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Replaces: python-uno (<< 1:2.4.1-5) +Pre-Depends: python-uno, openoffice.org-common +Description: office productivity suite -- email mail merge diff --git a/test/integration/status-bug-613420-new-garbage-dependency b/test/integration/status-bug-613420-new-garbage-dependency new file mode 100644 index 000000000..166a3930f --- /dev/null +++ b/test/integration/status-bug-613420-new-garbage-dependency @@ -0,0 +1,22 @@ +Package: openoffice.org-officebean +Status: install ok installed +Priority: optional +Section: java +Installed-Size: 1656 +Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org> +Architecture: i386 +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Depends: openoffice.org-core (= 1:3.2.1-11+squeeze2) +Description: office productivity suite -- Java bean + +Package: openoffice.org-core +Status: install ok installed +Priority: optional +Section: editors +Installed-Size: 121724 +Maintainer: Debian OpenOffice Team <debian-openoffice@lists.debian.org> +Architecture: i386 +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Description: office productivity suite -- arch-dependent files diff --git a/test/integration/test-autoremove b/test/integration/test-apt-get-autoremove index 1ca325b29..c25ce3f58 100755 --- a/test/integration/test-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -14,13 +14,10 @@ setupaptarchive aptget install unrelated debhelper -qq 2>&1 > /dev/null testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' -testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: po-debconf -Architecture: i386 -Auto-Installed: 1 -' +testmarkedauto 'po-debconf' aptget remove debhelper -y -qq 2>&1 > /dev/null -testdpkgnoninstalled 'debhelper' -testdpkginstalled 'po-debconf unrelated' +testdpkgnotinstalled 'debhelper' +testdpkginstalled 'po-debconf' 'unrelated' echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove testequal 'Reading package lists... @@ -42,9 +39,8 @@ testdpkginstalled "po-debconf" rm rootdir/etc/apt/apt.conf.d/00autoremove aptget autoremove -y -qq 2>&1 > /dev/null -testdpkgnoninstalled 'po-debconf' - -testfileequal 'rootdir/var/lib/apt/extended_states' '' +testdpkgnotinstalled 'po-debconf' +testmarkedauto sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' testfileequal 'rootdir/var/log/apt/history.log' ' diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog new file mode 100755 index 000000000..0a80cc08c --- /dev/null +++ b/test/integration/test-apt-get-changelog @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +buildsimplenativepackage 'apt' 'all' '1.0' 'stable' + +setupaptarchive +changetowebserver +aptget update -qq + +echo 'Apt::Changelogs::Server "http://localhost:8080/";' >> ./aptconfig.conf + +testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris + +aptget changelog apt -qq > apt.changelog +testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" +rm apt.changelog + +aptget changelog apt -d -qq +testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" +rm apt.changelog aptarchive/pool/apt_1.0/changelog + +aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' > apt.changelog +testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" +rm apt.changelog + +aptget changelog apt -d -qq +testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" +rm apt.changelog aptarchive/pool/apt_1.0.changelog + +testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download new file mode 100755 index 000000000..7db93c32f --- /dev/null +++ b/test/integration/test-apt-get-download @@ -0,0 +1,29 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +buildsimplenativepackage 'apt' 'all' '1.0' 'stable' +buildsimplenativepackage 'apt' 'all' '2.0' 'unstable' + +setupaptarchive + +testdownload() { + msgtest 'Test download of package file' $1 + if [ -z "$3" ]; then + aptget download ${2} + else + aptget download ${2}/${3} + fi + test -f $1 && msgpass || msgfail +} + +testdownload apt_1.0_all.deb apt stable +testdownload apt_2.0_all.deb apt + +DEBFILE="$(readlink -f aptarchive)/pool/apt_2.0_all.deb" +testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) sha256:$(sha256sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable index 25c564daa..b9f45b131 100755 --- a/test/integration/test-bug-254770-segfault-if-cache-not-buildable +++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-330162-encoded-tar-header b/test/integration/test-bug-330162-encoded-tar-header index fa01e0379..b3fae6bac 100755 --- a/test/integration/test-bug-330162-encoded-tar-header +++ b/test/integration/test-bug-330162-encoded-tar-header @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-470115-new-and-tighten-recommends b/test/integration/test-bug-470115-new-and-tighten-recommends new file mode 100755 index 000000000..6bc22ea7b --- /dev/null +++ b/test/integration/test-bug-470115-new-and-tighten-recommends @@ -0,0 +1,172 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertinstalledpackage 'cool' 'all' '1' +insertinstalledpackage 'stuff' 'all' '1' +insertinstalledpackage 'coolstuff' 'all' '1' + +insertpackage 'unstable' 'cool' 'all' '2' +insertpackage 'unstable' 'stuff' 'all' '2' +insertpackage 'unstable' 'coolstuff' 'all' '2' +insertpackage 'unstable' 'super' 'all' '2' + +insertinstalledpackage 'tighten-cool' 'all' '1' 'Recommends: cool (>= 1)' +insertpackage 'unstable' 'tighten-cool' 'all' '2' 'Recommends: cool (>= 2)' + +insertinstalledpackage 'tighten-coolorstuff' 'all' '1' 'Recommends: cool (>= 1) | stuff (>= 1)' +insertpackage 'unstable' 'tighten-coolorstuff' 'all' '2' 'Recommends: stuff (>= 2) | cool (>= 2)' + +insertinstalledpackage 'tighten-coolorstuff2' 'all' '1' 'Recommends: cool (>= 1) | stuff (>= 1)' +insertpackage 'unstable' 'tighten-coolorstuff2' 'all' '2' 'Recommends: stuff2 (>= 2) | cool (>= 2)' + +insertinstalledpackage 'newrec-cool' 'all' '1' +insertpackage 'unstable' 'newrec-cool' 'all' '2' 'Recommends: cool (>= 2)' + +insertinstalledpackage 'newrec-super' 'all' '1' +insertpackage 'unstable' 'newrec-super' 'all' '2' 'Recommends: super' + +insertinstalledpackage 'newrec-coolorstuff' 'all' '1' +insertpackage 'unstable' 'newrec-coolorstuff' 'all' '2' 'Recommends: cool (>= 2) | stuff (>= 2)' + +insertinstalledpackage 'cool-gone' 'all' '1' 'Recommends: cool (>= 1) | stuff (>= 2)' +insertpackage 'unstable' 'cool-gone' 'all' '2' 'Recommends: stuff (>= 2)' + +insertinstalledpackage 'super-overtake' 'all' '1' 'Recommends: cool | super, stuff | super' +insertpackage 'unstable' 'super-overtake' 'all' '2' 'Recommends: stuff (>= 3) | super, super | cool (>= 2)' + +insertinstalledpackage 'upgrade-over-new' 'all' '1' 'Recommends: cool' +insertpackage 'unstable' 'upgrade-over-new' 'all' '2' 'Recommends: cool (>= 2) | super' + +insertinstalledpackage 'now-satisfiable' 'all' '1' 'Recommends: cool (>= 3)' +insertpackage 'unstable' 'now-satisfiable' 'all' '2' 'Recommends: cool (>= 2)' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cool +The following packages will be upgraded: + cool tighten-cool +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst cool [1] (2 unstable [all]) +Inst tighten-cool [1] (2 unstable [all]) +Conf cool (2 unstable [all]) +Conf tighten-cool (2 unstable [all])' aptget install tighten-cool -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + stuff +The following packages will be upgraded: + stuff tighten-coolorstuff +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst stuff [1] (2 unstable [all]) +Inst tighten-coolorstuff [1] (2 unstable [all]) +Conf stuff (2 unstable [all]) +Conf tighten-coolorstuff (2 unstable [all])' aptget install tighten-coolorstuff -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cool +The following packages will be upgraded: + cool tighten-coolorstuff2 +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst cool [1] (2 unstable [all]) +Inst tighten-coolorstuff2 [1] (2 unstable [all]) +Conf cool (2 unstable [all]) +Conf tighten-coolorstuff2 (2 unstable [all])' aptget install tighten-coolorstuff2 -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cool +The following packages will be upgraded: + cool newrec-cool +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst cool [1] (2 unstable [all]) +Inst newrec-cool [1] (2 unstable [all]) +Conf cool (2 unstable [all]) +Conf newrec-cool (2 unstable [all])' aptget install newrec-cool -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + super +The following NEW packages will be installed: + super +The following packages will be upgraded: + newrec-super +1 upgraded, 1 newly installed, 0 to remove and 12 not upgraded. +Inst newrec-super [1] (2 unstable [all]) +Inst super (2 unstable [all]) +Conf newrec-super (2 unstable [all]) +Conf super (2 unstable [all])' aptget install newrec-super -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cool +The following packages will be upgraded: + cool newrec-coolorstuff +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst cool [1] (2 unstable [all]) +Inst newrec-coolorstuff [1] (2 unstable [all]) +Conf cool (2 unstable [all]) +Conf newrec-coolorstuff (2 unstable [all])' aptget install newrec-coolorstuff -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + stuff +The following packages will be upgraded: + cool-gone stuff +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst cool-gone [1] (2 unstable [all]) +Inst stuff [1] (2 unstable [all]) +Conf cool-gone (2 unstable [all]) +Conf stuff (2 unstable [all])' aptget install cool-gone -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + super +The following NEW packages will be installed: + super +The following packages will be upgraded: + super-overtake +1 upgraded, 1 newly installed, 0 to remove and 12 not upgraded. +Inst super (2 unstable [all]) +Inst super-overtake [1] (2 unstable [all]) +Conf super (2 unstable [all]) +Conf super-overtake (2 unstable [all])' aptget install super-overtake -s + +# if super would be in front, we would get a new here as it is new and +# the first option in an or-group should be the preferred one… +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cool +The following packages will be upgraded: + cool upgrade-over-new +2 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. +Inst cool [1] (2 unstable [all]) +Inst upgrade-over-new [1] (2 unstable [all]) +Conf cool (2 unstable [all]) +Conf upgrade-over-new (2 unstable [all])' aptget install upgrade-over-new -s + +# the recommends wasn't used before so while we could do it now, +# the user doesn't seem to need it so avoid upgrading it +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + now-satisfiable +1 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. +Inst now-satisfiable [1] (2 unstable [all]) +Conf now-satisfiable (2 unstable [all])' aptget install now-satisfiable -s diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed new file mode 100755 index 000000000..78c0801f2 --- /dev/null +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'libc6' 'all' '1.0' +insertpackage 'unstable' 'coolstuff' 'all' '1.0' 'Recommends: extracoolstuff' +insertpackage 'unstable' 'extracoolstuff' 'all' '1.0' 'Depends: libc6' + +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... +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 +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 diff --git a/test/integration/test-bug-593360-modifiers-in-names b/test/integration/test-bug-593360-modifiers-in-names index c12503b0d..83a3cfabf 100755 --- a/test/integration/test-bug-593360-modifiers-in-names +++ b/test/integration/test-bug-593360-modifiers-in-names @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" 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 2179ba03b..11dee0628 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -54,12 +54,14 @@ setupcompressor() { gzip) COMPRESS="gz";; bzip2) COMPRESS="bz2";; lzma) COMPRESS="lzma";; + xz) COMPRESS="xz";; 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 +Dir::Bin::lzma \"/does/not/exist\"; +Dir::Bin::xz \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor if [ -e "/bin/${COMPRESSOR}" ]; then echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor elif [ -e "/usr/bin/${COMPRESSOR}" ]; then @@ -134,9 +136,9 @@ W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over http" } -for COMPRESSOR in 'gzip' 'bzip2' 'lzma'; do testoverfile $COMPRESSOR; done +for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testoverfile $COMPRESSOR; done # do the same again with http instead of file changetowebserver -for COMPRESSOR in 'gzip' 'bzip2' 'lzma'; do testoverhttp $COMPRESSOR; done +for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testoverhttp $COMPRESSOR; done diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info index b91bf3615..914910597 100755 --- a/test/integration/test-bug-601961-install-info +++ b/test/integration/test-bug-601961-install-info @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index fa6dcdc70..2875d547a 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -1,15 +1,15 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +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 +touch rootdir/var/lib/apt/extended_states +aptmark markauto 'libvtk5.4' +testmarkedauto 'libvtk5.4' testequal "Reading package lists... Building dependency tree... diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories index 917fb106f..aae717a19 100755 --- a/test/integration/test-bug-604401-files-are-directories +++ b/test/integration/test-bug-604401-files-are-directories @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-605394-versioned-or-groups b/test/integration/test-bug-605394-versioned-or-groups index 0d7ad77f6..0f09d2927 100755 --- a/test/integration/test-bug-605394-versioned-or-groups +++ b/test/integration/test-bug-605394-versioned-or-groups @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual new file mode 100755 index 000000000..4e3e2fa0b --- /dev/null +++ b/test/integration/test-bug-611729-mark-as-manual @@ -0,0 +1,84 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +buildsimplenativepackage "peace-dpkg" "all" "1.0" "stable" + +buildsimplenativepackage "a" "all" "1.0" "stable" "Depends: b" +buildsimplenativepackage "b" "all" "1.0" "stable" +buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b" + +setupaptarchive + +# dpkg freaks out if the last package is removed so keep one around +aptget install peace-dpkg -y -qq 2>&1 > /dev/null +testdpkginstalled peace-dpkg +testmarkedauto + +aptget install a -y -qq 2>&1 > /dev/null +testdpkginstalled a b +testdpkgnotinstalled c +testmarkedauto 'b' + +aptget remove a -y -qq 2>&1 > /dev/null +testdpkgnotinstalled a c +testdpkginstalled b +testmarkedauto 'b' + +aptget install c -y -qq 2>&1 > /dev/null +testdpkgnotinstalled a +testdpkginstalled b c +testmarkedauto 'b' + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +b is already the newest version. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b --only-upgrade +testmarkedauto 'b' + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +b is already the newest version. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d +testmarkedauto 'b' + +aptget install b --reinstall -y -qq 2>&1 > /dev/null +testdpkgnotinstalled a +testdpkginstalled b c +testmarkedauto 'b' + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +b is already the newest version. +b set to manually installed. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b +testmarkedauto + +aptget remove b -y -qq 2>&1 > /dev/null +testdpkgnotinstalled a b c +testmarkedauto + +aptget install a b -y -qq 2>&1 > /dev/null +testdpkginstalled a b +testdpkgnotinstalled c +testmarkedauto + +aptget purge a b -y -qq 2>&1 > /dev/null +testdpkgnotinstalled a b c +testmarkedauto + +aptget install b c -y -qq 2>&1 > /dev/null +testdpkgnotinstalled a +testdpkginstalled b c +testmarkedauto + +aptget install a -y -qq 2>&1 > /dev/null +testdpkginstalled a b c +testmarkedauto diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts new file mode 100755 index 000000000..b8cfe59e2 --- /dev/null +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -0,0 +1,212 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" "amd64" + +buildsimplenativepackage 'peace-dpkg' 'all' '1.0' 'stable' + +buildsimplenativepackage 'libc6' 'i386' '1.0' 'stable' +buildsimplenativepackage 'libc6' 'amd64' '1.0' 'stable' +buildsimplenativepackage 'libc6' 'all' '2.0' 'testing' + +buildsimplenativepackage 'foobar' 'i386' '1.0' 'stable' 'Depends: libc6' +buildsimplenativepackage 'foobar' 'amd64' '1.0' 'stable' 'Depends: libc6' + +setupaptarchive + +aptget install peace-dpkg:i386 -y -qq 2>&1 > /dev/null +testdpkginstalled peace-dpkg + +aptget install libc6:i386 -t stable -y -qq 2>&1 > /dev/null +testdpkginstalled libc6 +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + libc6 +The following NEW packages will be installed: + libc6:amd64 +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv libc6 [1.0] +Inst libc6:amd64 (1.0 stable [amd64]) +Conf libc6:amd64 (1.0 stable [amd64])' aptget install libc6:amd64 -s -t stable + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + foobar +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar (1.0 stable [i386]) +Conf foobar (1.0 stable [i386])' aptget install foobar -st stable + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + libc6:amd64 +The following packages will be REMOVED: + libc6 +The following NEW packages will be installed: + foobar:amd64 libc6:amd64 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv libc6 [1.0] +Inst libc6:amd64 (1.0 stable [amd64]) +Inst foobar:amd64 (1.0 stable [amd64]) +Conf libc6:amd64 (1.0 stable [amd64]) +Conf foobar:amd64 (1.0 stable [amd64])' aptget install foobar:amd64 -st stable + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + foobar +The following packages will be upgraded: + libc6 +1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libc6 [1.0] (2.0 testing [all]) +Inst foobar (1.0 stable [i386]) +Conf libc6 (2.0 testing [all]) +Conf foobar (1.0 stable [i386])' aptget install foobar/stable libc6 -st testing + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be upgraded: + libc6 +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 + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + foobar +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar (1.0 stable [i386]) +Conf foobar (1.0 stable [i386])' aptget install foobar/stable -st testing + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + libc6:amd64 +The following packages will be REMOVED: + libc6 +The following NEW packages will be installed: + foobar:amd64 libc6:amd64 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv libc6 [2.0] +Inst libc6:amd64 (1.0 stable [amd64]) +Inst foobar:amd64 (1.0 stable [amd64]) +Conf libc6:amd64 (1.0 stable [amd64]) +Conf foobar:amd64 (1.0 stable [amd64])' aptget install foobar:amd64/stable -st testing + + +testequal "Reading package lists... +Building dependency tree... +Reading state information... +Selected version '1.0' (stable [i386]) for 'libc6' +The following packages will be DOWNGRADED: + libc6 +0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded. +Inst libc6 [2.0] (1.0 stable [i386]) +Conf libc6 (1.0 stable [i386])" aptget install libc6/stable -s -q=0 + + +buildsimplenativepackage 'libc6-same' 'i386' '1.0' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'libc6-same' 'amd64' '1.0' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'libc6-same' 'all' '2.0' 'testing' + +buildsimplenativepackage 'foobar-same' 'i386' '1.0' 'stable' 'Depends: libc6-same' +buildsimplenativepackage 'foobar-same' 'amd64' '1.0' 'stable' 'Depends: libc6-same' + +setupaptarchive + +aptget install libc6-same:i386 -t stable -y -qq 2>&1 > /dev/null +testdpkginstalled libc6-same + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + foobar-same +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar-same (1.0 stable [i386]) +Conf foobar-same (1.0 stable [i386])' aptget install foobar-same -st stable + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + libc6-same:amd64 +The following NEW packages will be installed: + foobar-same:amd64 libc6-same:amd64 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libc6-same:amd64 (1.0 stable [amd64]) +Inst foobar-same:amd64 (1.0 stable [amd64]) +Conf libc6-same:amd64 (1.0 stable [amd64]) +Conf foobar-same:amd64 (1.0 stable [amd64])' aptget install foobar-same:amd64 -st stable + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + libc6-same:amd64 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libc6-same:amd64 (1.0 stable [amd64]) +Conf libc6-same:amd64 (1.0 stable [amd64])' aptget install libc6-same:amd64 -s -t stable + +# FIXME: We should test installing libc6-same:amd64 here, but dpkg doesn't allow it currently + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be upgraded: + libc6-same +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 + +testequal "Reading package lists... +Building dependency tree... +Reading state information... +Selected version '1.0' (stable [i386]) for 'libc6-same' +The following packages will be DOWNGRADED: + libc6-same +0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded. +Inst libc6-same [2.0] (1.0 stable [i386]) +Conf libc6-same (1.0 stable [i386])" aptget install libc6-same/stable -s -q=0 + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + foobar-same +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foobar-same (1.0 stable [i386]) +Conf foobar-same (1.0 stable [i386])' aptget install foobar-same/stable -st testing + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + libc6-same:amd64 +The following packages will be REMOVED: + libc6-same +The following NEW packages will be installed: + foobar-same:amd64 libc6-same:amd64 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv libc6-same [2.0] +Inst libc6-same:amd64 (1.0 stable [amd64]) +Inst foobar-same:amd64 (1.0 stable [amd64]) +Conf libc6-same:amd64 (1.0 stable [amd64]) +Conf foobar-same:amd64 (1.0 stable [amd64])' aptget install foobar-same:amd64/stable -st testing diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade new file mode 100755 index 000000000..8efd1687a --- /dev/null +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -0,0 +1,60 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'unrelated' 'all' '1:3.3.0-2' +insertpackage 'unstable' 'python-uno' 'all' '1:3.3.0-2' 'Depends: libreoffice-common' +insertpackage 'unstable' 'libreoffice-common' 'all' '1:3.3.0-2' 'Conflicts: openoffice.org-common' + +setupaptarchive + +touch rootdir/var/lib/apt/extended_states +aptmark markauto python-uno openoffice.org-common +#aptmark unmarkauto openoffice.org-emailmerge +testmarkedauto python-uno openoffice.org-common + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + libreoffice-common +The following packages will be REMOVED: + openoffice.org-common openoffice.org-emailmerge +The following NEW packages will be installed: + libreoffice-common +The following packages will be upgraded: + python-uno +1 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. +After this operation, 53.2 MB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno + +aptmark markauto openoffice.org-emailmerge +testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following extra packages will be installed: + libreoffice-common +The following packages will be REMOVED: + openoffice.org-common openoffice.org-emailmerge +The following NEW packages will be installed: + libreoffice-common +The following packages will be upgraded: + python-uno +1 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. +After this operation, 53.2 MB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + openoffice.org-common openoffice.org-emailmerge python-uno +0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. +After this operation, 53.3 MB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation.' aptget autoremove --trivial-only diff --git a/test/integration/test-bug-612958-use-dpkg-multiarch-config b/test/integration/test-bug-612958-use-dpkg-multiarch-config new file mode 100755 index 000000000..4f31c3953 --- /dev/null +++ b/test/integration/test-bug-612958-use-dpkg-multiarch-config @@ -0,0 +1,59 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' +setupaptarchive + +insertinstalledpackage 'libapt' 'i386' '1.0' +insertinstalledpackage 'libapt' 'amd64' '1.0' +insertinstalledpackage 'libapt' 'armel' '1.0' + +testpass() { + rm rootdir/var/cache/apt/*.bin + msgtest 'Test architecture handling' "$1 with $2" + aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail +} + +testfail() { + rm rootdir/var/cache/apt/*.bin + msgtest 'Test architecture handling' "$1 with $2" + aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass +} + +testpass 'no config' 'i386' +testfail 'no config' 'amd64' +testfail 'no config' 'armel' + +CONFFILE=rootdir/etc/apt/apt.conf.d/99multiarch +echo '#clear APT::Architectures;' >> $CONFFILE +echo 'APT::Architectures:: "i386";' >> $CONFFILE +echo 'APT::Architectures:: "amd64";' >> $CONFFILE + +testpass 'apt config' 'i386' +testpass 'apt config' 'amd64' +testfail 'apt config' 'armel' + +echo 'APT::Architectures:: "armel";' >> $CONFFILE + +testpass 'apt config' 'armel' + +rm $CONFFILE + +echo '#clear APT::Architectures;' >> $CONFFILE +echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE + +echo '#! /bin/sh +echo "amd64"' > ./dpkg-printer +chmod +x ./dpkg-printer + +testpass 'dpkg config' 'i386' +testpass 'dpkg config' 'amd64' +testfail 'dpkg config' 'armel' + +echo '#! /bin/sh +echo "amd64 armel"' > ./dpkg-printer + +testpass 'dpkg config' 'armel' diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency new file mode 100755 index 000000000..34cf38cbc --- /dev/null +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'libreoffice' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core' +insertpackage 'unstable' 'libreoffice-core' 'all' '1:3.3.1~rc1-2' 'Conflicts: openoffice.org-core' +insertpackage 'unstable' 'libreoffice-officebean' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core' +insertpackage 'unstable' 'openoffice.org-officebean' 'all' '1:3.3.0-5' 'Depends: libreoffice-officebean' + + +setupaptarchive + +touch rootdir/var/lib/apt/extended_states +aptmark markauto openoffice.org-officebean +testmarkedauto openoffice.org-officebean + +testequal "Reading package lists... +Building dependency tree... +Reading state information... +The following packages were automatically installed and are no longer required: + openoffice.org-officebean libreoffice-officebean +Use 'apt-get autoremove' to remove them. +The following extra packages will be installed: + libreoffice-core libreoffice-officebean openoffice.org-officebean +The following packages will be REMOVED: + openoffice.org-core +The following NEW packages will be installed: + libreoffice libreoffice-core libreoffice-officebean +The following packages will be upgraded: + openoffice.org-officebean +1 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +After this operation, 126 MB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation." aptget install libreoffice --trivial-only diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep new file mode 100755 index 000000000..7e384e428 --- /dev/null +++ b/test/integration/test-bug-618288-multiarch-same-lockstep @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertinstalledpackage 'libsame' 'i386,amd64' '1' 'Multi-Arch: same' 'required' +insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1) +Essential: yes' 'required' +insertinstalledpackage 'apt2' 'amd64' '1' 'Depends: libsame (= 1) +Essential: yes' 'required' +buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same' '' 'required' +buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required' +buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + apt:i386 apt2 libsame libsame:i386 +4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst libsame [1] (2 unstable [amd64]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:i386 apt2:amd64 ] +Inst libsame:i386 [1] (2 unstable [i386]) [apt2:amd64 apt:i386 ] +Conf libsame:i386 (2 unstable [i386]) [apt2:amd64 apt:i386 ] +Conf libsame (2 unstable [amd64]) [apt2:amd64 apt:i386 ] +Inst apt2 [1] (2 unstable [amd64]) [apt:i386 ] +Conf apt2 (2 unstable [amd64]) [apt:i386 ] +Inst apt:i386 [1] (2 unstable [i386]) +Conf apt:i386 (2 unstable [i386])' aptget dist-upgrade -s diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests new file mode 100755 index 000000000..5148be640 --- /dev/null +++ b/test/integration/test-bug-618848-always-respect-user-requests @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertinstalledpackage 'libdb4.8' 'all' '1.0' +insertinstalledpackage 'exim4' 'all' '1.0' 'Depends: exim4-daemon-light | exim4-daemon-heavy' +insertinstalledpackage 'exim4-daemon-light' 'all' '1.0' 'Depends: libdb4.8' +insertpackage 'unstable' 'exim4-daemon-heavy' 'all' '1.0' 'Depends: libdb4.8' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... + MarkDelete libdb4.8 [ i386 ] < 1.0 > ( other ) FU=1 + MarkDelete exim4-daemon-light [ i386 ] < 1.0 > ( other ) FU=1 + MarkInstall exim4-daemon-heavy [ i386 ] < none -> 1.0 > ( other ) FU=0 + Ignore MarkInstall of libdb4.8 [ i386 ] < 1.0 > ( other ) as its mode (Delete) is protected + MarkDelete exim4-daemon-heavy [ i386 ] < none -> 1.0 > ( other ) FU=0 + MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=1 +The following packages will be REMOVED: + exim4 exim4-daemon-light libdb4.8 + MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=1 +0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. +Remv exim4 [1.0] + MarkDelete exim4-daemon-light [ i386 ] < 1.0 > ( other ) FU=1 +Remv exim4-daemon-light [1.0] + MarkDelete libdb4.8 [ i386 ] < 1.0 > ( other ) FU=1 +Remv libdb4.8 [1.0]' aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 diff --git a/test/integration/test-changelog b/test/integration/test-changelog deleted file mode 100755 index 292df6e32..000000000 --- a/test/integration/test-changelog +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework - -setupenvironment -configarchitecture "i386" - -# this will be valid until ubuntu lucid is EOL (04/2015) -pkgchangelogtest="Package: apt -Architecture: i386 -Version: 0.7.25.3ubuntu7 -Filename: pool/main/a/apt/apt_0.7.25.3ubuntu7_i386.deb -Section: admin -" -cat <<-EOF >aptarchive/Packages -$pkgchangelogtest -EOF - -setupaptarchive - -echo "Apt::Changelogs::Server \"http://changelogs.ubuntu.com/\";" >> ./aptconfig.conf -msgnmsg "apt-get changelog: " -aptget changelog apt -qq > downloaded-changelog -expected="apt (0.7.25.3ubuntu7) lucid; urgency=low" -got="$(head -n1 downloaded-changelog)" -if [ -s downloaded-changelog ] && [ "$got" = "$expected" ]; then - msgpass -else - msgfail - msgwarn "$got != $expected" -fi - diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index 12d215d7a..b5d565c2f 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -31,7 +31,7 @@ setupaptarchive aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null -testfileequal "rootdir/var/lib/apt/extended_states" "" # old-pkg is manual installed +testmarkedauto # old-pkg is manual installed local CMD="aptget dist-upgrade -y -q=0" msgtest "Test for equality of" "$CMD" @@ -51,4 +51,4 @@ Install: new-pkg:i386 (2.0, automatic) Upgrade: old-pkg:i386 (1.0, 2.0) Disappeared: old-pkg (1.0)" -testfileequal "rootdir/var/lib/apt/extended_states" "" # new-pkg should have get the manual flag from old-pkg +testmarkedauto # new-pkg should have get the manual flag from old-pkg diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups new file mode 100755 index 000000000..20b314074 --- /dev/null +++ b/test/integration/test-handling-broken-orgroups @@ -0,0 +1,108 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'cool' 'all' '1.0-1' +insertpackage 'unstable' 'stuff' 'all' '1.0-1' +insertpackage 'unstable' 'coolstuff' 'all' '1.0-1' 'Depends: cool | stuff' +insertpackage 'unstable' 'coolstuff2' 'all' '1.0-1' 'Depends: cool2 | stuff' +insertpackage 'unstable' 'coolstuff-broken' 'all' '1.0-1' 'Depends: cool2 | stuff2' +insertpackage 'unstable' 'coolstuff-brokenrec' 'all' '1.0-1' 'Recommends: cool2 | stuff2' +insertpackage 'unstable' 'coolstuff-conflict' 'all' '1.0-1' 'Depends: cool | stuff +Conflicts: cool' +insertpackage 'unstable' 'coolstuff-provided' 'all' '1.0-1' 'Depends: cool2 | stuff-abi' +insertpackage 'unstable' 'extrastuff' 'all' '1.0-1' 'Provides: stuff-abi' + +insertpackage 'unstable' 'coolstuff-provided-broken' 'all' '1.0-1' 'Depends: cool2 | stuff-abi-2' +insertpackage 'unstable' 'extrastuff' 'all' '1.0-1' 'Depends: stuff2 +Provides: stuff-abi-2' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cool +The following NEW packages will be installed: + cool coolstuff +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst cool (1.0-1 unstable [all]) +Inst coolstuff (1.0-1 unstable [all]) +Conf cool (1.0-1 unstable [all]) +Conf coolstuff (1.0-1 unstable [all])' aptget install coolstuff -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + stuff +The following NEW packages will be installed: + coolstuff2 stuff +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst stuff (1.0-1 unstable [all]) +Inst coolstuff2 (1.0-1 unstable [all]) +Conf stuff (1.0-1 unstable [all]) +Conf coolstuff2 (1.0-1 unstable [all])' aptget install coolstuff2 -s + +testequal 'Reading package lists... +Building dependency tree... +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: + coolstuff-broken : Depends: cool2 but it is not installable or + stuff2 but it is not installable +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken -s + +testequal 'Reading package lists... +Building dependency tree... +Recommended packages: + cool2 stuff2 +The following NEW packages will be installed: + coolstuff-brokenrec +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst coolstuff-brokenrec (1.0-1 unstable [all]) +Conf coolstuff-brokenrec (1.0-1 unstable [all])' aptget install coolstuff-brokenrec -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + stuff +The following NEW packages will be installed: + coolstuff-conflict stuff +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst stuff (1.0-1 unstable [all]) +Inst coolstuff-conflict (1.0-1 unstable [all]) +Conf stuff (1.0-1 unstable [all]) +Conf coolstuff-conflict (1.0-1 unstable [all])' aptget install coolstuff-conflict -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + extrastuff +The following NEW packages will be installed: + coolstuff-provided extrastuff +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst extrastuff (1.0-1 unstable [all]) +Inst coolstuff-provided (1.0-1 unstable [all]) +Conf extrastuff (1.0-1 unstable [all]) +Conf coolstuff-provided (1.0-1 unstable [all])' aptget install coolstuff-provided -s + +testequal 'Reading package lists... +Building dependency tree... +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: + coolstuff-provided-broken : Depends: cool2 but it is not installable or + stuff-abi-2 +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken -s diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index 5736945ab..0970cb935 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" @@ -416,4 +416,4 @@ 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 +E: Unable to correct problems, you have held broken packages." aptget install uninstallablepkg/experimental --trivial-only -V -q=0 diff --git a/test/integration/test-ubuntu-bug-365611-long-package-names b/test/integration/test-ubuntu-bug-365611-long-package-names new file mode 100755 index 000000000..894c8dc97 --- /dev/null +++ b/test/integration/test-ubuntu-bug-365611-long-package-names @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" +setupaptarchive + +aptget install $(for i in $(seq 0 1000); do echo -n 'a'; done) 2> longpackagename.log > /dev/null || true +testfileequal 'longpackagename.log' "E: Unable to locate package $(for i in $(seq 0 1000); do echo -n 'a'; done)" diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge new file mode 100755 index 000000000..93b67fc02 --- /dev/null +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +setupsimplenativepackage 'compiz-core' 'i386' '1.0' 'unstable' +BUILDDIR='incoming/compiz-core-1.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo=bar;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' +rm -rf "$BUILDDIR" + +setupaptarchive + + +testdpkgnotinstalled compiz-core +msgtest 'Install package' 'compiz-core' +aptget install compiz-core -qq 2>&1 >/dev/null && msgpass || msgfail +testdpkginstalled compiz-core + +msgtest 'Remove package' 'compiz-core' +aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail +testdpkgnotinstalled compiz-core + +msgtest 'Check that conffiles are still around for' 'compiz-core' +dpkg -l compiz-core | grep '^rc' 2>&1 >/dev/null && msgpass || msgfail + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + compiz-core* +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Purg compiz-core' aptget purge compiz-core -s |