diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-24 21:44:11 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-24 21:44:11 +0200 |
commit | 17ea77d3332ce3abbbc96a9e110a37ae055ac422 (patch) | |
tree | 611708d199721f5bca0ea4826d03da0016f3780d /test/integration/test-compressed-indexes | |
parent | 7e32e3e58d5499056b17acd0a9992704e3f55951 (diff) | |
parent | 39ee79d5b84390ae79d8cce9389c1541bcd68a25 (diff) |
* merged from debian/unstable
* merge of the debian-expermental-ma branch
* refresh po/pot files in doc/ and po/
* Fix spelling error in cmdline/apt-get.cc. Thanks to Osamu Aoki
Closes: #594211
* Swedish (Daniel Nylander). Closes: #592366
* French (Christian Perrier)
* Thai (Theppitak Karoonboonyanan). Closes: #592695
* Russian (Yuri Kozlov). Closes: #594232
* French (Christian Perrier)
* apt-pkg/contrib/strutl.cc:
- fix error checking for vsnprintf in its safe variant
* methods/bzip2.cc:
- fix error checking for read in case of failing bzip2/lzma/whatever
* debian/apt.cron.daily:
- create backups for our extended_states file (Closes: #593430)
* apt-pkg/init.cc:
- set the default values for dir::etc::trusted options correctly
* ftparchive/writer.cc:
- init valid-until correctly to prevent garbage entering Release file
* apt-pkg/deb/debsystem.cc:
- set dir::state::status based at least on dir
* apt-pkg/deb/dpkgpm.cc:
- use the InstVer instead of the CurrentVer for the autobit transfer
* methods/http.cc:
- some http servers violate HTTP1.1 by not issuing a Reason-Phrase
(or at least a space after the code) especially for 200, but lets
be nice and ignore it as we don't need the reason in general
* apt-pkg/acquire-item.cc:
- don't use ReadOnlyGzip mode for PDiffs as this mode doesn't work
in combination with the AddFd methods of our hashclasses
Diffstat (limited to 'test/integration/test-compressed-indexes')
-rwxr-xr-x | test/integration/test-compressed-indexes | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes new file mode 100755 index 000000000..0b73f4c35 --- /dev/null +++ b/test/integration/test-compressed-indexes @@ -0,0 +1,131 @@ +#!/bin/sh +set -e + +local TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +buildsimplenativepackage "testpkg" "i386" "1.0" +setupaptarchive + +local GOODSHOW="$(aptcache show testpkg) +" +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 +testequal "$GOODSHOW" aptcache show testpkg +test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4 +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 +testequal "$GOODSHOWSRC" aptcache showsrc testpkg + + +testrun() { + local F + if [ -e rootdir/var/lib/apt/lists/*localhost*Release ]; then + 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/*_Sources || F=1 + test -e rootdir/var/lib/apt/lists/*_Packages.gz || F=1 + test -e rootdir/var/lib/apt/lists/*_Sources.gz || F=1 + else + 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/*_Packages.gz || F=1 + ! test -e rootdir/var/lib/apt/lists/*_Sources.gz || F=1 + fi + if [ -n "$F" ]; then + ls -laR rootdir/var/lib/apt/lists/ + msgfail + else + msgpass + fi + msgtest "Check if package is downloadable" + aptget install -d testpkg -qq && msgpass || msgfail + msgtest "\tdeb file is present"; test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail + aptget clean + msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail + fi + rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + testequal "$GOODSHOW" aptcache show testpkg + testequal "$GOODSHOW" aptcache show testpkg + rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + testequal "$GOODPOLICY" aptcache policy testpkg + testequal "$GOODPOLICY" aptcache policy testpkg + rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + testequal "$GOODSHOWSRC" aptcache showsrc testpkg + testequal "$GOODSHOWSRC" aptcache showsrc testpkg + rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin + rm -rf rootdir/var/cache/apt/archives + msgtest "Check if the source is aptgetable" + aptget source testpkg -qq 2> /dev/null > /dev/null && msgpass || msgfail + msgtest "\tdsc file is present"; test -f testpkg_1.0.dsc && msgpass || msgfail + msgtest "\tdirectory is present"; test -d testpkg-1.0 && msgpass || msgfail + rm -rf testpkg-1.0 +} + +msgmsg "File: Test with uncompressed indexes" +testrun + +aptget update -qq -o Acquire::Pdiffs=1 +msgmsg "File: Test with uncompressed indexes (update unchanged with pdiffs)" +testrun + +aptget update -qq -o Acquire::Pdiffs=0 +msgmsg "File: Test with uncompressed indexes (update unchanged without pdiffs)" +testrun + +rm -rf rootdir/var/lib/apt/lists +echo 'Acquire::CompressionTypes::Order:: "gz"; +Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex + +aptget update -qq +msgmsg "File: Test with compressed indexes" +testrun "compressed" + +aptget update -qq -o Acquire::Pdiffs=1 +msgmsg "File: Test with compressed indexes (update unchanged with pdiffs)" +testrun "compressed" + +aptget update -qq -o Acquire::Pdiffs=0 +msgmsg "File: Test with compressed indexes (update unchanged without pdiffs)" +testrun "compressed" + +rm rootdir/etc/apt/apt.conf.d/02compressindex +changetowebserver +aptget update -qq +local GOODPOLICY="$(aptcache policy testpkg)" +test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 +testequal "$GOODPOLICY" aptcache policy testpkg + +msgmsg "HTTP: Test with uncompressed indexes" +testrun + +aptget update -qq -o Acquire::Pdiffs=1 +msgmsg "HTTP: Test with uncompressed indexes (update unchanged with pdiffs)" +testrun + +aptget update -qq -o Acquire::Pdiffs=0 +msgmsg "HTTP: Test with uncompressed indexes (update unchanged without pdiffs)" +testrun + +rm -rf rootdir/var/lib/apt/lists +echo 'Acquire::CompressionTypes::Order:: "gz"; +Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex + +aptget update -qq +msgmsg "HTTP: Test with compressed indexes" +testrun "compressed" + +aptget update -qq -o Acquire::Pdiffs=1 +msgmsg "HTTP: Test with compressed indexes (update unchanged with pdiffs)" +testrun "compressed" + +aptget update -qq -o Acquire::Pdiffs=0 +msgmsg "HTTP: Test with compressed indexes (update unchanged without pdiffs)" +testrun "compressed" |