]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-update-not-modified
2dc56e76cc6f4d788de46d0115bc498840ca5900
[apt.git] / test / integration / test-apt-update-not-modified
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6
7 setupenvironment
8 configarchitecture 'amd64' 'i386'
9
10 insertpackage 'unstable' 'apt' 'all' '1.0'
11
12 setupaptarchive --no-update
13
14 methodtest() {
15 msgmsg 'Test with' "$1"
16 rm -rf rootdir/var/lib/apt/lists
17 # get our cache populated
18 testsuccess aptget update
19 listcurrentlistsdirectory > listsdir.lst
20
21 # hit again with a good cache
22 testsuccessequal "Hit $1 unstable InRelease
23 Reading package lists..." aptget update
24 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
25
26 # drop an architecture, which means the file should be gone now
27 configarchitecture 'i386'
28 sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst
29 testsuccessequal "Hit $1 unstable InRelease
30 Reading package lists..." aptget update
31 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
32
33 # readd arch so its downloaded again
34 configarchitecture 'amd64' 'i386'
35 testsuccessequal "Hit $1 unstable InRelease
36 Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B]
37 Reading package lists..." aptget update
38 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
39 }
40
41 changetowebserver
42 methodtest 'http://localhost:8080'
43
44 changetohttpswebserver
45 methodtest 'https://localhost:4433'