diff options
Diffstat (limited to 'test/integration')
27 files changed, 1405 insertions, 81 deletions
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 <debian-gcc@lists.debian.org> +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 <deity@lists.debian.org> +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 <deity@lists.debian.org> +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/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 <deity@lists.debian.org> +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 <bottoms@debian.org> +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 <bottoms@debian.org> +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 <pkg-games-devel@lists.alioth.debian.org> +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 <pkg-multimedia-maintainers@lists.alioth.debian.org> +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/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 <deity@lists.debian.org> +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 <debian-glibc@lists.debian.org> +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 <clint@gnu.org> +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/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 <deity@lists.debian.org> +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 <deity@lists.debian.org> +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/create-test-data b/test/integration/create-test-data index ff9405502..581b62910 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,7 +21,12 @@ 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#") -aptcache show $LISTOFPKGS --no-all-versions 2> /dev/null > $TMPGEN +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> $WORKDIR/error.lst > $TMPGEN sed -i $TMPGEN \ -e '/^ / d' \ -e '/^SHA1: / d' -e '/^SHA256: / d' \ @@ -24,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' \ diff --git a/test/integration/deb-bug-330162-encoded-tar-header.deb b/test/integration/deb-bug-330162-encoded-tar-header.deb Binary files differnew file mode 100644 index 000000000..f38b1aa70 --- /dev/null +++ b/test/integration/deb-bug-330162-encoded-tar-header.deb diff --git a/test/integration/framework b/test/integration/framework index f78ae2ee1..fe1db14bc 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; } @@ -78,6 +82,20 @@ 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 +} + +addtrap() { + CURRENTTRAP="$CURRENTTRAP $1" + trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +} setupenvironment() { TMPWORKINGDIRECTORY=$(mktemp -d) @@ -86,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 @@ -107,8 +124,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 fi cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/ ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg @@ -116,6 +135,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 "Dir::Bin::methods \"${BUILDDIRECTORY}/methods\";" >> aptconfig.conf echo "DPKG::options:: \"dpkg\";" >> aptconfig.conf @@ -123,6 +143,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" } @@ -168,8 +189,12 @@ Maintainer: Joe Sixpack <joe@example.org> 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} @@ -199,9 +224,57 @@ buildsimplenativepackage() { else DISTSECTION="$(echo "$SECTION" | cut -d'/' -f 1)" fi - setupsimplenativepackage "$NAME" "$ARCH" "$VERSION" "$RELEASE" "$DEPENDENCIES" "$DESCRIPTION" "$SECTION" - buildpackage "incoming/${NAME}-${VERSION}" "$RELEASE" "$DISTSECTION" - rm -rf "incoming/${NAME}-${VERSION}" + local BUILDDIR=${TMPWORKINGDIRECTORY}/incoming/${NAME}-${VERSION} + + 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 +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 <joe@example.org> $(date -R)" > ${BUILDDIR}/debian/changelog + echo "Source: $NAME +Section: $SECTION +Priority: optional +Maintainer: Joe Sixpack <joe@example.org> +Standards-Version: 3.9.1 + +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} + 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 -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 + rm -rf "${BUILDDIR}" + msgdone "info" } buildpackage() { @@ -255,6 +328,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/"; @@ -308,6 +383,38 @@ 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: 42 +Maintainer: Joe Sixpack <joe@example.org> +Architecture: $ARCH +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, + 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 @@ -316,36 +423,47 @@ 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 + 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… " + 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 + if [ "$CODENAME" = "experimental" -o "$CODENAME" = "experimental2" ]; 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 fi - if [ -f Sources ]; then - msgninfo "\tSources file… " - cat Sources | gzip > Sources.gz - cat Sources | bzip2 > Sources.bz2 - cat Sources | lzma > Sources.lzma - msgdone "info" + if [ "$DATE" != "now" ]; then + for release in $(find ./aptarchive -name 'Release'); do + touch -d "$1" $release + done fi - msgninfo "\tRelease file… " - aptftparchive -qq release . | sed -e '/0 Release$/ d' > Release # remove the self reference msgdone "info" - cd .. } setupdistsaptarchive() { @@ -405,6 +523,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" } @@ -412,8 +531,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" - 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/#" @@ -447,17 +565,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 @@ -468,7 +587,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() { @@ -485,11 +603,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() { diff --git a/test/integration/marvinparanoid.pub b/test/integration/marvinparanoid.pub Binary files differnew file mode 100644 index 000000000..9a59c2e40 --- /dev/null +++ b/test/integration/marvinparanoid.pub diff --git a/test/integration/marvinparanoid.sec b/test/integration/marvinparanoid.sec Binary files differnew file mode 100644 index 000000000..ff54e8680 --- /dev/null +++ b/test/integration/marvinparanoid.sec diff --git a/test/integration/run-tests b/test/integration/run-tests index c7ea0a61a..7314e6b61 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=4 +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 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 <debian-dpkg@lists.debian.org> +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 <ametzler@debian.org> +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 <debian-tex-maint@lists.debian.org> +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 <joe@example.org> +Architecture: i386 +Version: 4.13a.dfsg.1-6 +Description: ultra hypercool important package 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 <bottoms@debian.org> +Architecture: i386 +Source: vtk +Version: 5.4.2-7 +Description: Visualization Toolkit - A high level 3D visualization library 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 <deity@lists.debian.org> +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 <debian-glibc@lists.debian.org> +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 <joe@example.org> +Architecture: all +Version: 1-1 +Description: Old crappy nothing package 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 diff --git a/test/integration/test-bug-330162-encoded-tar-header b/test/integration/test-bug-330162-encoded-tar-header new file mode 100755 index 000000000..fa01e0379 --- /dev/null +++ b/test/integration/test-bug-330162-encoded-tar-header @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +msgtest 'Test apt-ftparchive with encoded tar header package' +cp $TESTDIR/deb-bug-330162-encoded-tar-header.deb aptarchive/ +test -z "$(aptftparchive packages aptarchive/ 2>&1 | grep 'E:')" && msgpass || msgfail 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 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..684559aa7 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() { @@ -31,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 } @@ -42,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 } @@ -55,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 @@ -73,31 +75,27 @@ testoverfile() { setupcompressor "$1" createemptyfile 'en' - testaptgetupdate "Get:1 file: Release.gpg [] -Get:2 file: Release [] -Ign file:$(readlink -f aptarchive)/ Translation-en + testaptgetupdate "Get:1 file: InRelease [] +Ign file: 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 [] + 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: Release.gpg [] -Get:2 file: Release [] + testaptgetupdate "Get:1 file: InRelease [] +Ign file: Translation-en 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" } @@ -106,36 +104,32 @@ testoverhttp() { setupcompressor "$1" createemptyfile 'en' - testaptgetupdate "Get:1 http://localhost Release.gpg [] -Get:2 http://localhost/ Translation-en -Get:3 http://localhost Release [] -Ign http://localhost/ Translation-en -Get:4 http://localhost Packages [] + testaptgetupdate "Get:1 http://localhost InRelease [] +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 Release.gpg [] -Get:2 http://localhost/ Translation-en [] -Get:3 http://localhost Release [] -Get:4 http://localhost Packages [] + testaptgetupdate "Get:1 http://localhost InRelease [] +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 Release.gpg [] -Ign http://localhost/ Translation-en -Get:2 http://localhost Release [] -Get:3 http://localhost Packages [] + testaptgetupdate "Get:1 http://localhost InRelease [] +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 Release.gpg [] -Ign http://localhost/ Translation-en -Get:2 http://localhost Release [] -Get:3 http://localhost Packages + testaptgetupdate "Get:1 http://localhost InRelease [] +Get:2 http://localhost Packages +Ign http://localhost Translation-en 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" } 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/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 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 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 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' 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 diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index a70b6122c..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,14 +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 +find aptarchive -name 'Packages*' -type f -delete aptget update -qq testnopackage oldstuff diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching new file mode 100755 index 000000000..5736945ab --- /dev/null +++ b/test/integration/test-release-candidate-switching @@ -0,0 +1,419 @@ +#!/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-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-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-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-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-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-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-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) + 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) + 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) + 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) + 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-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-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) +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) + 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 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 |