Skip to content

Commit

Permalink
fixed some broken test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoweibin committed Nov 6, 2022
1 parent e85752f commit 87bfa66
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions test/t/http_check.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GET /
--- request
GET /
--- response_body_like: ^<(.*)>$
--- response_body_like: ^.*$
=== TEST 3: the http_check test
--- http_config
Expand Down Expand Up @@ -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
Expand Down
22 changes: 15 additions & 7 deletions test/t/ssl_hello_check.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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";
Expand All @@ -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
Expand All @@ -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
Expand All @@ -144,6 +151,7 @@ GET /
--- config
location / {
proxy_ssl_session_reuse off;
proxy_set_header Host "www.alipay.com";
proxy_pass https://test;
}
Expand Down
2 changes: 1 addition & 1 deletion test/test.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 87bfa66

Please sign in to comment.