Skip to content

Commit b049245

Browse files
committed
unit test
1 parent 3347b41 commit b049245

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

sapi/fpm/tests/cpuaffinity.phpt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--TEST--
2+
FPM: cpu affinity test
3+
--SKIPIF--
4+
<?php include "skipif.inc";
5+
6+
if (!str_contains(PHP_OS, 'Linux')) {
7+
die('skipped supported only on Linux');
8+
}
9+
?>
10+
--FILE--
11+
<?php
12+
13+
require_once "tester.inc";
14+
15+
$cfg = <<<EOT
16+
[global]
17+
error_log = {{FILE:LOG}}
18+
pid = {{FILE:PID}}
19+
[unconfined]
20+
listen = {{ADDR:IPv4}}
21+
pm = dynamic
22+
pm.max_children = 1
23+
pm.start_servers = 1
24+
pm.min_spare_servers = 1
25+
pm.max_spare_servers = 1
26+
process.cpumask = 1
27+
EOT;
28+
29+
$tester = new FPM\Tester($cfg);
30+
$tester->start();
31+
$tester->expectLogStartNotices();
32+
$tester->terminate();
33+
$tester->expectLogTerminatingNotices();
34+
$tester->close();
35+
36+
?>
37+
Done
38+
--EXPECT--
39+
Done
40+
--CLEAN--
41+
<?php
42+
require_once "tester.inc";
43+
FPM\Tester::clean();
44+
?>

0 commit comments

Comments
 (0)