socket-ipv4-fallback.phpt 910 B

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