php-src/sapi/fpm/tests/bug68428-ipv6-allowed-clients.phpt
2018-06-12 17:59:28 +01:00

46 lines
802 B
PHP

--TEST--
FPM: bug68428 - IPv6 allowed client only
--SKIPIF--
<?php
include "skipif.inc";
FPM\Tester::skipIfIPv6IsNotSupported();
?>
--FILE--
<?php
require_once "tester.inc";
$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR:IPv6:ANY}}
listen.allowed_clients = ::1
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
EOT;
$tester = new FPM\Tester($cfg);
$tester->start();
$tester->expectLogStartNotices();
$tester->checkRequest('127.0.0.1', 'IPv4: ok', 'IPv4: error');
$tester->checkRequest('[::1]', 'IPv6: ok', 'IPv6: error');
$tester->terminate();
$tester->expectLogTerminatingNotices();
$tester->close();
?>
Done
--EXPECT--
IPv4: error
IPv6: ok
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>