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