File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ # vi:ft=
2+
3+ use Test ::Nginx::Socket::Lua;
4+
5+ plan tests => 2 * blocks();
6+
7+ no_long_string();
8+
9+
10+ run_tests();
11+
12+ __DATA__
13+
14+ === TEST 1 : SIGHUP followed by SIGQUIT
15+ -- - config
16+ location = /t {
17+ content_by_lua_block {
18+ local pid = ngx. worker. pid()
19+ os. execute(" kill -HUP " .. pid)
20+ ngx. sleep (0.01 )
21+
22+ os. execute(" kill -QUIT " .. pid)
23+ }
24+ }
25+ --- request
26+ GET /t
27+ -- - ignore_response
28+ -- - wait : 0.1
29+ -- - error_log eval
30+ qr/ \[notice\] \d+ # \d+: exit$/
31+ -- - no_error_log eval
32+ qr/ \[notice\] \d+ # \d+: reconfiguring/
33+
34+
35+
36+ === TEST 2 : exit after receiving SIGHUP in single process mode
37+ -- - config
38+ location = /t {
39+ content_by_lua_block {
40+ local pid = ngx. worker. pid()
41+ os. execute(" kill -HUP " .. pid)
42+ }
43+ }
44+ --- request
45+ GET /t
46+ -- - ignore_response
47+ -- - wait : 0.1
48+ -- - error_log eval
49+ qr/ \[notice\] \d+ # \d+: exit$/
50+ -- - no_error_log eval
51+ qr/ \[notice\] \d+ # \d+: reconfiguring/
You can’t perform that action at this time.
0 commit comments