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