]>
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 | ||
15 | ||
884a4c0a DK |
16 | setupaptarchive |
17 | ||
18 | setupreleasefile() { | |
19 | rm -rf rootdir/var/lib/apt/lists | |
20 | aptget clean | |
21 | generatereleasefiles "$1" "$2" | |
22 | signreleasefiles | |
23 | } | |
24 | ||
25 | aptgetupdate() { | |
26 | if aptget update $* 2>&1 | grep -q 'is expired'; then | |
27 | return 1 | |
28 | else | |
29 | return 0 | |
30 | fi | |
31 | } | |
32 | ||
33 | setupreleasefile | |
34 | msgtest 'Release file is accepted as it has' 'no Until' | |
0440d936 | 35 | testsuccess --nomsg aptgetupdate |
884a4c0a DK |
36 | |
37 | setupreleasefile | |
38 | msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid' | |
0440d936 | 39 | testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600 |
884a4c0a DK |
40 | |
41 | setupreleasefile 'now - 2 days' | |
42 | msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid' | |
0440d936 | 43 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600 |
884a4c0a DK |
44 | |
45 | setupreleasefile 'now - 3 days' 'now + 1 day' | |
46 | msgtest 'Release file is accepted as it has' 'good Until' | |
0440d936 | 47 | testsuccess --nomsg aptgetupdate |
884a4c0a DK |
48 | |
49 | setupreleasefile 'now - 7 days' 'now - 4 days' | |
50 | msgtest 'Release file is rejected as it has' 'bad Until' | |
0440d936 | 51 | testfailure --nomsg aptgetupdate |
884a4c0a DK |
52 | |
53 | setupreleasefile 'now - 7 days' 'now - 4 days' | |
54 | msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)' | |
0440d936 | 55 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 |
884a4c0a DK |
56 | |
57 | setupreleasefile 'now - 7 days' 'now - 4 days' | |
58 | msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)' | |
0440d936 | 59 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 |
884a4c0a DK |
60 | |
61 | setupreleasefile 'now - 7 days' 'now + 4 days' | |
62 | msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)' | |
0440d936 | 63 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 |
884a4c0a DK |
64 | |
65 | setupreleasefile 'now - 7 days' 'now + 4 days' | |
66 | msgtest 'Release file is accepted as it has' 'good labeled Max-Valid' | |
0440d936 | 67 | testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 |
884a4c0a DK |
68 | |
69 | setupreleasefile 'now - 7 days' 'now + 4 days' | |
70 | msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid' | |
0440d936 | 71 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 |
89500a25 DK |
72 | |
73 | setupreleasefile 'now - 7 days' 'now + 1 days' | |
74 | msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)' | |
0440d936 | 75 | testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 |
89500a25 DK |
76 | |
77 | setupreleasefile 'now - 7 days' 'now - 4 days' | |
78 | msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)' | |
0440d936 | 79 | testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 |
89500a25 DK |
80 | |
81 | setupreleasefile 'now - 7 days' 'now - 2 days' | |
82 | msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <' | |
0440d936 | 83 | testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 |
89500a25 DK |
84 | |
85 | setupreleasefile 'now - 7 days' 'now - 2 days' | |
86 | msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >' | |
0440d936 | 87 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 |
89500a25 DK |
88 | |
89 | setupreleasefile 'now - 7 days' 'now - 2 days' | |
90 | msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <' | |
0440d936 | 91 | testfailure --nomsg aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 |
89500a25 DK |
92 | |
93 | setupreleasefile 'now - 7 days' 'now - 2 days' | |
94 | msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >' | |
0440d936 | 95 | testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 |