blob: e673d5f716aab9f4a4ad5582c8029ac21c8940b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
#!/bin/sh
set -e
TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'i386'
insertpackage 'wheezy' 'apt' 'all' '0.8.15'
getlabelfromsuite() {
echo -n 'Testcases'
}
setupaptarchive
setupreleasefile() {
rm -rf rootdir/var/lib/apt/lists
aptget clean
generatereleasefiles "$1" "$2"
signreleasefiles
}
aptgetupdate() {
if aptget update $* 2>&1 | grep -q 'is expired'; then
return 1
else
return 0
fi
}
setupreleasefile
msgtest 'Release file is accepted as it has' 'no Until'
testsuccess --nomsg aptgetupdate
setupreleasefile
msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid'
testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600
setupreleasefile 'now - 2 days'
msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600
setupreleasefile 'now - 3 days' 'now + 1 day'
msgtest 'Release file is accepted as it has' 'good Until'
testsuccess --nomsg aptgetupdate
setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is rejected as it has' 'bad Until'
testfailure --nomsg aptgetupdate
setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600
setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400
setupreleasefile 'now - 7 days' 'now + 4 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400
setupreleasefile 'now - 7 days' 'now + 4 days'
msgtest 'Release file is accepted as it has' 'good labeled Max-Valid'
testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600
setupreleasefile 'now - 7 days' 'now + 4 days'
msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400
setupreleasefile 'now - 7 days' 'now + 1 days'
msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)'
testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600
setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)'
testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600
setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <'
testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200
setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200
setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <'
testfailure --nomsg aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920
setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >'
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920
|