fpm_get_status_basic.phpt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. --TEST--
  2. FPM: Function fpm_get_status basic test
  3. --SKIPIF--
  4. <?php include "skipif.inc"; ?>
  5. --FILE--
  6. <?php
  7. require_once "tester.inc";
  8. $cfg = <<<EOT
  9. [global]
  10. error_log = {{FILE:LOG}}
  11. [unconfined]
  12. listen = {{ADDR}}
  13. pm = dynamic
  14. pm.max_children = 5
  15. pm.start_servers = 1
  16. pm.min_spare_servers = 1
  17. pm.max_spare_servers = 3
  18. EOT;
  19. $code = <<<EOT
  20. <?php
  21. echo "Test Start\n";
  22. var_dump(fpm_get_status());
  23. echo "Test End\n";
  24. EOT;
  25. $headers = [];
  26. $tester = new FPM\Tester($cfg, $code);
  27. $tester->start();
  28. $tester->expectLogStartNotices();
  29. $tester->request()->printBody();
  30. $tester->terminate();
  31. $tester->expectLogTerminatingNotices();
  32. $tester->close();
  33. ?>
  34. Done
  35. --EXPECTF--
  36. Test Start
  37. array(15) {
  38. ["pool"]=>
  39. string(10) "unconfined"
  40. ["process-manager"]=>
  41. string(7) "dynamic"
  42. ["start-time"]=>
  43. int(%d)
  44. ["start-since"]=>
  45. int(%d)
  46. ["accepted-conn"]=>
  47. int(1)
  48. ["listen-queue"]=>
  49. int(0)
  50. ["max-listen-queue"]=>
  51. int(0)
  52. ["listen-queue-len"]=>
  53. int(%d)
  54. ["idle-processes"]=>
  55. int(0)
  56. ["active-processes"]=>
  57. int(1)
  58. ["total-processes"]=>
  59. int(1)
  60. ["max-active-processes"]=>
  61. int(1)
  62. ["max-children-reached"]=>
  63. int(0)
  64. ["slow-requests"]=>
  65. int(0)
  66. ["procs"]=>
  67. array(1) {
  68. [0]=>
  69. array(14) {
  70. ["pid"]=>
  71. int(%d)
  72. ["state"]=>
  73. string(7) "Running"
  74. ["start-time"]=>
  75. int(%d)
  76. ["start-since"]=>
  77. int(%d)
  78. ["requests"]=>
  79. int(1)
  80. ["request-duration"]=>
  81. int(%d)
  82. ["request-method"]=>
  83. string(3) "GET"
  84. ["request-uri"]=>
  85. string(%d) "%s"
  86. ["query-string"]=>
  87. string(0) ""
  88. ["request-length"]=>
  89. int(0)
  90. ["user"]=>
  91. string(1) "-"
  92. ["script"]=>
  93. string(%d) "%s"
  94. ["last-request-cpu"]=>
  95. float(0)
  96. ["last-request-memory"]=>
  97. int(0)
  98. }
  99. }
  100. }
  101. Test End
  102. Done
  103. --CLEAN--
  104. <?php
  105. require_once "tester.inc";
  106. FPM\Tester::clean();
  107. ?>