X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a2d40703e4a5590a689ace4466f92e590434944d..3abb6a6a1e485b3bc899b64b0a1b7dc2db25a9c2:/test/integration/test-compressed-indexes diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index 805ed5964..49ffc4a8a 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -1,8 +1,8 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configcompression '.' 'xz' 'bz2' 'lzma' 'gz' @@ -31,36 +31,43 @@ testrun() { local F msgtest 'Check if all index files are' "${1:-uncompressed}" if [ "$1" = 'compressed' ]; then - ! test -e rootdir/var/lib/apt/lists/*_Packages || F=1 + ! test -e rootdir/var/lib/apt/lists/*i386_Packages || F=1 + ! test -e rootdir/var/lib/apt/lists/*all_Packages || F=1 ! test -e rootdir/var/lib/apt/lists/*_Sources || F=1 ! test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1 - test -e rootdir/var/lib/apt/lists/*_Packages.${COMPRESS} || F=1 + test -e rootdir/var/lib/apt/lists/*i386_Packages.${COMPRESS} || F=1 + test -e rootdir/var/lib/apt/lists/*all_Packages.${COMPRESS} || F=1 test -e rootdir/var/lib/apt/lists/*_Sources.${COMPRESS} || F=1 test -e rootdir/var/lib/apt/lists/*_Translation-en.${COMPRESS} || F=1 # there is no point in trying pdiff if we have compressed indexes # as we can't patch compressed files (well, we can, but what is the point?) - ! test -e rootdir/var/lib/apt/lists/*.IndexDiff || F=1 + ! test -e rootdir/var/lib/apt/lists/*diff_Index || F=1 else # clear the faked pdiff indexes so the glob below works - rm -f rootdir/var/lib/apt/lists/*.IndexDiff - test -e rootdir/var/lib/apt/lists/*_Packages || F=1 + rm -f rootdir/var/lib/apt/lists/*diff_Index + test -e rootdir/var/lib/apt/lists/*i386_Packages || F=1 + test -e rootdir/var/lib/apt/lists/*all_Packages || F=1 test -e rootdir/var/lib/apt/lists/*_Sources || F=1 test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1 - ! test -e rootdir/var/lib/apt/lists/*_Packages.* || F=1 + ! test -e rootdir/var/lib/apt/lists/*i386_Packages.* || F=1 + ! test -e rootdir/var/lib/apt/lists/*all_Packages.* || F=1 ! test -e rootdir/var/lib/apt/lists/*_Sources.* || F=1 ! test -e rootdir/var/lib/apt/lists/*_Translation-en.* || F=1 fi if [ -n "$F" ]; then + cat rootdir/tmp/testsuccess.output ls -laR rootdir/var/lib/apt/lists/ msgfail else msgpass fi msgtest 'Check if package is downloadable' + cd downloaded testsuccess --nomsg aptget download testpkg - msgtest '\tdeb file is present'; testsuccess --nomsg test -f testpkg_1.0_i386.deb - rm testpkg_1.0_i386.deb - testequal 'Reading package lists... + msgtest 'deb file is present'; testsuccess --nomsg test -f testpkg_1.0_i386.deb + rm -f testpkg_1.0_i386.deb + cd - >/dev/null + testsuccessequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: testpkg @@ -68,27 +75,30 @@ The following NEW packages will be installed: Inst testpkg (1.0 unstable [i386]) Conf testpkg (1.0 unstable [i386])' aptget install testpkg -s rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin - testequal "$GOODSHOW" aptcache show testpkg - testequal "$GOODSHOW" aptcache show testpkg + testsuccessequal "$GOODSHOW" aptcache show testpkg + testsuccessequal "$GOODSHOW" aptcache show testpkg rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin - testequal "$GOODPOLICY" aptcache policy testpkg - testequal "$GOODPOLICY" aptcache policy testpkg + testsuccessequal "$GOODPOLICY" aptcache policy testpkg + testsuccessequal "$GOODPOLICY" aptcache policy testpkg rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin - testequal "$GOODSHOWSRC" aptcache showsrc testpkg - testequal "$GOODSHOWSRC" aptcache showsrc testpkg + testsuccessequal "$GOODSHOWSRC" aptcache showsrc testpkg + testsuccessequal "$GOODSHOWSRC" aptcache showsrc testpkg aptget clean msgtest 'Check if the source is aptgetable' + cd downloaded testsuccess --nomsg aptget source testpkg - msgtest '\tdsc file is present'; testsuccess --nomsg test -f testpkg_1.0.dsc - msgtest '\tdirectory is present'; testsuccess --nomsg test -d testpkg-1.0 + testsuccess test -s testpkg_1.0.dsc + testsuccess test -d testpkg-1.0 rm -rf testpkg-1.0* - testequal "$(aptcache show testpkg -o Acquire::Languages=none) + cd - >/dev/null + testsuccessequal "$(aptcache show testpkg -o Acquire::Languages=none) " aptcache dumpavail } echo 'Debug::pkgAcquire::worker "true"; debug::pkgAcquire::Auth "true"; -Debug::pkgAcquire::Diffs "true";' > rootdir/etc/apt/apt.conf.d/99debugconf +Debug::pkgAcquire::Diffs "true"; +Debug::Acquire::http "true";' > rootdir/etc/apt/apt.conf.d/99debugconf testovermethod() { forcecompressor $2 @@ -97,23 +107,28 @@ testovermethod() { rm -rf rootdir/var/lib/apt/lists echo "Acquire::GzipIndexes \"${INDEX}\";" > rootdir/etc/apt/apt.conf.d/02compressindex local INDCOMP - if [ "$INDEX" = 'false' ]; then + if [ "$INDEX" = 'false' -o "$1" = 'cdrom' ]; then INDCOMP='uncompressed' else INDCOMP='compressed' fi + msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes gzip=$INDEX" + if [ "${1}" = 'cdrom' ]; then + testsuccess aptcdrom add