X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3e68f7e41022790619c698a32390a5256fadba7c..3abb6a6a1e485b3bc899b64b0a1b7dc2db25a9c2:/test/integration/test-compressed-indexes?ds=sidebyside diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index 92e7c0e84..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,10 +31,12 @@ 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 @@ -43,10 +45,12 @@ testrun() { else # clear the faked pdiff indexes so the glob below works rm -f rootdir/var/lib/apt/lists/*diff_Index - 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.* || 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 @@ -60,10 +64,10 @@ testrun() { 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 + msgtest 'deb file is present'; testsuccess --nomsg test -f testpkg_1.0_i386.deb + rm -f testpkg_1.0_i386.deb cd - >/dev/null - testequal 'Reading package lists... + testsuccessequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: testpkg @@ -71,14 +75,14 @@ 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 @@ -87,7 +91,7 @@ Conf testpkg (1.0 unstable [i386])' aptget install testpkg -s testsuccess test -d testpkg-1.0 rm -rf testpkg-1.0* cd - >/dev/null - testequal "$(aptcache show testpkg -o Acquire::Languages=none) + testsuccessequal "$(aptcache show testpkg -o Acquire::Languages=none) " aptcache dumpavail } @@ -134,31 +138,44 @@ testsuccess aptget update GOODSHOW="$(aptcache show testpkg) " 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 +testsuccessequal "$GOODSHOW" aptcache show testpkg GOODSHOWSRC="$(aptcache showsrc testpkg) " 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 +testsuccessequal "$GOODSHOWSRC" aptcache showsrc testpkg GOODPOLICY="$(aptcache policy testpkg)" -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 "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4 || msgdie 'file policy is broken' +testsuccessequal "$GOODPOLICY" aptcache policy testpkg for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'file' $COMPRESSOR; done -changetowebserver +rewritesourceslist "copy://${TMPWORKINGDIRECTORY}/aptarchive" rm -rf rootdir/var/lib/apt/lists testsuccess aptget update GOODPOLICY="$(aptcache policy testpkg)" -test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 || msgdie 'policy is broken' -testequal "$GOODPOLICY" aptcache policy testpkg +test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 copy:/' | wc -l) -eq 4 || msgdie 'copy policy is broken' +testsuccessequal "$GOODPOLICY" aptcache policy testpkg +for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'copy' $COMPRESSOR; done +changetowebserver +rm -rf rootdir/var/lib/apt/lists +testsuccess aptget update +GOODPOLICY="$(aptcache policy testpkg)" +test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 || msgdie 'http policy is broken' +testsuccessequal "$GOODPOLICY" aptcache policy testpkg for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'http' $COMPRESSOR; done +changetohttpswebserver +rm -rf rootdir/var/lib/apt/lists +testsuccess aptget update +GOODPOLICY="$(aptcache policy testpkg)" +test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 https://' | wc -l) -eq 4 || msgdie 'https policy is broken' +testsuccessequal "$GOODPOLICY" aptcache policy testpkg +for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'https' $COMPRESSOR; done + changetocdrom 'Debian APT Testdisk 0.8.15' rm -rf rootdir/var/lib/apt/lists testsuccess aptcdrom add