summaryrefslogtreecommitdiff
path: root/sapi/fpm/tests/include.inc
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/fpm/tests/include.inc')
-rw-r--r--sapi/fpm/tests/include.inc19
1 files changed, 16 insertions, 3 deletions
diff --git a/sapi/fpm/tests/include.inc b/sapi/fpm/tests/include.inc
index b195fad507..5cbb08b478 100644
--- a/sapi/fpm/tests/include.inc
+++ b/sapi/fpm/tests/include.inc
@@ -52,6 +52,18 @@ function run_fpm($config, &$out = false, $extra_args = '') /* {{{ */
}
/* }}} */
+function test_fpm_conf($config, &$msg = NULL) { /* {{{ */
+ $cfg = dirname(__FILE__).'/test-fpm-config.tmp';
+ file_put_contents($cfg, $config);
+ exec(get_fpm_path() . ' -t -y ' . $cfg . ' 2>&1', $output, $code);
+ if ($code) {
+ $msg = preg_replace("/\[.+?\]/", "", $output[0]);
+ return false;
+ }
+ return true;
+}
+/* }}} */
+
function run_fpm_till($needle, $config, $max = 10) /* {{{ */
{
$i = 0;
@@ -76,7 +88,7 @@ function run_fpm_till($needle, $config, $max = 10) /* {{{ */
}
/* }}} */
-function fpm_display_log($tail, $n=1, $ignore='systemd') {
+function fpm_display_log($tail, $n=1, $ignore='systemd') { /* {{{ */
while ($n) {
$a = fgets($tail);
if (empty($ignore) || !strpos($a, $ignore)) {
@@ -84,9 +96,9 @@ function fpm_display_log($tail, $n=1, $ignore='systemd') {
$n--;
}
}
-}
+} /* }}} */
-function run_request($host, $port, $uri='/ping', $query='') {
+function run_request($host, $port, $uri='/ping', $query='') { /* {{{ */
require_once 'fcgi.inc';
$client = new Adoy\FastCGI\Client($host, $port);
$params = array(
@@ -109,3 +121,4 @@ function run_request($host, $port, $uri='/ping', $query='') {
);
return $client->request($params, false)."\n";
}
+/* }}} */