From 1a7fe40ba982c04e2a06901f942c5d4fc06084c8 Mon Sep 17 00:00:00 2001 From: Xin Rong Date: Tue, 29 Aug 2023 20:30:18 +0800 Subject: [PATCH] feat: support openresty 1.21.4.2 (#10004) --- ci/centos7-ci.sh | 2 +- ci/redhat-ci.sh | 2 +- t/chaos/utils/Dockerfile | 2 +- t/core/etcd.t | 10 +++++----- t/node/upstream-websocket.t | 5 ++++- t/plugin/ext-plugin/sanity.t | 11 ++++++++++- t/plugin/ext-plugin/sanity2.t | 11 ++++++++++- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/ci/centos7-ci.sh b/ci/centos7-ci.sh index 6b6483a4f065..41758ca62c59 100755 --- a/ci/centos7-ci.sh +++ b/ci/centos7-ci.sh @@ -33,7 +33,7 @@ install_dependencies() { # install openresty to make apisix's rpm test work yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo - yum install -y openresty-1.21.4.1 openresty-debug-1.21.4.1 openresty-openssl111-debug-devel pcre pcre-devel + yum install -y openresty-1.21.4.2 openresty-debug-1.21.4.2 openresty-openssl111-debug-devel pcre pcre-devel # install luarocks ./utils/linux-install-luarocks.sh diff --git a/ci/redhat-ci.sh b/ci/redhat-ci.sh index 4b307e64811a..4b55cc7e620e 100755 --- a/ci/redhat-ci.sh +++ b/ci/redhat-ci.sh @@ -32,7 +32,7 @@ install_dependencies() { # install openresty to make apisix's rpm test work yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo - yum install -y openresty-1.21.4.1 openresty-debug-1.21.4.1 openresty-openssl111-debug-devel pcre pcre-devel xz + yum install -y openresty-1.21.4.2 openresty-debug-1.21.4.2 openresty-openssl111-debug-devel pcre pcre-devel xz # install luarocks ./utils/linux-install-luarocks.sh diff --git a/t/chaos/utils/Dockerfile b/t/chaos/utils/Dockerfile index 9ab2a0509112..f2e119f02f6d 100644 --- a/t/chaos/utils/Dockerfile +++ b/t/chaos/utils/Dockerfile @@ -17,7 +17,7 @@ ARG ENABLE_PROXY=false -FROM openresty/openresty:1.21.4.1-alpine-fat AS production-stage +FROM openresty/openresty:1.21.4.2-alpine-fat AS production-stage ARG ENABLE_PROXY ARG APISIX_PATH diff --git a/t/core/etcd.t b/t/core/etcd.t index c0715de7b06b..670ada081ab2 100644 --- a/t/core/etcd.t +++ b/t/core/etcd.t @@ -396,8 +396,8 @@ ab --- request GET /t --- grep_error_log eval -qr/init_by_lua:\d+: \S+/ ---- grep_error_log_out -init_by_lua:12: ab -init_by_lua:19: 200 -init_by_lua:26: 404 +qr/init_by_lua.*: \S+/ +--- grep_error_log_out eval +qr{init_by_lua.* ab +init_by_lua.* 200 +init_by_lua.* 404} diff --git a/t/node/upstream-websocket.t b/t/node/upstream-websocket.t index a374b638f6f5..a19a202deb00 100644 --- a/t/node/upstream-websocket.t +++ b/t/node/upstream-websocket.t @@ -270,7 +270,10 @@ passed local client = require "resty.websocket.client" local wb = client:new() local uri = "wss://127.0.0.1:1994/websocket_handshake" - local ok, err = wb:connect(uri) + local opts = { + server_name = "127.0.0.1" + } + local ok, err = wb:connect(uri, opts) if not ok then ngx.say("failed to connect: " .. err) return diff --git a/t/plugin/ext-plugin/sanity.t b/t/plugin/ext-plugin/sanity.t index 1a3732402d71..873a540a8215 100644 --- a/t/plugin/ext-plugin/sanity.t +++ b/t/plugin/ext-plugin/sanity.t @@ -14,7 +14,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -use t::APISIX 'no_plan'; +use t::APISIX; + +my $nginx_binary = $ENV{'TEST_NGINX_BINARY'} || 'nginx'; +my $version = eval { `$nginx_binary -V 2>&1` }; + +if ($version !~ m/\/apisix-nginx-module/) { + plan(skip_all => "apisix-nginx-module not installed"); +} else { + plan('no_plan'); +} repeat_each(1); no_long_string(); diff --git a/t/plugin/ext-plugin/sanity2.t b/t/plugin/ext-plugin/sanity2.t index 206e7b090c2d..67260055862e 100644 --- a/t/plugin/ext-plugin/sanity2.t +++ b/t/plugin/ext-plugin/sanity2.t @@ -14,7 +14,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -use t::APISIX 'no_plan'; +use t::APISIX; + +my $nginx_binary = $ENV{'TEST_NGINX_BINARY'} || 'nginx'; +my $version = eval { `$nginx_binary -V 2>&1` }; + +if ($version !~ m/\/apisix-nginx-module/) { + plan(skip_all => "apisix-nginx-module not installed"); +} else { + plan('no_plan'); +} repeat_each(1); no_long_string();