com php-src: Fixed #68458 Change pm.start_servers default warning to notice: sapi/fpm/tests/015.phpt
| From: | Remi Collet | Date: | Thu, 20 Nov 2014 07:12:27 +0000 |
| Subject: | com php-src: Fixed #68458 Change pm.start_servers default warning to notice: sapi/fpm/tests/015.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83160@lists.php.net to get a copy of this message | ||
Commit: 1939097ededdbf1d42305e32f6a9947ff6a7e91f
Author: Remi Collet <remi@php.net> Thu, 20 Nov 2014 08:12:27 +0100
Parents: a128cbad578adbb2ca16ae84c8b2fef609067c8d
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1939097ededdbf1d42305e32f6a9947ff6a7e91f
Log:
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
Bugs:
https://bugs.php.net/68458
Changed paths:
A sapi/fpm/tests/015.phpt
Diff:
diff --git a/sapi/fpm/tests/015.phpt b/sapi/fpm/tests/015.phpt
new file mode 100644
index 0000000..00e8bf3
--- /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