]>
Commit | Line | Data |
---|---|---|
6874a1a8 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
6874a1a8 DK |
6 | setupenvironment |
7 | configarchitecture "i386" | |
8 | ||
9 | buildaptarchive | |
db4b5f77 | 10 | touch aptarchive/Packages |
6874a1a8 DK |
11 | setupflataptarchive |
12 | ||
b2fd8524 | 13 | failureupdate() { |
8de79b68 | 14 | rm -rf rootdir/var/lib/apt |
b2fd8524 DK |
15 | testfailure aptget update --allow-insecure-repositories |
16 | testsuccess grep "^E: Failed to fetch store:${1} Empty files can't be valid archives$" rootdir/tmp/testfailure.output | |
17 | } | |
18 | successupdate() { | |
19 | rm -rf rootdir/var/lib/apt | |
20 | testwarning aptget update --allow-insecure-repositories | |
6874a1a8 DK |
21 | } |
22 | ||
4260fd39 DK |
23 | createemptyarchive() { |
24 | find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete | |
4260fd39 | 25 | touch aptarchive/Packages |
8bcbc694 | 26 | echo -n "" | $COMPRESSOR_CMD > aptarchive/${1}.$COMPRESS |
b2fd8524 | 27 | find aptarchive -name '*Release*' -delete |
4260fd39 DK |
28 | rm -f aptarchive/Packages |
29 | } | |
6874a1a8 | 30 | |
4260fd39 DK |
31 | createemptyfile() { |
32 | find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete | |
4260fd39 | 33 | touch aptarchive/Packages aptarchive/${1}.$COMPRESS |
b2fd8524 | 34 | find aptarchive -name '*Release*' -delete |
4260fd39 DK |
35 | rm -f aptarchive/Packages |
36 | } | |
6874a1a8 | 37 | |
4260fd39 | 38 | testoverfile() { |
1da3b7b8 | 39 | local APTARCHIVE="$(readlink -f ./aptarchive)" |
5f982b9d | 40 | forcecompressor "$1" |
6874a1a8 | 41 | |
b2fd8524 | 42 | msgmsg 'archive over file' "Packages.$COMPRESS" |
4260fd39 | 43 | createemptyarchive 'Packages' |
b2fd8524 | 44 | successupdate |
4260fd39 | 45 | createemptyfile 'Packages' |
b2fd8524 | 46 | failureupdate "$(readlink -f rootdir/var/lib/apt/lists/partial/$(echo "$APTARCHIVE" | sed -e 's#/#_#g')_Packages.${COMPRESS})" |
4260fd39 | 47 | } |
6874a1a8 | 48 | |
4260fd39 | 49 | testoverhttp() { |
5f982b9d | 50 | forcecompressor "$1" |
6874a1a8 | 51 | |
b2fd8524 | 52 | msgmsg 'archive over http' "Packages.$COMPRESS" |
4260fd39 | 53 | createemptyarchive 'Packages' |
b2fd8524 | 54 | successupdate |
4260fd39 | 55 | createemptyfile 'Packages' |
b2fd8524 | 56 | failureupdate "$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:${APTHTTPPORT}_Packages.${COMPRESS})" |
4260fd39 DK |
57 | } |
58 | ||
912a6131 | 59 | forallsupportedcompressors testoverfile |
4260fd39 DK |
60 | |
61 | # do the same again with http instead of file | |
62 | changetowebserver | |
6874a1a8 | 63 | |
912a6131 | 64 | forallsupportedcompressors testoverhttp |