From 87bfa66ddf16c17053ba7bbae72400c9939ecf6d Mon Sep 17 00:00:00 2001 From: Weibin Yao Date: Sun, 6 Nov 2022 12:37:08 +0800 Subject: [PATCH] fixed some broken test cases. --- test/t/http_check.t | 4 ++-- test/t/ssl_hello_check.t | 22 +++++++++++++++------- test/test.sh | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/test/t/http_check.t b/test/t/http_check.t index 872cc1a..9085241 100644 --- a/test/t/http_check.t +++ b/test/t/http_check.t @@ -74,7 +74,7 @@ GET / --- request GET / ---- response_body_like: ^<(.*)>$ +--- response_body_like: ^.*$ === TEST 3: the http_check test --- http_config @@ -337,7 +337,7 @@ GET / --- request GET / ---- response_body_like: ^<(.*)>$ +--- response_body_like: ^.*$ === TEST 12: the http_check test-single server, least conn --- http_config diff --git a/test/t/ssl_hello_check.t b/test/t/ssl_hello_check.t index ebcedf3..4cbcfde 100644 --- a/test/t/ssl_hello_check.t +++ b/test/t/ssl_hello_check.t @@ -25,12 +25,13 @@ __DATA__ --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.alipay.com"; proxy_pass https://test; } --- request GET / ---- response_body_like: ^<(.*)>[\r\n\s\t]*$ +--- response_body_like: ^.*$ === TEST 2: the ssl_hello_check test with ip_hash --- http_config @@ -46,12 +47,13 @@ GET / --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.alipay.com"; proxy_pass https://test; } --- request GET / ---- response_body_like: ^<(.*)>[\r\n\s\t]*$ +--- response_body_like: ^.*$ === TEST 3: the ssl_hello_check test with bad ip --- http_config @@ -67,12 +69,13 @@ GET / --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.alipay.com"; proxy_pass https://test; } --- request GET / ---- response_body_like: ^<(.*)>[\r\n\s\t]*$ +--- response_body_like: ^.*$ === TEST 4: the ssl_hello_check test with least_conn --- http_config @@ -88,17 +91,18 @@ GET / --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.alipay.com"; proxy_pass https://test; } --- request GET / ---- response_body_like: ^<(.*)>[\r\n\s\t]*$ +--- response_body_like: ^.*$ === TEST 5: the ssl_hello_check test with port 80 --- http_config upstream test{ - server www.alipay.com:443; + server www.nginx.org:443; check interval=4000 rise=1 fall=1 timeout=2000 type=http port=80; check_http_send "GET / HTTP/1.0\r\n\r\n"; @@ -108,12 +112,14 @@ GET / --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.nginx.org"; proxy_pass https://test; } --- request GET / ---- response_body_like: ^<(.*)>[\r\n\s\t]*$ +--- error_code: 502 +--- response_body_like: ^.*$ === TEST 6: the ssl_hello_check test with port 443 --- http_config @@ -126,12 +132,13 @@ GET / --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.alipay.com"; proxy_pass https://test; } --- request GET / ---- response_body_like: ^<(.*)>[\r\n\s\t]*$ +--- response_body_like: ^.*$ === TEST 7: the ssl_hello_check test with port 444 --- http_config @@ -144,6 +151,7 @@ GET / --- config location / { proxy_ssl_session_reuse off; + proxy_set_header Host "www.alipay.com"; proxy_pass https://test; } diff --git a/test/test.sh b/test/test.sh index 5d4c3bd..33287de 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,3 +1,3 @@ #!/bin/sh -TEST_NGINX_USE_HUP=1 PATH=/home/yaoweibin/nginx/sbin:$PATH prove -r t + TEST_NGINX_SLEEP=1 TEST_NGINX_USE_HUP=1 PATH=/home/yaoweibin/nginx/sbin:$PATH prove -r t