4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'amd64' 'i386'
11 insertpackage 'unstable' 'apt' 'amd64,i386' '1.0'
13 setupaptarchive --no-update
16 msgmsg 'Test InRelease with' "$1"
17 rm -rf rootdir/var/lib/apt/lists
18 cp -a aptarchive/dists aptarchive/dists.good
19 # get our cache populated
20 testsuccess aptget update
21 listcurrentlistsdirectory > listsdir.lst
23 # hit again with a good cache
24 testsuccessequal "Hit
:1 $1 unstable InRelease
25 Reading package lists...
" aptget update
26 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
28 # drop an architecture, which means the file should be gone now
29 configarchitecture 'i386'
30 sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst
31 testsuccessequal "Hit
:1 $1 unstable InRelease
32 Reading package lists...
" aptget update
33 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
35 # readd arch so its downloaded again…
36 configarchitecture 'amd64' 'i386'
37 # … but oh noes, hashsum mismatch!
38 SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
39 mv aptarchive/dists/unstable/main/binary-amd64/Packages.gz aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig
40 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 Hashes of expected
file:
51 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
52 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig' | cut -d' ' -f 1)
53 Hashes of received
file:
54 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz' | cut -d' ' -f 1)
55 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
56 Last modification reported
: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
57 Release
file created
at: $(releasefiledate 'aptarchive/dists/unstable/InRelease')
58 Reading package lists...
59 E
: Failed to fetch
$1/dists
/unstable
/main
/binary
-amd64/Packages.gz Hash Sum mismatch
60 Hashes of expected
file:
61 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
62 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig' | cut -d' ' -f 1)
63 Hashes of received
file:
64 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz' | cut -d' ' -f 1)
65 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
66 Last modification reported
: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
67 Release
file created
at: $(releasefiledate 'aptarchive/dists/unstable/InRelease')
68 E
: Some index files failed to download. They have been ignored
, or old ones used instead.
" aptget update
69 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
70 rm -rf aptarchive/dists
71 cp -a aptarchive/dists.good aptarchive/dists
73 # … now everything is fine again
74 testsuccessequal "Hit
:1 $1 unstable InRelease
75 Get
:2 $1 unstable
/main amd64 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B
]
76 Reading package lists...
" aptget update
77 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
79 webserverconfig 'aptwebserver::support::modified-since' 'false'
80 webserverconfig 'aptwebserver::support::last-modified' 'false'
81 testsuccessequal "Get
:1 $1 unstable InRelease
[$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B
]
82 Reading package lists...
" aptget update
83 webserverconfig 'aptwebserver::support::modified-since' 'true'
84 webserverconfig 'aptwebserver::support::last-modified' 'true'
86 msgmsg 'Test Release.gpg with' "$1"
87 rm -rf rootdir/var/lib/apt/lists
88 find aptarchive/dists -name 'InRelease' -delete
89 # get our cache populated
90 testsuccess aptget update
91 listcurrentlistsdirectory > listsdir.lst
93 # hit again with a good cache
94 testsuccessequal "Ign
:1 $1 unstable InRelease
96 Hit
:2 $1 unstable Release
97 Reading package lists...
" aptget update
98 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
100 # drop an architecture, which means the file should be gone now
101 configarchitecture 'i386'
102 sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst
103 testsuccessequal "Ign
:1 $1 unstable InRelease
105 Hit
:2 $1 unstable Release
106 Reading package lists...
" aptget update
107 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
109 # readd arch so its downloaded again…
110 configarchitecture 'amd64' 'i386'
111 # … but oh noes, hashsum mismatch!
112 SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
113 mv aptarchive/dists/unstable/main/binary-amd64/Packages.gz aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig
114 cat > aptarchive/dists/unstable/main/binary-amd64/Packages <<EOF
119 compressfile aptarchive/dists/unstable/main/binary-amd64/Packages
120 testfailureequal "Ign
:1 $1 unstable InRelease
122 Hit
:2 $1 unstable Release
123 Get
:4 $1 unstable
/main amd64 Packages
[$SIZE B
]
124 Err
:4 $1 unstable
/main amd64 Packages
126 Hashes of expected
file:
127 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
128 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig' | cut -d' ' -f 1)
129 Hashes of received
file:
130 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz' | cut -d' ' -f 1)
131 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
132 Last modification reported
: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
133 Release
file created
at: $(releasefiledate 'aptarchive/dists/unstable/Release')
134 Reading package lists...
135 E
: Failed to fetch
$1/dists
/unstable
/main
/binary
-amd64/Packages.gz Hash Sum mismatch
136 Hashes of expected
file:
137 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig')
138 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig' | cut -d' ' -f 1)
139 Hashes of received
file:
140 - SHA256
:$(sha256sum 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz' | cut -d' ' -f 1)
141 - Checksum
-FileSize:$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
142 Last modification reported
: $(lastmodification 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz')
143 Release
file created
at: $(releasefiledate 'aptarchive/dists/unstable/Release')
144 E
: Some index files failed to download. They have been ignored
, or old ones used instead.
" aptget update
145 testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
146 rm -rf aptarchive/dists
147 cp -a aptarchive/dists.good aptarchive/dists
148 find aptarchive/dists -name 'InRelease' -delete
150 # … now everything is fine again
151 testsuccessequal "Ign
:1 $1 unstable InRelease
153 Hit
:2 $1 unstable Release
154 Get
:4 $1 unstable
/main amd64 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B
]
155 Reading package lists...
" aptget update
156 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
158 webserverconfig 'aptwebserver::support::modified-since' 'false'
159 webserverconfig 'aptwebserver::support::last-modified' 'false'
160 testsuccessequal "Ign
:1 $1 unstable InRelease
162 Get
:2 $1 unstable Release
[$(stat -c '%s' 'aptarchive/dists/unstable/Release') B
]
163 Reading package lists...
" aptget update
164 webserverconfig 'aptwebserver::support::modified-since' 'true'
165 webserverconfig 'aptwebserver::support::last-modified' 'true'
167 rm -rf aptarchive/dists
168 cp -a aptarchive/dists.good aptarchive/dists
170 # new release file, but the indexes are the same
171 redatereleasefiles '+2 hours'
173 rm -rf rootdir/var/lib/apt/lists.good
174 cp -a rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists.good
175 testsuccessequal "Get
:1 $1 unstable InRelease
[$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B
]
176 Reading package lists...
" aptget update
178 rm -rf rootdir/var/lib/apt/lists
179 cp -a rootdir/var/lib/apt/lists.good rootdir/var/lib/apt/lists
180 find rootdir/var/lib/apt/lists -name '*_Packages*' -delete
181 testsuccessequal "Get
:1 $1 unstable InRelease
[$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B
]
182 Get
:2 $1 unstable
/main amd64 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B
]
183 Get
:3 $1 unstable
/main i386 Packages
[$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-i386/Packages.gz') B
]
184 Reading package lists...
" aptget update
186 rm -rf aptarchive/dists
187 cp -a aptarchive/dists.good aptarchive/dists
191 methodtest "http
://localhost
:${APTHTTPPORT}"
193 changetohttpswebserver
194 methodtest "https
://localhost
:${APTHTTPSPORT}"