]> git.saurik.com Git - apt.git/blame - test/integration/test-pdiff-usage
use dpkg --unpack --recursive to avoid long cmdlines
[apt.git] / test / integration / test-pdiff-usage
CommitLineData
f213b6ea
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
f213b6ea
DK
6
7setupenvironment
47d2bc78 8configarchitecture 'i386'
0179cfa8 9LOWCOSTEXT='lz4'
f213b6ea
DK
10
11buildaptarchive
12setupflataptarchive
38f8704e
DK
13changetowebserver
14
15cat >rootdir/etc/apt/apt.conf.d/contents.conf <<EOF
16Acquire::IndexTargets::deb::Contents {
17 MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
18 ShortDescription "Contents";
19 Description "\$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents";
20 MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
21 flatMetaKey "Contents-\$(ARCHITECTURE)";
22 flatDescription "\$(RELEASE) \$(ARCHITECTURE) Contents";
23};
24EOF
f213b6ea 25
f213b6ea 26PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
38f8704e
DK
27echo 'contents for stuff' > aptarchive/Contents-i386
28compressfile aptarchive/Contents-i386
29echo 'hacked' > aptarchive/hacked-i386
30compressfile aptarchive/hacked-i386
47d2bc78 31
47d2bc78 32wasmergeused() {
0e071dfe
DK
33 if echo "$*" | grep -q -- '-o test::cannot-use-pdiff=1'; then
34 find rootdir/var/lib/apt/lists/partial -name '*-patched*' -delete
35 fi
36
742f67ea 37 testsuccess apt update "$@"
50bd6fd3 38
34d6ece7
DK
39 msgtest 'No intermediate patch files' 'still exist'
40 local EDS="$(find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*')"
41 if [ -z "$EDS" ]; then
42 msgpass
43 else
44 echo
45 echo "$EDS"
46 msgfail
47 fi
48
8d0d9255
DK
49 if echo "$*" | grep -q -- '-o test::cannot-use-pdiff=1'; then
50 msgtest 'Check if pdiff was' 'not used'
51 cp -a rootdir/tmp/testsuccess.output rootdir/tmp/aptupdate.output
4a808dea 52 testsuccess --nomsg grep "diff/Index with Message: Couldn't parse pdiff index" rootdir/tmp/aptupdate.output
8d0d9255
DK
53 return;
54 fi
55
47d2bc78 56 msgtest 'Check if the right pdiff merger was used'
ba6b79bd 57 if grep -q '^pkgAcqIndexMergeDiffs::Done(): rred' rootdir/tmp/testsuccess.output; then
8d0d9255 58 if echo "$*" | grep -q -- '-o Acquire::PDiffs::Merge=1'; then
47d2bc78
DK
59 msgpass
60 else
61 msgfail "Merge shouldn't have been used, but was"
62 fi
8d0d9255 63 elif echo "$*" | grep -q -- '-o Acquire::PDiffs::Merge=1'; then
47d2bc78
DK
64 msgfail "Merge should have been used, but wasn't"
65 else
66 msgpass
67 fi
4aa6ebf6
DK
68
69 testequal '1' grep -c rred:601 rootdir/tmp/testsuccess.output
47d2bc78
DK
70}
71
72testrun() {
4e3c5633 73 configcompression '.' 'xz'
34d6ece7 74 msgmsg "Testcase: setup the base with: $*"
47d2bc78 75 find aptarchive -name 'Packages*' -type f -delete
3abb6a6a 76 cp "${PKGFILE}" aptarchive/Packages
47d2bc78
DK
77 compressfile 'aptarchive/Packages'
78 generatereleasefiles
79 signreleasefiles
146f7715 80 rm -rf aptarchive/Packages.diff rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists-bak
47d2bc78
DK
81 testsuccess aptget update "$@"
82 cp -a rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists-bak
83 testnopackage newstuff
3abb6a6a 84 testsuccessequal "$(cat "${PKGFILE}")
f213b6ea 85" aptcache show apt oldstuff
4e3c5633 86 configcompression '.' 'gz'
f213b6ea 87
ef3c549e 88 # see if the code deals properly with leftover partial files
b7a1076f 89 partialleftovers
ef3c549e 90
34d6ece7 91 msgmsg "Testcase: apply with one patch: $*"
4e3c5633 92 find aptarchive -name 'Packages*' -type f -delete
3abb6a6a 93 cp "${PKGFILE}-new" aptarchive/Packages
47d2bc78
DK
94 compressfile 'aptarchive/Packages'
95 mkdir -p aptarchive/Packages.diff
96 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
3abb6a6a
DK
97 diff -e "${PKGFILE}" "${PKGFILE}-new" > "${PATCHFILE}" || true
98 cat "$PATCHFILE" | gzip > "${PATCHFILE}.gz"
47d2bc78 99 PATCHINDEX='aptarchive/Packages.diff/Index'
8d0d9255 100 echo "SHA256-Current: $(sha256sum "${PKGFILE}-new" | cut -d' ' -f 1) $(stat -c%s "${PKGFILE}-new")
f6d4ab9a
DK
101SHA256-History:
102 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
3abb6a6a 103 $(sha256sum "$PKGFILE" | cut -d' ' -f 1) $(stat -c%s "$PKGFILE") $(basename "$PATCHFILE")
f6d4ab9a
DK
104SHA256-Patches:
105 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
4a808dea
DK
106 $(sha256sum "$PATCHFILE" | cut -d' ' -f 1) $(stat -c%s "$PATCHFILE") $(basename "$PATCHFILE")
107SHA256-Download:
4f51fd86 108 d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz
4a808dea 109 $(sha256sum "${PATCHFILE}.gz" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE}.gz") $(basename "${PATCHFILE}.gz")" > "$PATCHINDEX"
4f51fd86 110
47d2bc78
DK
111 generatereleasefiles '+1hour'
112 signreleasefiles
113 find aptarchive -name 'Packages*' -type f -delete
114 wasmergeused "$@"
115 testnopackage oldstuff
3abb6a6a 116 testsuccessequal "$(cat "${PKGFILE}-new")
47d2bc78 117" aptcache show apt newstuff
f213b6ea 118
4a808dea 119 msgmsg "Testcase: SHA1-only patches are not used: $*"
f345d057
JAK
120 find aptarchive -name 'Packages*' -type f -delete
121 cp "${PKGFILE}-new" aptarchive/Packages
122 compressfile 'aptarchive/Packages'
123 mkdir -p aptarchive/Packages.diff
124 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
125 diff -e "${PKGFILE}" "${PKGFILE}-new" > "${PATCHFILE}" || true
126 cat "$PATCHFILE" | gzip > "${PATCHFILE}.gz"
127 PATCHINDEX='aptarchive/Packages.diff/Index'
128 echo "SHA1-Current: $(sha1sum "${PKGFILE}-new" | cut -d' ' -f 1) $(stat -c%s "${PKGFILE}-new")
129SHA1-History:
130 9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
131 $(sha1sum "$PKGFILE" | cut -d' ' -f 1) $(stat -c%s "$PKGFILE") $(basename "$PATCHFILE")
132SHA1-Patches:
133 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
4a808dea
DK
134 $(sha1sum "$PATCHFILE" | cut -d' ' -f 1) $(stat -c%s "$PATCHFILE") $(basename "$PATCHFILE")
135SHA1-Download:
f345d057 136 2365ac0ac57cde3d43c63145e8251a3bd5410213 197 2010-08-18-2013.28.gz
4a808dea
DK
137 $(sha1sum "${PATCHFILE}.gz" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE}.gz") $(basename "${PATCHFILE}.gz")" > "$PATCHINDEX"
138 generatereleasefiles '+1hour'
139 signreleasefiles
140 rm -rf rootdir/var/lib/apt/lists
141 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
142 wasmergeused "$@" -o test::cannot-use-pdiff=1
143 testnopackage oldstuff
144 testsuccessequal "$(cat "${PKGFILE}-new")
145" aptcache show apt newstuff
f345d057 146
4a808dea
DK
147 msgmsg "Testcase: no download-hashes patches are not used: $*"
148 find aptarchive -name 'Packages*' -type f -delete
149 cp "${PKGFILE}-new" aptarchive/Packages
150 compressfile 'aptarchive/Packages'
151 mkdir -p aptarchive/Packages.diff
152 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
153 diff -e "${PKGFILE}" "${PKGFILE}-new" > "${PATCHFILE}" || true
154 cat "$PATCHFILE" | gzip > "${PATCHFILE}.gz"
155 PATCHINDEX='aptarchive/Packages.diff/Index'
156 echo "SHA256-Current: $(sha256sum "${PKGFILE}-new" | cut -d' ' -f 1) $(stat -c%s "${PKGFILE}-new")
157SHA256-History:
158 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
159 $(sha256sum "$PKGFILE" | cut -d' ' -f 1) $(stat -c%s "$PKGFILE") $(basename "$PATCHFILE")
160SHA256-Patches:
161 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
162 $(sha256sum "$PATCHFILE" | cut -d' ' -f 1) $(stat -c%s "$PATCHFILE") $(basename "$PATCHFILE")" > "$PATCHINDEX"
f345d057
JAK
163 generatereleasefiles '+1hour'
164 signreleasefiles
8d0d9255
DK
165 rm -rf rootdir/var/lib/apt/lists
166 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
f345d057
JAK
167 wasmergeused "$@" -o test::cannot-use-pdiff=1
168 testnopackage oldstuff
169 testsuccessequal "$(cat "${PKGFILE}-new")
170" aptcache show apt newstuff
171
34d6ece7 172 msgmsg "Testcase: apply with two patches: $*"
3abb6a6a 173 cp "${PKGFILE}-new" aptarchive/Packages
47d2bc78
DK
174 echo '
175Package: futurestuff
176Version: 1.0
177Architecture: i386
178Maintainer: Joe Sixpack <joe@example.org>
179Installed-Size: 202
180Filename: pool/futurestuff_1.0_i386.deb
181Size: 202200
47d2bc78
DK
182SHA256: b46fd154615edaae5ba33c56a5cc0e7deaef23e2da3e4f129727fd660f28f050
183Description: some cool and shiny future stuff
184 This package will appear in the next next mirror update
185Description-md5: d5f89fbbc2ce34c455dfee9b67d82b6b' >> aptarchive/Packages
186
187 compressfile 'aptarchive/Packages'
188 PATCHFILE2="aptarchive/Packages.diff/$(date -d 'now + 1hour' '+%Y-%m-%d-%H%M.%S')"
3abb6a6a
DK
189 diff -e "${PKGFILE}-new" aptarchive/Packages > "${PATCHFILE2}" || true
190 cat "$PATCHFILE2" | gzip > "${PATCHFILE2}.gz"
8d0d9255 191 echo "SHA256-Current: $(sha256sum aptarchive/Packages | cut -d' ' -f 1) $(stat -c%s aptarchive/Packages)
f6d4ab9a
DK
192SHA256-History:
193 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
3abb6a6a
DK
194 $(sha256sum "$PKGFILE" | cut -d' ' -f 1) $(stat -c%s "$PKGFILE") $(basename "$PATCHFILE")
195 $(sha256sum "${PKGFILE}-new" | cut -d' ' -f 1) $(stat -c%s "${PKGFILE}-new") $(basename "${PATCHFILE2}")
f6d4ab9a
DK
196SHA256-Patches:
197 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
3abb6a6a 198 $(sha256sum "$PATCHFILE" | cut -d' ' -f 1) $(stat -c%s "$PATCHFILE") $(basename "$PATCHFILE")
4a808dea
DK
199 $(sha256sum "${PATCHFILE2}" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE2}") $(basename "${PATCHFILE2}")
200SHA256-Download:
4f51fd86 201 d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz
3abb6a6a 202 $(sha256sum "${PATCHFILE}.gz" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE}.gz") $(basename "${PATCHFILE}.gz")
4a808dea 203 $(sha256sum "${PATCHFILE2}.gz" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE2}.gz") $(basename "${PATCHFILE2}.gz")" > "$PATCHINDEX"
4f51fd86 204
47d2bc78
DK
205 generatereleasefiles '+2hour'
206 signreleasefiles
207 cp -a aptarchive/Packages Packages-future
208 find aptarchive -name 'Packages*' -type f -delete
209 rm -rf rootdir/var/lib/apt/lists
210 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
211 wasmergeused "$@"
212 testnopackage oldstuff
25b86db1 213 testsuccessequal "$(cat Packages-future)
47d2bc78
DK
214" aptcache show apt newstuff futurestuff
215
38f8704e
DK
216 # we reuse the archive state of the previous test here
217 msgmsg "Testcase: pdiff handling is stopped if transaction fails $*"
218 rm -rf rootdir/var/lib/apt/lists
219 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
220 cp Packages-future aptarchive/Packages
221 rm -f rootdir/var/lib/apt/lists/*_Contents-*
222 webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/hacked-i386.gz'
4aa6ebf6 223 testfailure apt update "$@"
38f8704e
DK
224 webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/Contents-i386.gz'
225 cp rootdir/tmp/testfailure.output patchdownload.output
226 testfailure grep 'rred:600' patchdownload.output
227 testnopackage newstuff futurestuff
228 testsuccessequal "$(cat "${PKGFILE}")
229" aptcache show apt oldstuff
230
742f67ea
DK
231 # we reuse the entire state of the previous test here
232 msgmsg "Testcase: good files from previous fails are picked up from partial: $*"
233 wasmergeused "$@"
234 testfailure grep '^GET /Packages.diff/Index HTTP/1.1' rootdir/tmp/testsuccess.output
235 testnopackage oldstuff
236 testsuccessequal "$(cat Packages-future)
237" aptcache show apt newstuff futurestuff
238
dfcf7f35
DK
239 # we reuse the archive state of the previous test here
240 msgmsg "Testcase: downloading a patch fails, but successful fallback: $*"
241 rm -rf rootdir/var/lib/apt/lists
242 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
243 cp Packages-future aptarchive/Packages
244 rm "${PATCHFILE}.gz"
245 testsuccess apt update "$@"
246 cp rootdir/tmp/testsuccess.output patchdownload.output
247 testsuccess grep '^Falling back to normal index file acquire' patchdownload.output
248 testnopackage oldstuff
249 testsuccessequal "$(cat Packages-future)
250" aptcache show apt newstuff futurestuff
251
34d6ece7 252 msgmsg "Testcase: patch applying fails, but successful fallback: $*"
47d2bc78
DK
253 rm -rf rootdir/var/lib/apt/lists
254 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
3abb6a6a 255 cp "${PKGFILE}-new" aptarchive/Packages
47d2bc78
DK
256 compressfile 'aptarchive/Packages'
257 mkdir -p aptarchive/Packages.diff
258 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
3abb6a6a
DK
259 diff -e "${PKGFILE}" "${PKGFILE}-new" > "${PATCHFILE}" || true
260 cat "$PATCHFILE" | gzip > "${PATCHFILE}.gz"
47d2bc78 261 PATCHINDEX='aptarchive/Packages.diff/Index'
8d0d9255 262 echo "SHA256-Current: $(sha256sum "${PKGFILE}-new" | cut -d' ' -f 1) $(stat -c%s "${PKGFILE}-new")
f6d4ab9a
DK
263SHA256-History:
264 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
3abb6a6a 265 $(sha256sum "$PKGFILE" | cut -d' ' -f 1) $(stat -c%s "$PKGFILE") $(basename "$PATCHFILE")
f6d4ab9a
DK
266SHA256-Patches:
267 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
4a808dea
DK
268 $(sha256sum "$PATCHFILE" | cut -d' ' -f 1) $(stat -c%s "$PATCHFILE") $(basename "$PATCHFILE")
269SHA256-Download:
4f51fd86 270 d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz
4a808dea 271 $(sha256sum "${PATCHFILE}.gz" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE}.gz") $(basename "${PATCHFILE}.gz")" > "$PATCHINDEX"
6d3e5bd8 272 # needs to look like a valid command, otherwise the parser will fail before hashes are checked
3abb6a6a
DK
273 echo '1d' > "$PATCHFILE"
274 cat "$PATCHFILE" | gzip > "${PATCHFILE}.gz"
47d2bc78
DK
275 generatereleasefiles '+1hour'
276 signreleasefiles
4e3c5633
DK
277 testsuccess apt update "$@"
278 cp -f rootdir/tmp/testsuccess.output rootdir/tmp/aptupdate.output
279 testsuccess grep 'Hash Sum mismatch' rootdir/tmp/aptupdate.output
47d2bc78 280 testnopackage oldstuff
3abb6a6a 281 testsuccessequal "$(cat "${PKGFILE}-new")
47d2bc78 282" aptcache show apt newstuff
c355ea30
DK
283
284 msgmsg "Testcase: pdiff patch bigger than index itself: $*"
285 rm -rf rootdir/var/lib/apt/lists
286 cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
ef3c549e
DK
287 # the general testcode checks for leftovers in partial, but as this file
288 # is never touched in this test as it exits earlier its not a leftover…
289 rm -f rootdir/var/lib/apt/lists/partial/localhost:${APTHTTPPORT}_Packages
3abb6a6a 290 cp "${PKGFILE}-new" aptarchive/Packages
c355ea30
DK
291 compressfile 'aptarchive/Packages'
292 mkdir -p aptarchive/Packages.diff
293 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
3abb6a6a
DK
294 diff -e "${PKGFILE}" "${PKGFILE}-new" > "${PATCHFILE}" || true
295 cat "$PATCHFILE" | gzip > "${PATCHFILE}.gz"
c355ea30 296 PATCHINDEX='aptarchive/Packages.diff/Index'
8d0d9255 297 echo "SHA256-Current: $(sha256sum "${PKGFILE}-new" | cut -d' ' -f 1) $(stat -c%s "${PKGFILE}-new")
c355ea30
DK
298SHA256-History:
299 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
3abb6a6a 300 $(sha256sum "$PKGFILE" | cut -d' ' -f 1) $(stat -c%s "$PKGFILE") $(basename "$PATCHFILE")
c355ea30
DK
301SHA256-Patches:
302 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
4a808dea
DK
303 $(sha256sum "$PATCHFILE" | cut -d' ' -f 1) $(stat -c%s "$PATCHFILE") $(basename "$PATCHFILE")
304SHA256-Download:
4f51fd86 305 d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz
4a808dea 306 $(sha256sum "${PATCHFILE}.gz" | cut -d' ' -f 1) $(stat -c%s "${PATCHFILE}.gz")000 $(basename "${PATCHFILE}.gz")" > "$PATCHINDEX"
c355ea30
DK
307 generatereleasefiles '+1hour'
308 signreleasefiles
0e071dfe 309 wasmergeused "$@" -o test::cannot-use-pdiff=1
4e3c5633 310 testsuccess grep 'bytes (Limit is' rootdir/tmp/aptupdate.output
c355ea30 311 testnopackage oldstuff
3abb6a6a 312 testsuccessequal "$(cat "${PKGFILE}-new")
c355ea30 313" aptcache show apt newstuff
47d2bc78 314}
34d6ece7 315echo 'Debug::pkgAcquire::Diffs "true";
03bfbc96 316Debug::Acquire::Transaction "true";
742f67ea
DK
317Debug::pkgAcquire::Worker "true";
318Debug::Acquire::http "true";
319Debug::pkgAcquire "true";
34d6ece7 320Debug::pkgAcquire::rred "true";' > rootdir/etc/apt/apt.conf.d/rreddebug.conf
47d2bc78 321
d7a51997 322testcase() {
d7a51997
DK
323 testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1 "$@"
324 testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1 "$@"
325 testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0 "$@"
326 testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0 "$@"
f6d4ab9a 327}
0e071dfe
DK
328generatepartialleftovers() {
329 for f in "$@"; do
330 cat "${PKGFILE}" "${PKGFILE}" > "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_${f}"
331 printf '\n\nInvalid\nStanza: yes\n\n' >> "rootdir/var/lib/apt/lists-bak/partial/localhost:${APTHTTPPORT}_${f}"
332 done
333}
334
335partialleftovers() { generatepartialleftovers 'Packages' 'Packages-patched'; }
4e3c5633
DK
336aptautotest_apt_update() { aptautotest_aptget_update "$@"; testsuccess test -e "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_Packages"; }
337testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=false
0e071dfe 338partialleftovers() { generatepartialleftovers "Packages.${LOWCOSTEXT}" "Packages-patched.${LOWCOSTEXT}"; }
0179cfa8 339aptautotest_apt_update() { aptautotest_aptget_update "$@"; testsuccess test -e "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_Packages.$LOWCOSTEXT"; }
4e3c5633 340testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=true
b7a1076f
DK
341
342
0e071dfe 343partialleftovers() { generatepartialleftovers "redirectme_Packages.${LOWCOSTEXT}" "redirectme_Packages-patched.${LOWCOSTEXT}"; }
b7a1076f
DK
344webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://0.0.0.0:${APTHTTPPORT}/"
345rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme"
346aptautotest_apt_update() {
347 aptautotest_aptget_update "$@"
348 testsuccess test -e "rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_redirectme_Packages.$LOWCOSTEXT"
349 testempty find rootdir/var/lib/apt/lists -type f \! \( -name lock -o -name '*_redirectme_*' \)
350}
351testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=true