]>
Commit | Line | Data |
---|---|---|
895417ef DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
895417ef DK |
6 | |
7 | setupenvironment | |
8 | configarchitecture "i386" | |
9 | ||
f9a3c4bd | 10 | # try a little harder to create a size mismatch |
b6d88f39 | 11 | buildsimplenativepackage 'pkg0' 'all' '1.0' 'stable' "Depends: foo" '' '' '' '' 'none' |
f9a3c4bd DK |
12 | buildsimplenativepackage 'pkga' 'all' '1.0' 'stable' "Depends: foo" '' '' '' '' 'none' |
13 | buildsimplenativepackage 'pkgb' 'all' '1.0' 'stable' "Depends: foo" '' '' '' '' 'none' | |
14 | buildsimplenativepackage 'pkgc' 'all' '1.0' 'stable' "Depends: f$(for i in $(seq 0 1000); do printf 'o'; done)" '' '' '' '' 'none' | |
15 | buildsimplenativepackage 'pkgd' 'all' '1.0' 'stable' "Depends: f$(for i in $(seq 0 1000); do printf 'o'; done)" '' '' '' '' 'none' | |
895417ef DK |
16 | |
17 | setupaptarchive --no-update | |
18 | ||
19 | # simulate (and be a predictable) pipeline mess-up by the server/proxy | |
20 | changetowebserver \ | |
21 | -o 'aptwebserver::overwrite::.*pkga.*::filename=/pool/pkgd_1.0_all.deb' \ | |
22 | -o 'aptwebserver::overwrite::.*pkgc.*::filename=/pool/pkgb_1.0_all.deb' \ | |
23 | -o 'aptwebserver::overwrite::.*pkgb.*::filename=/pool/pkgc_1.0_all.deb' \ | |
24 | -o 'aptwebserver::overwrite::.*pkgd.*::filename=/pool/pkga_1.0_all.deb' | |
25 | ||
f9a3c4bd DK |
26 | echo 'Debug::Acquire::http "true"; |
27 | Debug::pkgAcquire::Worker "true";' > rootdir/etc/apt/apt.conf.d/99debug | |
28 | ||
29 | testsuccess aptget update | |
895417ef | 30 | |
226c0f64 DK |
31 | cd downloaded |
32 | # messup is bigger than pipeline: checks if fixup isn't trying too hard | |
f9a3c4bd | 33 | testfailure aptget download pkga pkgb pkgc pkgd -o Acquire::http::Pipeline-Depth=2 |
226c0f64 DK |
34 | for pkg in 'pkga' 'pkgd'; do |
35 | testfailure test -f ${pkg}_1.0_all.deb | |
36 | done | |
37 | for pkg in 'pkgb' 'pkgc'; do | |
38 | testsuccess test -f ${pkg}_1.0_all.deb | |
39 | testsuccess cmp ../incoming/${pkg}_1.0_all.deb ${pkg}_1.0_all.deb | |
40 | rm -f ${pkg}_1.0_all.deb | |
41 | done | |
895417ef DK |
42 | |
43 | # ensure that pipeling is enabled for rest of this test | |
226c0f64 | 44 | echo 'Acquire::http::Pipeline-Depth 10;' > ../rootdir/etc/apt/apt.conf.d/99enable-pipeline |
895417ef DK |
45 | |
46 | # the output is a bit strange: it looks like it has downloaded pkga 4 times | |
b6d88f39 JAK |
47 | testwarning aptget download pkg0 pkga pkgb pkgc pkgd |
48 | for pkg in 'pkg0' 'pkga' 'pkgb' 'pkgc' 'pkgd'; do | |
895417ef | 49 | testsuccess test -f ${pkg}_1.0_all.deb |
226c0f64 | 50 | testsuccess cmp ../incoming/${pkg}_1.0_all.deb ${pkg}_1.0_all.deb |
895417ef DK |
51 | rm -f ${pkg}_1.0_all.deb |
52 | done | |
53 | ||
54 | # while hashes will pass (as none are available), sizes will not match, so failure | |
55 | # checks that no hashes means that pipeline depth is ignored as we can't fixup | |
f9a3c4bd | 56 | testfailure aptget download pkga pkgb pkgc pkgd --allow-unauthenticated -o Acquire::ForceHash=ROT26 |