1--TEST--
2FPM: Socket port connection falls back to IPv4
3--SKIPIF--
4<?php
5include "skipif.inc";
6FPM\Tester::skipIfIPv6IsNotSupported();
7?>
8--FILE--
9<?php
10
11require_once "tester.inc";
12
13$cfg = <<<EOT
14[global]
15error_log = {{FILE:LOG}}
16[unconfined]
17listen = {{PORT}}
18pm = dynamic
19pm.max_children = 5
20pm.start_servers = 2
21pm.min_spare_servers = 1
22pm.max_spare_servers = 3
23EOT;
24
25$tester = new FPM\Tester($cfg);
26$port = $tester->getPort();
27// Occupy our port and let things fail
28$busy = stream_socket_server("tcp://[::]:$port");
29$tester->start();
30$tester->expectLogNotice('Failed implicitly binding to ::, retrying with 0.0.0.0');
31$tester->expectLogError("unable to bind listening socket for address '$port': " .
32    'Address already in use \(\d+\)');
33$tester->expectLogError('FPM initialization failed');
34$tester->close(true);
35?>
36Done
37--EXPECT--
38Done
39--CLEAN--
40<?php
41require_once "tester.inc";
42FPM\Tester::clean();
43?>
44