-msgtest 'Test redirection works in' 'package download'
-aptget install unrelated --download-only -qq && msgpass || msgfail
+ msgtest 'Test redirection works in' 'package download'
+ testsuccess --nomsg aptget install unrelated --download-only -y
+}
+
+for CODE in 301 302 307; do
+ webserverconfig 'aptwebserver::redirect::httpcode' "$CODE"
+ testrun "$CODE" "http://localhost:${APTHTTPPORT}"
+ testsuccess grep "^HTTP/1.1 $CODE " aptarchive/webserver.log
+ rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives
+done
+
+changetohttpswebserver
+
+for CODE in 301 302 307; do
+ webserverconfig 'aptwebserver::redirect::httpcode' "$CODE"
+ testrun "$CODE" "https://localhost:${APTHTTPSPORT}"
+ rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/archives
+done