From 67ce137e3fdbfd9bd2d1f7e33af7e557f4f58ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Tue, 8 Mar 2022 20:46:50 +0800 Subject: [PATCH] popen solution --- conf/local_macos/{test_co.conf => test.conf} | 4 ++++ test_scripts/popen.lua | 4 ++++ 2 files changed, 8 insertions(+) rename conf/local_macos/{test_co.conf => test.conf} (74%) create mode 100644 test_scripts/popen.lua diff --git a/conf/local_macos/test_co.conf b/conf/local_macos/test.conf similarity index 74% rename from conf/local_macos/test_co.conf rename to conf/local_macos/test.conf index 8bd1797..3d75b57 100644 --- a/conf/local_macos/test_co.conf +++ b/conf/local_macos/test.conf @@ -9,5 +9,9 @@ server { location /api/ngx/test/co { content_by_lua_file $resty_loc/nginx/scripts/tests/co.lua; } + + location /api/ngx/test/popen { + content_by_lua_file $resty_loc/nginx/scripts/tests/popen.lua; + } } diff --git a/test_scripts/popen.lua b/test_scripts/popen.lua new file mode 100644 index 0000000..6662cab --- /dev/null +++ b/test_scripts/popen.lua @@ -0,0 +1,4 @@ +io.popen("sleep 3; echo hello>/tmp/foo.txt") + +ngx.say("main") +