From 618d4475fd1fae4a0fc0c1831d899ff1e90f8033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 5 Nov 2017 15:41:52 +0100 Subject: [PATCH 1/2] Skip test for #1388 due to Travis-CI failure listening on ::1. --- tests/vibe.http.server.1388/dub.sdl | 1 - tests/vibe.http.server.1388/source/app.d | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/vibe.http.server.1388/dub.sdl b/tests/vibe.http.server.1388/dub.sdl index c4d7e014e2..f936e66434 100644 --- a/tests/vibe.http.server.1388/dub.sdl +++ b/tests/vibe.http.server.1388/dub.sdl @@ -1,4 +1,3 @@ name "tests" description "IPv6 request" dependency "vibe-d:http" path="../../" -versions "VibeDefaultMain" diff --git a/tests/vibe.http.server.1388/source/app.d b/tests/vibe.http.server.1388/source/app.d index e7b3b32fa6..3bd44f9437 100644 --- a/tests/vibe.http.server.1388/source/app.d +++ b/tests/vibe.http.server.1388/source/app.d @@ -5,8 +5,9 @@ import vibe.stream.operations; import core.time : msecs; import std.datetime : Clock, UTC; -shared static this() +void main() { + version (none) { auto s1 = new HTTPServerSettings; s1.bindAddresses = ["::1"]; s1.port = 11388; @@ -30,6 +31,11 @@ shared static this() exitEventLoop(); }); + runApplication(); + } + + import vibe.core.log : logWarn; + logWarn("Test disabled due to issues listening on ::1 on Travis-CI"); } void handler(scope HTTPServerRequest req, scope HTTPServerResponse res) From 2bdce624fc7f621d8a141c7d2c75f41a1de9ed53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 5 Nov 2017 17:44:15 +0100 Subject: [PATCH 2/2] Use local IPv4 bind address for test cases where it doesn't matter. --- tests/vibe.http.server.1721/source/app.d | 4 ++-- tests/vibe.http.server.host-header/source/app.d | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/vibe.http.server.1721/source/app.d b/tests/vibe.http.server.1721/source/app.d index 1d6f9b91ae..829979028f 100644 --- a/tests/vibe.http.server.1721/source/app.d +++ b/tests/vibe.http.server.1721/source/app.d @@ -11,7 +11,7 @@ shared static this() { auto s1 = new HTTPServerSettings; s1.options &= ~HTTPServerOption.errorStackTraces; - s1.bindAddresses = ["::1"]; + s1.bindAddresses = ["127.0.0.1"]; s1.port = 11721; listenHTTP(s1, &handler); @@ -19,7 +19,7 @@ shared static this() scope (exit) exitEventLoop(); try { - auto conn = connectTCP("::1", 11721); + auto conn = connectTCP("127.0.0.1", 11721); conn.write("GET / HTTP/1.0\r\n\r\n"); string res = cast(string)conn.readLine(); assert(res == "HTTP/1.0 200 OK", res); diff --git a/tests/vibe.http.server.host-header/source/app.d b/tests/vibe.http.server.host-header/source/app.d index eced8ea158..73e04af56e 100644 --- a/tests/vibe.http.server.host-header/source/app.d +++ b/tests/vibe.http.server.host-header/source/app.d @@ -10,14 +10,14 @@ shared static this() { auto s1 = new HTTPServerSettings; s1.options &= ~HTTPServerOption.errorStackTraces; - s1.bindAddresses = ["::1"]; + s1.bindAddresses = ["127.0.0.1"]; s1.port = 11388; listenHTTP(s1, &handler); runTask({ try { - auto conn = connectTCP("::1", 11388); - conn.write("GET / HTTP/1.1\r\nHost: [::1]\r\n\r\n"); + auto conn = connectTCP("127.0.0.1", 11388); + conn.write("GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n"); string res = cast(string)conn.readLine(); assert(res == "HTTP/1.1 200 OK", res); while (conn.readLine().length > 0) {} @@ -37,7 +37,7 @@ shared static this() assert(!conn.connected); logInfo("1.1 without Host header OK."); - conn = connectTCP("::1", 11388); + conn = connectTCP("127.0.0.1", 11388); conn.write("GET / HTTP/1.0\r\n\r\n"); res = cast(string)conn.readLine(); assert(res == "HTTP/1.0 200 OK", res);