summaryrefslogtreecommitdiff
path: root/test/httpserver/testfiles
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2018-02-20 21:49:13 -0500
committerReinhard Tartler <siretart@tauware.de>2018-02-20 21:49:13 -0500
commitf28f88e5e72ba1499409047a9d6985eb312c0232 (patch)
treec9c267f18264b3dfe715a363935bb6ac20904492 /test/httpserver/testfiles
parente19a5db232e1ef90e9a02159d2fbd9707ffe4373 (diff)
parent6d7e9562e8485591a4888f1fc2d3c6c657dc7a01 (diff)
Merge tag 'BoxBackup-0.12.master.180102.6d7e956' into upstream
Diffstat (limited to 'test/httpserver/testfiles')
-rw-r--r--test/httpserver/testfiles/httpserver.conf5
-rwxr-xr-xtest/httpserver/testfiles/testrequests.pl13
2 files changed, 10 insertions, 8 deletions
diff --git a/test/httpserver/testfiles/httpserver.conf b/test/httpserver/testfiles/httpserver.conf
index 1a1c4644..d8c72a3f 100644
--- a/test/httpserver/testfiles/httpserver.conf
+++ b/test/httpserver/testfiles/httpserver.conf
@@ -1,5 +1,6 @@
-
-AddressPrefix = http://localhost:1080
+# Use 127.0.0.1 instead of localhost to force use of IPv4, as that is what the server
+# binds to. Windows tends to use IPv6 instead if possible, breaking the test.
+AddressPrefix = http://127.0.0.1:1080
Server
{
diff --git a/test/httpserver/testfiles/testrequests.pl b/test/httpserver/testfiles/testrequests.pl
index 85380ee0..fd4274b4 100755
--- a/test/httpserver/testfiles/testrequests.pl
+++ b/test/httpserver/testfiles/testrequests.pl
@@ -2,7 +2,9 @@
use strict;
use LWP::UserAgent;
-my $url_base = 'http://localhost:1080';
+# Use 127.0.0.1 instead of localhost to force use of IPv4, as that is what the server
+# binds to. Windows tends to use IPv6 instead if possible, breaking the test.
+my $url_base = 'http://127.0.0.1:1080';
my $ua = LWP::UserAgent->new(env_proxy => 0, keep_alive => 1, timeout => 30);
@@ -47,7 +49,8 @@ if($response3->code() != 200)
print "Redirected GET request...\n";
my $response4 = $ua->get("$url_base/redirect?key=value");
-exit 4 unless $response4->is_success();
+die "GET ".$response4->request()->url()." failed: ".$response4->content()
+ unless $response4->is_success();
my $content4 = $response4->content();
@@ -110,13 +113,11 @@ sub check_url
my ($c,$url) = @_;
unless($c =~ m~URI:</b> (.+?)</p>~)
{
- print "URI not found\n";
- exit(1);
+ die "URI not found in response: '$c'\n";
}
if($url ne $1)
{
- print "Wrong URI in content\n";
- exit(1);
+ die "Wrong URI in content: expected '$url' but found '$1'\n";
}
}