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