summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-30 10:53:51 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-10 17:25:26 +0200
commit653ef26c70dc9c0e2cbfdd4e79117876bb63e87d (patch)
treed9fbea48e857abca5e1e91751b9ec7174364cf20 /test/integration
parent525bcd780d0284d980db805c62254e7d27507345 (diff)
allow individual targets to be kept compressed
There is an option to keep all targets (Packages, Sources, …) compressed for a while now, but the all-or-nothing approach is a bit limited for our purposes with additional targets as some of them are very big (Contents) and rarely used in comparison, so keeping them compressed by default can make sense, while others are still unpacked. Most interesting is the copy-change maybe: Copy is used by the acquire system as an uncompressor and it is hence expected that it returns the hashes for the "output", not the input. Now, in the case of keeping a file compressed, the output is never written to disk, but generated in memory and we should still validated it, so for compressed files copy is expected to return the hashes of the uncompressed file. We used to use the config option to enable on-the-fly decompress in the method, but in reality copy is never used in a way where it shouldn't decompress a compressed file to get its hashes, so we can save us the trouble of sending this information to the method and just do it always.
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-apt-acquire-additional-files18
-rwxr-xr-xtest/integration/test-compressed-indexes2
2 files changed, 18 insertions, 2 deletions
diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files
index 3465c0a16..fecdf30bf 100755
--- a/test/integration/test-apt-acquire-additional-files
+++ b/test/integration/test-apt-acquire-additional-files
@@ -57,7 +57,23 @@ testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents
testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64)" aptget files --format '$(FILENAME)' 'Created-By: Contents'
testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' 'aptarchive/dists/unstable/main/Contents-amd64'
-# no automatic uncompress based on the name please,
+rm ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64
+testempty aptget files --format '$(FILENAME)' 'Created-By: Contents'
+
+# if we asked for keeping it compressed, keep it
+echo 'APT::Acquire::Targets::deb::Contents::KeepCompressed "true";' >> rootdir/etc/apt/apt.conf.d/content-target.conf
+testsuccessequal "Hit:1 http://localhost:8080 unstable InRelease
+Get:2 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B]
+Reading package lists..." aptget update
+
+testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*'
+testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz)" aptget files --format '$(FILENAME)' 'Created-By: Contents'
+testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz'
+
+rm ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz
+testempty aptget files --format '$(FILENAME)' 'Created-By: Contents'
+
+# and no automatic uncompress based on the name please,
# only if we downloaded a compressed file, but target was uncompressed
cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
APT::Acquire::Targets::deb::Contents {
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index c6b292baa..b5d6b8ae4 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -60,7 +60,7 @@ 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
+ 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...