summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2014-11-20 08:12:27 +0100
committerRemi Collet <remi@php.net>2014-11-20 08:12:27 +0100
commit1939097ededdbf1d42305e32f6a9947ff6a7e91f (patch)
tree10ddc0c9705d485ef3d820ea06cb64b9dbd73f9f /sapi
parenta128cbad578adbb2ca16ae84c8b2fef609067c8d (diff)
downloadphp-git-1939097ededdbf1d42305e32f6a9947ff6a7e91f.tar.gz
Fixed #68458 Change pm.start_servers default warning to notice
Add another test 014 checks that no "notice" are traced when log_level=warning 015 checks that "notice" are traced when log_level=notice
Diffstat (limited to 'sapi')
-rw-r--r--sapi/fpm/tests/015.phpt64
1 files changed, 64 insertions, 0 deletions
diff --git a/sapi/fpm/tests/015.phpt b/sapi/fpm/tests/015.phpt
new file mode 100644
index 0000000000..00e8bf3f5f
--- /dev/null
+++ b/sapi/fpm/tests/015.phpt
@@ -0,0 +1,64 @@
+--TEST--
+FPM: Test various messages on start, from master and childs
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+$port = 9000+PHP_INT_SIZE;
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+log_level = notice
+[unconfined]
+listen = 127.0.0.1:$port
+listen.allowed_clients=127.0.0.1,xxx
+user = foo
+pm = dynamic
+pm.max_children = 5
+;pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+catch_workers_output = yes
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ $i = 0;
+ while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Started\n";
+ fclose($fp);
+ }
+ proc_terminate($fpm);
+ if (!feof($tail)) {
+ echo stream_get_contents($tail);
+ }
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+Done
+--EXPECTF--
+Started
+[%s] NOTICE: [pool unconfined] pm.start_servers is not set. It's been set to 2.
+[%s] NOTICE: [pool unconfined] 'user' directive is ignored when FPM is not running as root
+[%s] NOTICE: fpm is running, pid %d
+[%s] NOTICE: ready to handle connections
+[%s] WARNING: [pool unconfined] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
+[%s] WARNING: [pool unconfined] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
+[%s] NOTICE: Terminating ...
+[%s] NOTICE: exiting, bye-bye!
+Done
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?> \ No newline at end of file