summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-not-modified
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-apt-update-not-modified')
-rwxr-xr-xtest/integration/test-apt-update-not-modified58
1 files changed, 57 insertions, 1 deletions
diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified
index 2dc56e76c..a67ecb760 100755
--- a/test/integration/test-apt-update-not-modified
+++ b/test/integration/test-apt-update-not-modified
@@ -12,7 +12,7 @@ insertpackage 'unstable' 'apt' 'all' '1.0'
setupaptarchive --no-update
methodtest() {
- msgmsg 'Test with' "$1"
+ msgmsg 'Test InRelease with' "$1"
rm -rf rootdir/var/lib/apt/lists
# get our cache populated
testsuccess aptget update
@@ -36,6 +36,62 @@ Reading package lists..." aptget update
Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B]
Reading package lists..." aptget update
testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
+
+ webserverconfig 'aptwebserver::support::modified-since' 'false'
+ webserverconfig 'aptwebserver::support::last-modified' 'false'
+ testsuccessequal "Get:1 $1 unstable InRelease [$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B]
+Reading package lists..." aptget update
+ webserverconfig 'aptwebserver::support::modified-since' 'true'
+ webserverconfig 'aptwebserver::support::last-modified' 'true'
+
+ msgmsg 'Test Release.gpg with' "$1"
+ rm -rf rootdir/var/lib/apt/lists
+ cp -a aptarchive/dists aptarchive/dists.good
+ find aptarchive/dists -name 'InRelease' -delete
+ # get our cache populated
+ testsuccess aptget update
+ listcurrentlistsdirectory > listsdir.lst
+
+ # hit again with a good cache
+ testsuccessequal "Ign $1 unstable InRelease
+ 404 Not Found
+Hit $1 unstable Release
+Hit $1 unstable Release.gpg
+Reading package lists..." aptget update
+ testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
+
+ # drop an architecture, which means the file should be gone now
+ configarchitecture 'i386'
+ sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst
+ testsuccessequal "Ign $1 unstable InRelease
+ 404 Not Found
+Hit $1 unstable Release
+Hit $1 unstable Release.gpg
+Reading package lists..." aptget update
+ testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)"
+
+ # readd arch so its downloaded again
+ configarchitecture 'amd64' 'i386'
+ testsuccessequal "Ign $1 unstable InRelease
+ 404 Not Found
+Hit $1 unstable Release
+Hit $1 unstable Release.gpg
+Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B]
+Reading package lists..." aptget update
+ testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
+
+ webserverconfig 'aptwebserver::support::modified-since' 'false'
+ webserverconfig 'aptwebserver::support::last-modified' 'false'
+ testsuccessequal "Ign $1 unstable InRelease
+ 404 Not Found
+Get:1 $1 unstable Release [$(stat -c '%s' 'aptarchive/dists/unstable/Release') B]
+Get:2 $1 unstable Release.gpg [$(stat -c '%s' 'aptarchive/dists/unstable/Release.gpg') B]
+Reading package lists..." aptget update
+ webserverconfig 'aptwebserver::support::modified-since' 'true'
+ webserverconfig 'aptwebserver::support::last-modified' 'true'
+
+ rm -rf aptarchive/dists
+ cp -a aptarchive/dists.good aptarchive/dists
}
changetowebserver