]> git.saurik.com Git - apt.git/blame - test/integration/test-releasefile-date-older
configureable acquire targets to download additional files
[apt.git] / test / integration / test-releasefile-date-older
CommitLineData
6bf93605
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
11setupaptarchive --no-update
12
13# we don't complain as the server could have just sent a 'Hit' here and this
14# 'downgrade attack' is usually performed by out-of-sync mirrors. Valid-Until
15# catches the 'real' downgrade attacks (expect that it finds stale mirrors).
16# Scaring users with an error here serves hence no point.
17
18msgmsg 'InRelease file is silently rejected if' 'new Date is before old Date'
19rm -rf rootdir/var/lib/apt/lists
20generatereleasefiles 'now' 'now + 7 days'
21signreleasefiles
22testsuccess aptget update
23listcurrentlistsdirectory > listsdir.lst
24redatereleasefiles 'now - 2 days'
25testsuccess aptget update
26testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
27
28msgmsg 'Release.gpg file is silently rejected if' 'new Date is before old Date'
29rm -rf rootdir/var/lib/apt/lists
30generatereleasefiles 'now' 'now + 7 days'
31signreleasefiles
32find aptarchive -name 'InRelease' -delete
33testsuccess aptget update
34listcurrentlistsdirectory > listsdir.lst
35redatereleasefiles 'now - 2 days'
36find aptarchive -name 'InRelease' -delete
37testsuccess aptget update
38testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
39
40msgmsg 'Crisscross InRelease/Release.gpg file is silently rejected if' 'new Date is before old Date'
41rm -rf rootdir/var/lib/apt/lists
42generatereleasefiles 'now' 'now + 7 days'
43signreleasefiles
44find aptarchive -name 'Release.gpg' -delete
45testsuccess aptget update
46listcurrentlistsdirectory > listsdir.lst
47redatereleasefiles 'now - 2 days'
48find aptarchive -name 'InRelease' -delete
49testsuccess aptget update
50testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
51
52msgmsg 'Crisscross Release.gpg/InRelease file is silently rejected if' 'new Date is before old Date'
53rm -rf rootdir/var/lib/apt/lists
54generatereleasefiles 'now' 'now + 7 days'
55signreleasefiles
56find aptarchive -name 'InRelease' -delete
57testsuccess aptget update
58listcurrentlistsdirectory > listsdir.lst
59redatereleasefiles 'now - 2 days'
60find aptarchive -name 'Release.gpg' -delete
61testsuccess aptget update
62testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"