diff --git a/sapi/fpm/tests/socket-close-on-exec.phpt b/sapi/fpm/tests/socket-close-on-exec.phpt index b879854059f2..9a62449a9080 100644 --- a/sapi/fpm/tests/socket-close-on-exec.phpt +++ b/sapi/fpm/tests/socket-close-on-exec.phpt @@ -3,7 +3,7 @@ FPM: Set CLOEXEC on the listen and connection socket --SKIPIF-- /dev/null'); +FPM\Tester::skipIfShellCommandFails('lsof -v', 'lsof-org/lsof'); ?> --FILE-- &1", $output, $code); + if ($result === false || $code) { + die("skip command '$command' faieled with code $code"); + } + if (!is_null($expectedPartOfOutput)) { + if (is_array($output)) { + foreach ($output as $line) { + if (str_contains($line, $expectedPartOfOutput)) { + // string found so no need to skip + return; + } + } + } + die("skip command '$command' did not contain output '$expectedPartOfOutput'"); } }