]>
Commit | Line | Data |
---|---|---|
884a4c0a DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | setupenvironment | |
7 | configarchitecture 'i386' | |
8 | ||
9 | insertpackage 'wheezy' 'apt' 'all' '0.8.15' | |
10 | ||
718f797c DK |
11 | getlabelfromsuite() { |
12 | echo -n 'Testcases' | |
13 | } | |
14 | ||
1df24acf | 15 | setupaptarchive --no-update |
718f797c | 16 | |
1df24acf DK |
17 | runtest() { |
18 | local MSG="$1" | |
19 | msgtest "$1" "$2" | |
884a4c0a DK |
20 | rm -rf rootdir/var/lib/apt/lists |
21 | aptget clean | |
1df24acf | 22 | generatereleasefiles "$3" "$4" |
884a4c0a | 23 | signreleasefiles |
1df24acf DK |
24 | shift 4 |
25 | if expr match "$MSG" '.*accepted.*' >/dev/null; then | |
26 | testsuccess --nomsg aptget update "$@" | |
27 | testfailure grep -q 'is expired' rootdir/tmp/testsuccess.output | |
884a4c0a | 28 | else |
1df24acf DK |
29 | testfailure --nomsg aptget update "$@" |
30 | testsuccess grep -q 'is expired' rootdir/tmp/testfailure.output | |
884a4c0a DK |
31 | fi |
32 | } | |
33 | ||
1df24acf DK |
34 | runtest 'Release file is accepted as it has' 'no Until' '' '' |
35 | runtest 'Release file is accepted as it has' 'no Until and good Max-Valid' '' '' -o Acquire::Max-ValidTime=3600 | |
36 | runtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid' 'now - 2 days' '' -o Acquire::Max-ValidTime=3600 | |
37 | runtest 'Release file is accepted as it has' 'good Until' 'now - 3 days' 'now + 1 day' | |
38 | runtest 'Release file is rejected as it has' 'bad Until' 'now - 7 days' 'now - 4 days' | |
39 | runtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)' 'now - 7 days' 'now - 4 days' -o Acquire::Max-ValidTime=1209600 | |
40 | runtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)' 'now - 7 days' 'now - 4 days' -o Acquire::Max-ValidTime=86400 | |
41 | runtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)' 'now - 7 days' 'now + 4 days' -o Acquire::Max-ValidTime=86400 | |
42 | runtest 'Release file is accepted as it has' 'good labeled Max-Valid' 'now - 7 days' 'now + 4 days' -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 | |
43 | runtest 'Release file is rejected as it has' 'bad labeled Max-Valid' 'now - 7 days' 'now + 4 days' -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 | |
44 | runtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)' 'now - 7 days' 'now + 1 days' -o Acquire::Min-ValidTime=1209600 | |
45 | runtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)' 'now - 7 days' 'now - 4 days' -o Acquire::Min-ValidTime=1209600 | |
46 | runtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <' 'now - 7 days' 'now - 2 days' -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 | |
47 | runtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >' 'now - 7 days' 'now - 2 days' -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 | |
48 | runtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <' 'now - 7 days' 'now - 2 days' -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 | |
49 | runtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >' 'now - 7 days' 'now - 2 days' -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 |