File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 45
45
- NGINX_VERSION=1.15.8 OPENSSL_VER=1.0.2n OPENSSL_PATCH_VER=1.0.2h
46
46
- NGINX_VERSION=1.15.8 OPENSSL_VER=1.1.0h OPENSSL_PATCH_VER=1.1.0d
47
47
48
+ services :
49
+ - memcache
50
+
48
51
before_install :
49
52
- sudo luarocks install luacheck $LUACHECK_VER
50
53
- luacheck -q .
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use Test::Nginx::Socket::Lua -Base;
4
4
use Cwd qw( cwd) ;
5
5
6
6
$ENV {TEST_NGINX_HOTLOOP } ||= 10;
7
+ $ENV {TEST_NGINX_MEMCACHED_PORT } ||= 11211;
7
8
8
9
our $pwd = cwd();
9
10
Original file line number Diff line number Diff line change @@ -1493,3 +1493,56 @@ timeout
1493
1493
[error]
1494
1494
--- error_log
1495
1495
lua pipe wait process:
1496
+
1497
+
1498
+
1499
+ === TEST 43: spawn sub-process when error_log is configured with syslog
1500
+ --- config
1501
+ location = /t {
1502
+ content_by_lua_block {
1503
+ local function get_ngx_bin_path()
1504
+ local ffi = require "ffi"
1505
+ ffi.cdef[[char **ngx_argv;]]
1506
+ return ffi.string(ffi.C.ngx_argv[0])
1507
+ end
1508
+
1509
+ local conf_file = "$TEST_NGINX_HTML_DIR/nginx.conf"
1510
+ local nginx = get_ngx_bin_path()
1511
+
1512
+ local cmd = nginx .. " -p $TEST_NGINX_HTML_DIR -c " .. conf_file
1513
+ local ngx_pipe = require "ngx.pipe"
1514
+ local ok, reason, status = ngx_pipe.spawn(cmd):wait()
1515
+ ngx.say(ok)
1516
+ ngx.say(reason)
1517
+ ngx.say(status)
1518
+ }
1519
+ }
1520
+ --- user_files
1521
+ >>> nginx.conf
1522
+ events {
1523
+ worker_connections 64;
1524
+ }
1525
+ error_log syslog:server=127.0.0.1:$TEST_NGINX_MEMCACHED_PORT,facility=local1 info;
1526
+ daemon off;
1527
+ master_process off;
1528
+ worker_processes 1;
1529
+ http {
1530
+ lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
1531
+ init_worker_by_lua_block {
1532
+ ngx.timer.at(0, function()
1533
+ local ngx_pipe = require "ngx.pipe"
1534
+ local ok, reason, status = ngx_pipe.spawn("echo"):wait()
1535
+ if not ok then
1536
+ os.exit(status)
1537
+ end
1538
+ os.exit(0)
1539
+ end)
1540
+ }
1541
+ }
1542
+ >>> logs/error.log
1543
+ --- response_body
1544
+ true
1545
+ exit
1546
+ 0
1547
+ --- no_error_log
1548
+ [error]
You can’t perform that action at this time.
0 commit comments