From 905fba60a046646a26a56b4c5d4a5dc7d5906f0d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 9 Mar 2015 01:54:46 +0100 Subject: derive more of https from http method Bug #778375 uncovered that https wasn't properly integrated in the class family tree of http as it was supposed to be leading to a NULL pointer dereference. Fixing this 'properly' was deemed to much diff for practically no gain that late in the release, so commit 0c2dc43d4fe1d026650b5e2920a021557f9534a6 just fixed the synptom, while this commit here is fixing the cause plus adding a test. --- .../test-bug-778375-server-has-no-reason-phrase | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 test/integration/test-bug-778375-server-has-no-reason-phrase (limited to 'test/integration') 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' -- cgit v1.2.3