1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
From 46a32f76549ae7c1399751d64b3cfdee54105833 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 14 Sep 2022 11:08:44 +0200
Subject: [PATCH] fix tests on systemd enabled build
---
.../tests/gh8885-stderr-fd-reload-usr1.phpt | 16 ++++++++++++----
.../tests/gh8885-stderr-fd-reload-usr2.phpt | 19 ++++++++++++++-----
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/sapi/fpm/tests/gh8885-stderr-fd-reload-usr1.phpt b/sapi/fpm/tests/gh8885-stderr-fd-reload-usr1.phpt
index 4ff8d0660936..c03994ce513d 100644
--- a/sapi/fpm/tests/gh8885-stderr-fd-reload-usr1.phpt
+++ b/sapi/fpm/tests/gh8885-stderr-fd-reload-usr1.phpt
@@ -40,7 +40,11 @@ assert($content !== false && strlen($content) > 0, 'File must not be empty');
$errorLogLines = explode("\n", $content);
array_pop($errorLogLines);
-assert(count($errorLogLines) === 2, 'Expected 2 records in the error_log file');
+if (count($errorLogLines) === 3) {
+ assert(strpos($errorLogLines[2], 'systemd'));
+} else {
+ assert(count($errorLogLines) === 2, 'Expected 2 records in the error_log file:' . print_r($errorLogLines, true));
+}
assert(strpos($errorLogLines[0], 'NOTICE: fpm is running, pid'));
assert(strpos($errorLogLines[1], 'NOTICE: ready to handle connections'));
@@ -61,9 +65,13 @@ array_pop($errorLogLines);
assert(count($errorLogLines) >= 4, 'Expected at least 4 records in the error_log file');
assert(strpos($errorLogLines[0], 'NOTICE: fpm is running, pid'));
assert(strpos($errorLogLines[1], 'NOTICE: ready to handle connections'));
-assert(strpos($errorLogLines[2], 'NOTICE: error log file re-opened'));
-assert(strpos($errorLogLines[3], 'NOTICE: access log file re-opened'));
-
+if (strpos($errorLogLines[2], 'systemd')) {
+ assert(strpos($errorLogLines[3], 'NOTICE: error log file re-opened'));
+ assert(strpos($errorLogLines[4], 'NOTICE: access log file re-opened'));
+} else {
+ assert(strpos($errorLogLines[2], 'NOTICE: error log file re-opened'));
+ assert(strpos($errorLogLines[3], 'NOTICE: access log file re-opened'));
+}
$tester->ping('{{ADDR}}');
$stderrLines = $tester->getLogLines(-1);
diff --git a/sapi/fpm/tests/gh8885-stderr-fd-reload-usr2.phpt b/sapi/fpm/tests/gh8885-stderr-fd-reload-usr2.phpt
index 68d9f6fa68b6..e337c83e89f0 100644
--- a/sapi/fpm/tests/gh8885-stderr-fd-reload-usr2.phpt
+++ b/sapi/fpm/tests/gh8885-stderr-fd-reload-usr2.phpt
@@ -40,7 +40,11 @@ assert($content !== false && strlen($content) > 0, 'File must not be empty');
$errorLogLines = explode("\n", $content);
array_pop($errorLogLines);
-assert(count($errorLogLines) === 2, 'Expected 2 records in the error_log file');
+if (count($errorLogLines) === 3) {
+ assert(strpos($errorLogLines[2], 'systemd'));
+} else {
+ assert(count($errorLogLines) === 2, 'Expected 2 records in the error_log file:' . print_r($errorLogLines, true));
+}
assert(strpos($errorLogLines[0], 'NOTICE: fpm is running, pid'));
assert(strpos($errorLogLines[1], 'NOTICE: ready to handle connections'));
@@ -61,10 +65,15 @@ array_pop($errorLogLines);
assert(count($errorLogLines) >= 5, 'Expected at least 5 records in the error_log file');
assert(strpos($errorLogLines[0], 'NOTICE: fpm is running, pid'));
assert(strpos($errorLogLines[1], 'NOTICE: ready to handle connections'));
-assert(strpos($errorLogLines[2], 'NOTICE: Reloading in progress'));
-assert(strpos($errorLogLines[3], 'NOTICE: reloading: execvp'));
-assert(strpos($errorLogLines[4], 'NOTICE: using inherited socket'));
-
+if (strpos($errorLogLines[2], 'systemd')) {
+ assert(strpos($errorLogLines[3], 'NOTICE: Reloading in progress'));
+ assert(strpos($errorLogLines[4], 'NOTICE: reloading: execvp'));
+ assert(strpos($errorLogLines[5], 'NOTICE: using inherited socket'));
+} else {
+ assert(strpos($errorLogLines[2], 'NOTICE: Reloading in progress'));
+ assert(strpos($errorLogLines[3], 'NOTICE: reloading: execvp'));
+ assert(strpos($errorLogLines[4], 'NOTICE: using inherited socket'));
+}
$tester->ping('{{ADDR}}');
$stderrLines = $tester->getLogLines(-1);
assert(count($stderrLines) === 1, 'Must be only 1 record in the access.log');
|