summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-778375-server-has-no-reason-phrase
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
commit21248c0f00ee71412dbadc6ebf84011cf974346d (patch)
tree7dc1f5904399482d2128765b5b86d57a4ac5b3e1 /test/integration/test-bug-778375-server-has-no-reason-phrase
parente5f34ad3b043abf033c1626eb8449b75955d6760 (diff)
parent4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (diff)
Merge branch 'debian/experimental' into feature/srv-records
Conflicts: cmdline/apt-helper.cc cmdline/makefile
Diffstat (limited to 'test/integration/test-bug-778375-server-has-no-reason-phrase')
-rwxr-xr-xtest/integration/test-bug-778375-server-has-no-reason-phrase40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/integration/test-bug-778375-server-has-no-reason-phrase b/test/integration/test-bug-778375-server-has-no-reason-phrase
new file mode 100755
index 000000000..23481ef88
--- /dev/null
+++ b/test/integration/test-bug-778375-server-has-no-reason-phrase
@@ -0,0 +1,40 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'native'
+
+echo 'found' > aptarchive/working
+changetohttpswebserver -o 'aptwebserver::redirect::replace::/redirectme/=/' \
+ -o 'aptwebserver::httpcode::200=200' -o 'aptwebserver::httpcode::404=404' \
+ -o 'aptwebserver::httpcode::301=301'
+
+testdownload() {
+ rm -f downfile
+ msgtest "download of a $1 via" "${3%%:*}"
+ $2 --nomsg downloadfile "$3" downfile
+
+ cp rootdir/tmp/testsuccess.output download.log
+ #looking for "HTTP server doesn't give Reason-Phrase for 200"
+ testsuccess grep 'give Reason-Phrase for' download.log
+
+ if [ "$2" = 'testsuccess' ]; then
+ testfileequal downfile 'found'
+ else
+ testfailure test -e downfile
+ fi
+}
+
+runtest() {
+ testdownload 'file works' 'testsuccess' "$1/working"
+ testdownload 'file via redirect works' 'testsuccess' "$1/redirectme/working"
+
+ testdownload 'non-existent file fails' 'testfailure' "$1/failing"
+ testdownload 'non-existent file via redirect fails' 'testfailure' "$1/redirectme/failing"
+}
+
+runtest 'http://localhost:8080'
+runtest 'https://localhost:4433'