@@ -8,19 +8,28 @@ FPM: Test various messages on start, from master and childs
8
8
include "include.inc " ;
9
9
10
10
$ logfile = dirname (__FILE__ ).'/php-fpm.log.tmp ' ;
11
- $ port = 9000 +PHP_INT_SIZE ;
11
+ $ port1 = 9000 +PHP_INT_SIZE ;
12
+ $ port2 = 9001 +PHP_INT_SIZE ;
12
13
13
14
$ cfg = <<<EOT
14
15
[global]
15
16
error_log = $ logfile
16
17
log_level = notice
17
- [unconfined ]
18
- listen = 127.0.0.1: $ port
19
- listen.allowed_clients=127.0.0.1,xxx
18
+ [pool1 ]
19
+ listen = 127.0.0.1: $ port1
20
+ listen.allowed_clients=127.0.0.1
20
21
user = foo
21
22
pm = dynamic
22
23
pm.max_children = 5
23
- ;pm.start_servers = 2
24
+ pm.min_spare_servers = 1
25
+ pm.max_spare_servers = 3
26
+ catch_workers_output = yes
27
+ [pool2]
28
+ listen = 127.0.0.1: $ port2
29
+ listen.allowed_clients=xxx
30
+ pm = dynamic
31
+ pm.max_children = 5
32
+ pm.start_servers = 1
24
33
pm.min_spare_servers = 1
25
34
pm.max_spare_servers = 3
26
35
catch_workers_output = yes
29
38
$ fpm = run_fpm ($ cfg , $ tail );
30
39
if (is_resource ($ fpm )) {
31
40
$ i = 0 ;
32
- while (($ i ++ < 30 ) && !($ fp = @fsockopen ('127.0.0.1 ' , $ port ))) {
41
+ while (($ i ++ < 30 ) && !($ fp = @fsockopen ('127.0.0.1 ' , $ port1 ))) {
33
42
usleep (10000 );
34
43
}
35
44
if ($ fp ) {
@@ -38,11 +47,16 @@ if (is_resource($fpm)) {
38
47
}
39
48
for ($ i =0 ; $ i <10 ; $ i ++) {
40
49
try {
41
- run_request ('127.0.0.1 ' , $ port );
50
+ run_request ('127.0.0.1 ' , $ port1 );
42
51
} catch (Exception $ e ) {
43
- echo "Error \n" ;
52
+ echo "Error 1 \n" ;
44
53
}
45
54
}
55
+ try {
56
+ run_request ('127.0.0.1 ' , $ port2 );
57
+ } catch (Exception $ e ) {
58
+ echo "Error 2 \n" ;
59
+ }
46
60
proc_terminate ($ fpm );
47
61
if (!feof ($ tail )) {
48
62
echo stream_get_contents ($ tail );
@@ -55,12 +69,14 @@ if (is_resource($fpm)) {
55
69
Done
56
70
--EXPECTF--
57
71
Started
58
- [%s] NOTICE: [pool unconfined] pm.start_servers is not set. It's been set to 2.
59
- [%s] NOTICE: [pool unconfined] 'user' directive is ignored when FPM is not running as root
72
+ Error 2
73
+ [%s] NOTICE: [pool pool1] pm.start_servers is not set. It's been set to 2.
74
+ [%s] NOTICE: [pool pool1] 'user' directive is ignored when FPM is not running as root
60
75
[%s] NOTICE: fpm is running, pid %d
61
76
[%s] NOTICE: ready to handle connections
62
- [%s] WARNING: [pool unconfined] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
63
- [%s] WARNING: [pool unconfined] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
77
+ [%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Wrong IP address 'xxx' in listen.allowed_clients"
78
+ [%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: There are no allowed addresses for this pool"
79
+ [%s] WARNING: [pool pool2] child %d said into stderr: "ERROR: Connection disallowed: IP address '127.0.0.1' has been dropped."
64
80
[%s] NOTICE: Terminating ...
65
81
[%s] NOTICE: exiting, bye-bye!
66
82
Done
0 commit comments