summaryrefslogtreecommitdiffhomepage
path: root/tests/test-webserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-webserver.cpp')
-rw-r--r--tests/test-webserver.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/tests/test-webserver.cpp b/tests/test-webserver.cpp
index 714cdf2..bd89aab 100644
--- a/tests/test-webserver.cpp
+++ b/tests/test-webserver.cpp
@@ -604,7 +604,7 @@ BOOST_FIXTURE_TEST_CASE(http_redirect, Fixture)
BOOST_CHECK_EQUAL(result.second, "301 Redirecting to reichwein.it ...");
}
-BOOST_FIXTURE_TEST_CASE(http_fcgi, Fixture)
+BOOST_FIXTURE_TEST_CASE(http_fcgi_ip4, Fixture)
{
std::string webserver_config{R"CONFIG(<webserver>
<user>www-data</user>
@@ -649,3 +649,48 @@ BOOST_FIXTURE_TEST_CASE(http_fcgi, Fixture)
BOOST_CHECK_EQUAL(result.second, "returning data of : ");
}
+BOOST_FIXTURE_TEST_CASE(http_fcgi_ip6, Fixture)
+{
+ std::string webserver_config{R"CONFIG(<webserver>
+ <user>www-data</user>
+ <group>www-data</group>
+ <threads>10</threads>
+ <statisticspath>stats.db</statisticspath>
+ <plugin-directory>../plugins</plugin-directory>
+ <sites>
+ <site>
+ <name>localhost</name>
+ <host>localhost</host>
+ <host>[::1]</host>
+ <path requested="/fcgi">
+ <plugin>fcgi</plugin>
+ <target>::1:8765</target>
+ </path>
+ </site>
+ </sites>
+ <sockets>
+ <socket>
+ <address>::1</address>
+ <port>8080</port>
+ <protocol>http</protocol>
+ <site>localhost</site>
+ </socket>
+ </sockets>
+</webserver>)CONFIG"};
+ WebserverProcess serverProcess{webserver_config};
+ BOOST_REQUIRE(serverProcess.is_running());
+
+ FastCGIProcess fcgiProcess("./fcgi1", "::1", 8765);
+ BOOST_REQUIRE(fcgiProcess.is_running());
+
+ auto result {HTTP("/fcgi/abc")};
+ BOOST_CHECK_EQUAL(result.first, fmt::format(
+"HTTP/1.1 200 OK\r\n"
+"Server: Reichwein.IT Webserver {}\r\n"
+"Content-Type: text/plain\r\n"
+"Content-Length: {}\r\n"
+"\r\n"
+ , VERSION, result.second.size()));
+ BOOST_CHECK_EQUAL(result.second, "returning data of : ");
+}
+