From: Remi Collet Date: Tue, 18 Nov 2014 10:08:49 +0000 (+0100) Subject: Add test for bug #68442 X-Git-Tag: php-5.6.4RC1~55^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51394dff3f8d55fd40823e1841a97e631f4dfec5;p=php Add test for bug #68442 Add another helper function fpm_display_log Restore change from c996a989 badly reverted in 8c0cc49 --- diff --git a/sapi/fpm/tests/002.phpt b/sapi/fpm/tests/002.phpt index 2ef6cedc38..ce878661ea 100644 --- a/sapi/fpm/tests/002.phpt +++ b/sapi/fpm/tests/002.phpt @@ -8,12 +8,13 @@ FPM: Startup and connect include "include.inc"; $logfile = dirname(__FILE__).'/php-fpm.log.tmp'; +$port = 9000+PHP_INT_SIZE; $cfg = << +--FILE-- + +--EXPECTF-- +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +IPv4 ok +[%d-%s-%d %d:%d:%d] NOTICE: Reloading in progress ... +[%d-%s-%d %d:%d:%d] NOTICE: reloading: %s +[%d-%s-%d %d:%d:%d] NOTICE: using inherited socket fd=%d, "127.0.0.1:%d" +[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d +[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections +int(%d) +IPv4 ok +--CLEAN-- + diff --git a/sapi/fpm/tests/include.inc b/sapi/fpm/tests/include.inc index 5d01ae693d..b195fad507 100644 --- a/sapi/fpm/tests/include.inc +++ b/sapi/fpm/tests/include.inc @@ -76,6 +76,16 @@ function run_fpm_till($needle, $config, $max = 10) /* {{{ */ } /* }}} */ +function fpm_display_log($tail, $n=1, $ignore='systemd') { + while ($n) { + $a = fgets($tail); + if (empty($ignore) || !strpos($a, $ignore)) { + echo $a; + $n--; + } + } +} + function run_request($host, $port, $uri='/ping', $query='') { require_once 'fcgi.inc'; $client = new Adoy\FastCGI\Client($host, $port);