]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-compressed-indexes
test/integration/test-bug-624218-Translation-file-handling: clarify when Translation...
[apt.git] / test / integration / test-compressed-indexes
index 805ed5964c9298e1f2b78ea78c0bdec19d25a278..72b262e84421037f3aee057000ddadfc4312ef4d 100755 (executable)
@@ -39,10 +39,10 @@ testrun() {
                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/*_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
        else
                # clear the faked pdiff indexes so the glob below works
-               rm -f rootdir/var/lib/apt/lists/*.IndexDiff
+               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/*_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/*_Sources || F=1
                test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1
@@ -51,6 +51,7 @@ testrun() {
                ! test -e rootdir/var/lib/apt/lists/*_Translation-en.* || F=1
        fi
        if [ -n "$F" ]; then
                ! 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
                ls -laR rootdir/var/lib/apt/lists/
                msgfail
        else
@@ -88,7 +89,8 @@ Conf testpkg (1.0 unstable [i386])' aptget install testpkg -s
 
 echo 'Debug::pkgAcquire::worker "true";
 debug::pkgAcquire::Auth "true";
 
 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
 
 testovermethod() {
        forcecompressor $2
@@ -97,23 +99,28 @@ testovermethod() {
                rm -rf rootdir/var/lib/apt/lists
                echo "Acquire::GzipIndexes \"${INDEX}\";" > rootdir/etc/apt/apt.conf.d/02compressindex
                local INDCOMP
                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
 
                        INDCOMP='uncompressed'
                else
                        INDCOMP='compressed'
                fi
 
+               msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes gzip=$INDEX"
+               if [ "${1}" = 'cdrom' ]; then
+                       testsuccess aptcdrom add </dev/null
+               fi
                testsuccess aptget update
                testsuccess aptget update
-               msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes"
                testrun "$INDCOMP"
 
                testrun "$INDCOMP"
 
-               testsuccess aptget update -o Acquire::Pdiffs=1
-               msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes (update unchanged with pdiffs)"
-               testrun "$INDCOMP"
+               if [ "${1}" != 'cdrom' ]; then
+                       testsuccess aptget update -o Acquire::Pdiffs=1
+                       msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes gzip=$INDEX (update unchanged with pdiffs)"
+                       testrun "$INDCOMP"
 
 
-               testsuccess aptget update -o Acquire::Pdiffs=0
-               msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes (update unchanged without pdiffs)"
-               testrun "$INDCOMP"
+                       testsuccess aptget update -o Acquire::Pdiffs=0
+                       msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes gzip=$INDEX (update unchanged without pdiffs)"
+                       testrun "$INDCOMP"
+               fi
 
                rm rootdir/etc/apt/apt.conf.d/02compressindex
        done
 
                rm rootdir/etc/apt/apt.conf.d/02compressindex
        done
@@ -142,3 +149,12 @@ test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^  Candidate:' -e '^  Instal
 testequal "$GOODPOLICY" aptcache policy testpkg
 
 for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'http' $COMPRESSOR; done
 testequal "$GOODPOLICY" aptcache policy testpkg
 
 for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'http' $COMPRESSOR; done
+
+changetocdrom 'Debian APT Testdisk 0.8.15'
+rm -rf rootdir/var/lib/apt/lists
+testsuccess aptcdrom add </dev/null
+GOODPOLICY="$(aptcache policy testpkg)"
+test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^  Candidate:' -e '^  Installed: (none)' -e '500 cdrom://' | wc -l) -eq 4 || msgdie 'policy is broken'
+testequal "$GOODPOLICY" aptcache policy testpkg
+
+for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'cdrom' $COMPRESSOR; done