4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
7 configarchitecture 'amd64'
9 insertpackage 'stable' 'foo' 'all' '1'
10 insertsource 'stable' 'foo' 'all' '1'
11 setupaptarchive --no-update
13 # install a slowed down file: otherwise its to fast to reproduce combining
14 NEWMETHODS="$(readlink -f rootdir)/usr
/lib
/apt
/methods
"
15 OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)"
19 IFS="$(printf "\n\b")"
20 for METH in $(find "$OLDMETHODS" -maxdepth 1 ! -type d); do
21 ln -s "$OLDMETHODS/$(basename "$METH")" "$NEWMETHODS"
24 ln -s "${OLDMETHODS}/http
" "${NEWMETHODS}/http
-ng"
27 webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http
://localhost
:${APTHTTPPORT}/"
28 sed -i -e 's# http:# http-ng:#' $(find rootdir/etc/apt/sources.list.d -name '*-deb-src.list')
30 testsuccess apt update -o Debug::Acquire::http-ng=1
31 cp rootdir/tmp/testsuccess.output update.log
32 # all requests are folded into the first Release file
33 testsuccess grep ' http-ng://' update.log
34 testfailure grep ' http://' update.log
35 # see if method-specific debug was enabled
36 testsuccess grep '^Answer for: http-ng:' update.log
38 rm -rf rootdir/var/lib/apt/lists
39 sed -i -e "s
#:${APTHTTPPORT}/#:${APTHTTPPORT}/redirectme#" rootdir/etc/apt/sources.list.d/*
40 testsuccess apt update
-o Debug
::Acquire
::http
-ng=1
41 cp rootdir
/tmp
/testsuccess.output update.log
42 # all requests are folded into the first Release file
43 testsuccess
grep ' http-ng://' update.log
44 testfailure
grep '^[^L].* http://' update.log
45 # see if method-specific debug was enabled
46 testsuccess
grep '^Answer for: http-ng:' update.log