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