From fe30c5098fdc2f25b0ae59d60df1e03e9db423e8 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Wed, 30 Aug 2023 13:18:28 +0100 Subject: [PATCH] Fix GH-12077: Check lsof functionality in socket on close test Closes GH-12084 --- NEWS | 4 ++++ sapi/fpm/tests/socket-close-on-exec.phpt | 2 +- sapi/fpm/tests/tester.inc | 20 ++++++++++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index dd0386bd5a9..7839c69487d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ PHP NEWS - Core: . Fixed GH-11847 (DTrace enabled build is broken). (Filip Zrůst) +- FPM: + . Fixed GH-12077 (PHP 8.3.0RC1 borked socket-close-on-exec.phpt). + (Jakub Zelenka) + 31 Aug 2023, PHP 8.3.0RC1 - Core: diff --git a/sapi/fpm/tests/socket-close-on-exec.phpt b/sapi/fpm/tests/socket-close-on-exec.phpt index b879854059f..9a62449a908 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'"); } }