socket-invalid-allowed-clients.phpt 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. FPM: Socket for invalid allowed client only
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. ?>
  7. --FILE--
  8. <?php
  9. require_once "tester.inc";
  10. $cfg = <<<EOT
  11. [global]
  12. error_log = {{FILE:LOG}}
  13. [unconfined]
  14. listen = {{ADDR}}
  15. listen.allowed_clients = xxx
  16. pm = dynamic
  17. pm.max_children = 5
  18. pm.start_servers = 1
  19. pm.min_spare_servers = 1
  20. pm.max_spare_servers = 3
  21. catch_workers_output = yes
  22. EOT;
  23. $tester = new FPM\Tester($cfg);
  24. $tester->start();
  25. $tester->expectLogStartNotices();
  26. $tester->checkRequest('127.0.0.1', 'Req: ok', 'Req: error');
  27. $tester->terminate();
  28. // this is from child when starting
  29. $tester->expectLogLine("ERROR: Wrong IP address 'xxx' in listen.allowed_clients");
  30. $tester->expectLogLine("ERROR: There are no allowed addresses");
  31. // this is from the request
  32. $tester->expectLogLine("ERROR: Connection disallowed: IP address '127.0.0.1' has been dropped.");
  33. $tester->expectLogTerminatingNotices();
  34. $tester->close();
  35. ?>
  36. Done
  37. --EXPECT--
  38. Req: error
  39. Done
  40. --CLEAN--
  41. <?php
  42. require_once "tester.inc";
  43. FPM\Tester::clean();
  44. ?>