summaryrefslogtreecommitdiff
path: root/test/integration/test-compressed-indexes
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-compressed-indexes')
-rwxr-xr-xtest/integration/test-compressed-indexes72
1 files changed, 46 insertions, 26 deletions
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 805ed5964..c6b292baa 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -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/*.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
+ 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
@@ -51,16 +51,19 @@ testrun() {
! 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...
+ 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 +71,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 +103,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 </dev/null
+ fi
testsuccess aptget update
- msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes"
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
@@ -123,14 +134,14 @@ 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
+testsuccessequal "$GOODPOLICY" aptcache policy testpkg
for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'file' $COMPRESSOR; done
@@ -139,6 +150,15 @@ 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
+testsuccessequal "$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'
+testsuccessequal "$GOODPOLICY" aptcache policy testpkg
+
+for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'cdrom' $COMPRESSOR; done