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
14 webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http
://localhost
:${APTHTTPPORT}/"
16 echo 'Dir::Bin::Methods::http-ng "http
";' > rootdir/etc/apt/apt.conf.d/99add-http-ng-method
17 sed -i -e 's# http:# http-ng:#' $(find rootdir/etc/apt/sources.list.d -name '*-deb-src.list')
19 testsuccess apt update -o Debug::Acquire::http-ng=1
20 cp rootdir/tmp/testsuccess.output update.log
21 # all requests are folded into the first Release file
22 testsuccess grep ' http-ng://' update.log
23 testfailure grep ' http://' update.log
24 # see if method-specific debug was enabled
25 testsuccess grep '^Answer for: http-ng:' update.log
27 rm -rf rootdir/var/lib/apt/lists
28 sed -i -e "s
#:${APTHTTPPORT}/#:${APTHTTPPORT}/redirectme#" rootdir/etc/apt/sources.list.d/*
29 testsuccess apt update
-o Debug
::Acquire
::http
-ng=1
30 cp rootdir
/tmp
/testsuccess.output update.log
31 # all requests are folded into the first Release file
32 testsuccess
grep ' http-ng://' update.log
33 testfailure
grep '^[^L].* http://' update.log
34 # see if method-specific debug was enabled
35 testsuccess
grep '^Answer for: http-ng:' update.log