4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'amd64' 'i386'
10 insertpackage 'unstable' 'apt' 'amd64,i386' '1.0'
12 setupaptarchive --no-update
15 msgmsg 'Test InRelease with' "$1"
16 rm -rf rootdir/var/lib/apt/lists
17 cp -a aptarchive/dists aptarchive/dists.good
18 # get our cache populated
19 testsuccess aptget update
20 listcurrentlistsdirectory > listsdir.lst
22 # hit again with a good cache
23 testsuccessequal "Hit
:1 $1 unstable InRelease
24 Reading package lists...
" aptget update
25 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
27 # drop an architecture, which means the file should be gone now
28 configarchitecture 'i386'
29 sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst
30 testsuccessequal "Hit
:1 $1 unstable InRelease
31 Reading package lists...
" aptget update
32 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
34 # readd arch so its downloaded again…
35 configarchitecture 'amd64' 'i386'
36 # … but oh noes, hashsum mismatch!
37 SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
38 find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete
39 cat >> aptarchive/dists/unstable/main/binary-amd64/Packages <<EOF
45 compressfile aptarchive/dists/unstable/main/binary-amd64/Packages
46 testfailureequal "Hit
:1 $1 unstable InRelease
47 Get
:2 $1 unstable
/main amd64 Packages
[$SIZE B
]
48 Err
:2 $1 unstable
/main amd64 Packages
50 Reading package lists...
51 E
: Failed to fetch
$1/dists
/unstable
/main
/binary
-amd64/Packages.gz Hash Sum mismatch
52 E
: Some index files failed to download. They have been ignored
, or old ones used instead.
" aptget update
53 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
54 rm -rf aptarchive/dists
55 cp -a aptarchive/dists.good aptarchive/dists
57 # … now everything is fine again
58 testsuccessequal "Hit
:1 $1 unstable InRelease
59 Get
:2 $1 unstable
/main amd64 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B
]
60 Reading package lists...
" aptget update
61 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
63 webserverconfig 'aptwebserver::support::modified-since' 'false'
64 webserverconfig 'aptwebserver::support::last-modified' 'false'
65 testsuccessequal "Get
:1 $1 unstable InRelease
[$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B
]
66 Reading package lists...
" aptget update
67 webserverconfig 'aptwebserver::support::modified-since' 'true'
68 webserverconfig 'aptwebserver::support::last-modified' 'true'
70 msgmsg 'Test Release.gpg with' "$1"
71 rm -rf rootdir/var/lib/apt/lists
72 find aptarchive/dists -name 'InRelease' -delete
73 # get our cache populated
74 testsuccess aptget update
75 listcurrentlistsdirectory > listsdir.lst
77 # hit again with a good cache
78 testsuccessequal "Ign
:1 $1 unstable InRelease
80 Hit
:2 $1 unstable Release
81 Reading package lists...
" aptget update
82 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
84 # drop an architecture, which means the file should be gone now
85 configarchitecture 'i386'
86 sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst
87 testsuccessequal "Ign
:1 $1 unstable InRelease
89 Hit
:2 $1 unstable Release
90 Reading package lists...
" aptget update
91 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
93 # readd arch so its downloaded again…
94 configarchitecture 'amd64' 'i386'
95 # … but oh noes, hashsum mismatch!
96 SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
97 find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete
98 cat >> aptarchive/dists/unstable/main/binary-amd64/Packages <<EOF
104 compressfile aptarchive/dists/unstable/main/binary-amd64/Packages
105 testfailureequal "Ign
:1 $1 unstable InRelease
107 Hit
:2 $1 unstable Release
108 Get
:4 $1 unstable
/main amd64 Packages
[$SIZE B
]
109 Err
:4 $1 unstable
/main amd64 Packages
111 Reading package lists...
112 E
: Failed to fetch
$1/dists
/unstable
/main
/binary
-amd64/Packages.gz Hash Sum mismatch
113 E
: Some index files failed to download. They have been ignored
, or old ones used instead.
" aptget update
114 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
115 rm -rf aptarchive/dists
116 cp -a aptarchive/dists.good aptarchive/dists
117 find aptarchive/dists -name 'InRelease' -delete
119 # … now everything is fine again
120 testsuccessequal "Ign
:1 $1 unstable InRelease
122 Hit
:2 $1 unstable Release
123 Get
:4 $1 unstable
/main amd64 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B
]
124 Reading package lists...
" aptget update
125 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
127 webserverconfig 'aptwebserver::support::modified-since' 'false'
128 webserverconfig 'aptwebserver::support::last-modified' 'false'
129 testsuccessequal "Ign
:1 $1 unstable InRelease
131 Get
:2 $1 unstable Release
[$(stat -c '%s' 'aptarchive/dists/unstable/Release') B
]
132 Reading package lists...
" aptget update
133 webserverconfig 'aptwebserver::support::modified-since' 'true'
134 webserverconfig 'aptwebserver::support::last-modified' 'true'
136 rm -rf aptarchive/dists
137 cp -a aptarchive/dists.good aptarchive/dists
139 # new release file, but the indexes are the same
140 redatereleasefiles '+2 hours'
142 rm -rf rootdir/var/lib/apt/lists.good
143 cp -a rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists.good
144 testsuccessequal "Get
:1 $1 unstable InRelease
[$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B
]
145 Reading package lists...
" aptget update
147 rm -rf rootdir/var/lib/apt/lists
148 cp -a rootdir/var/lib/apt/lists.good rootdir/var/lib/apt/lists
149 find rootdir/var/lib/apt/lists -name '*_Packages*' -delete
150 testsuccessequal "Get
:1 $1 unstable InRelease
[$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B
]
151 Get
:2 $1 unstable
/main amd64 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B
]
152 Get
:3 $1 unstable
/main i386 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-i386/Packages.gz') B
]
153 Reading package lists...
" aptget update
155 rm -rf aptarchive/dists
156 cp -a aptarchive/dists.good aptarchive/dists
160 methodtest "http
://localhost
:${APTHTTPPORT}"
162 changetohttpswebserver
163 methodtest "https
://localhost
:${APTHTTPSPORT}"