Skip to content

Commit 0815b73

Browse files
tests: update nginx to 1.29.8.
1 parent 8554b8f commit 0815b73

8 files changed

Lines changed: 150 additions & 75 deletions

File tree

t/002-content.t

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,6 @@ Bar: nil
533533
location /lua {
534534
content_by_lua '
535535
local data = "hello, world"
536-
-- ngx.header["Content-Length"] = #data
537-
-- ngx.header.content_length = #data
538536
ngx.print(data)
539537
';
540538
}
@@ -544,7 +542,7 @@ Bar: nil
544542
--- request
545543
GET /main
546544
--- response_headers
547-
Content-Length: 12
545+
Content-Type: text/plain
548546
--- response_body chop
549547
hello, world
550548
--- no_error_log

t/016-resp-header.t

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,14 @@ bar
374374
--- config
375375
location /main {
376376
set $footer '';
377+
proxy_http_version 1.0;
377378
proxy_pass http://127.0.0.1:$server_port/echo;
378379
header_filter_by_lua '
379380
ngx.var.footer = ngx.header.content_length
380381
';
381382
echo_after_body $footer;
382383
}
384+
383385
location /echo {
384386
content_by_lua 'ngx.print("Hello")';
385387
}
@@ -2186,6 +2188,7 @@ hi
21862188
--- error_log eval
21872189
[ "my Content-Length: 8589934591",
21882190
qr/upstream prematurely closed connection while sending to client|upstream prematurely closed connection while reading upstream/]
2191+
--- skip_nginx: 5: > 1.29.7
21892192
21902193
21912194

t/020-subrequest.t

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use Test::Nginx::Util 'is_tcp_port_used';
1212
no_root_location;
1313
repeat_each(2);
1414

15-
plan tests => repeat_each() * (blocks() * 3 + 23);
15+
plan tests => repeat_each() * (blocks() * 3 + 22);
1616

1717
$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211;
1818
$ENV{TEST_NGINX_HTML_DIR} ||= html_dir();
@@ -1396,6 +1396,8 @@ upstream timed out
13961396
#proxy_read_timeout 100ms;
13971397
proxy_buffering on;
13981398
proxy_pass http://127.0.0.1:$TEST_NGINX_TCP_LISTEN_PORT;
1399+
proxy_http_version 1.0;
1400+
proxy_set_header Connection close;
13991401
}
14001402
14011403
location /main {
@@ -1413,31 +1415,6 @@ GET /main
14131415
--- tcp_reply eval
14141416
"HTTP/1.0 200 OK\r\nContent-Length: 1024\r\n\r\nhello world"
14151417
1416-
--- stap
1417-
F(ngx_http_upstream_finalize_request) {
1418-
printf("upstream fin req: error=%d eof=%d rc=%d\n",
1419-
$r->upstream->peer->connection->read->error,
1420-
$r->upstream->peer->connection->read->eof,
1421-
$rc)
1422-
#print_ubacktrace()
1423-
}
1424-
F(ngx_connection_error) {
1425-
printf("conn err: %d: %s\n", $err, user_string($text))
1426-
#print_ubacktrace()
1427-
}
1428-
F(ngx_http_lua_post_subrequest) {
1429-
printf("post subreq: rc=%d, status=%d\n", $rc, $r->headers_out->status)
1430-
#print_ubacktrace()
1431-
}
1432-
/*
1433-
F(ngx_http_finalize_request) {
1434-
printf("finalize: %d\n", $rc)
1435-
}
1436-
*/
1437-
--- stap_out
1438-
upstream fin req: error=0 eof=1 rc=502
1439-
post subreq: rc=0, status=200
1440-
14411418
--- response_body
14421419
status: 200
14431420
body: hello world
@@ -1518,6 +1495,8 @@ upstream timed out
15181495
#proxy_read_timeout 100ms;
15191496
proxy_buffering on;
15201497
proxy_pass http://127.0.0.1:$TEST_NGINX_TCP_LISTEN_PORT;
1498+
proxy_http_version 1.0;
1499+
proxy_set_header Connection close;
15211500
}
15221501
15231502
location /main {
@@ -1641,6 +1620,7 @@ upstream timed out
16411620
#proxy_read_timeout 100ms;
16421621
proxy_buffering off;
16431622
proxy_pass http://127.0.0.1:$TEST_NGINX_TCP_LISTEN_PORT;
1623+
proxy_set_header Connection close;
16441624
}
16451625
16461626
location /main {
@@ -1927,6 +1907,7 @@ a client request body is buffered to a temporary file
19271907
proxy_http_version 1.1;
19281908
proxy_buffering on;
19291909
proxy_pass http://127.0.0.1:$TEST_NGINX_TCP_LISTEN_PORT;
1910+
proxy_set_header Connection close;
19301911
}
19311912
19321913
location /main {
@@ -1989,6 +1970,7 @@ upstream prematurely closed connection
19891970
#proxy_read_timeout 100ms;
19901971
proxy_http_version 1.1;
19911972
proxy_buffering off;
1973+
proxy_set_header Connection close;
19921974
proxy_pass http://127.0.0.1:$TEST_NGINX_TCP_LISTEN_PORT;
19931975
}
19941976
@@ -2230,6 +2212,7 @@ truncated: false
22302212
#proxy_read_timeout 100ms;
22312213
proxy_buffering off;
22322214
proxy_pass http://127.0.0.1:$TEST_NGINX_TCP_LISTEN_PORT;
2215+
proxy_set_header Connection close;
22332216
}
22342217
22352218
location /main {
@@ -3017,8 +3000,7 @@ method: GET, uri: /foo, X: GET /bar HTTP/1.0
30173000
0
30183001
--- no_error_log
30193002
[error]
3020-
--- skip_nginx
3021-
3: >= 1.21.1
3003+
--- skip_nginx: 3: >= 1.21.1
30223004
30233005
30243006

t/028-req-header.t

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,8 @@ Test-Header: [1]
854854
ngx.req.clear_header("Content-Length")
855855
';
856856
857-
#proxy_pass http://127.0.0.1:8888;
858857
proxy_pass http://127.0.0.1:$server_port/back;
858+
proxy_set_header Connection close;
859859
}
860860
861861
location /back {
@@ -871,15 +871,9 @@ Test-Header: 1
871871
my $body;
872872
873873
if (defined $ENV{TEST_NGINX_USE_HTTP3}) {
874-
$body = qr/Connection: close\r
875-
test-header: 1\r
876-
\r
877-
$/;
874+
$body = qr/Connection: close\r\n(?:.*\r\n)*?test-header: 1\r\n\r\n$/;
878875
} else {
879-
$body = qr/Connection: close\r
880-
Test-Header: 1\r
881-
\r
882-
$/;
876+
$body = qr/Connection: close\r\n(?:.*\r\n)*?Test-Header: 1\r\n\r\n$/;
883877
}
884878
885879
$body;
@@ -1085,7 +1079,8 @@ My-Foo-Header: Hello World
10851079
rewrite_by_lua 'ngx.req.clear_header("R")';
10861080
proxy_pass http://127.0.0.1:$server_port/back;
10871081
proxy_set_header Host foo;
1088-
#proxy_pass http://127.0.0.1:1234/back;
1082+
proxy_http_version 1.0;
1083+
proxy_set_header Connection close;
10891084
}
10901085
10911086
location = /back {
@@ -1132,7 +1127,8 @@ $s . "\r\n";
11321127
';
11331128
proxy_pass http://127.0.0.1:$server_port/back;
11341129
proxy_set_header Host foo;
1135-
#proxy_pass http://127.0.0.1:1234/back;
1130+
proxy_http_version 1.0;
1131+
proxy_set_header Connection close;
11361132
}
11371133
11381134
location = /back {
@@ -1255,7 +1251,8 @@ $body;
12551251
';
12561252
proxy_pass http://127.0.0.1:$server_port/back;
12571253
proxy_set_header Host foo;
1258-
#proxy_pass http://127.0.0.1:1234/back;
1254+
proxy_http_version 1.0;
1255+
proxy_set_header Connection close;
12591256
}
12601257
12611258
location = /back {
@@ -1339,7 +1336,8 @@ $body;
13391336
';
13401337
proxy_pass http://127.0.0.1:$server_port/back;
13411338
proxy_set_header Host foo;
1342-
#proxy_pass http://127.0.0.1:1234/back;
1339+
proxy_http_version 1.0;
1340+
proxy_set_header Connection close;
13431341
}
13441342
13451343
location = /back {
@@ -1692,6 +1690,8 @@ Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
16921690
ngx.req.set_header("foo_bar", "some value");
16931691
';
16941692
proxy_pass http://127.0.0.1:$server_port/back;
1693+
proxy_http_version 1.0;
1694+
proxy_set_header Connection close;
16951695
}
16961696
location = /back {
16971697
echo -n $echo_client_request_headers;
@@ -1700,9 +1700,11 @@ Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
17001700
GET /req-header
17011701
--- response_body_like eval
17021702
qr{^GET /back HTTP/1.0\r
1703-
Host: 127.0.0.1:\d+\r
1703+
(Host: 127.0.0.1:\d+\r
17041704
Connection: close\r
1705-
foo_bar: some value\r
1705+
|Connection: close\r
1706+
Host: 127.0.0.1:\d+\r
1707+
)foo_bar: some value\r
17061708
\r
17071709
$}
17081710

t/030-uri-args.t

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ rewrite: err: attempt to use zero-length uri
530530
ngx.req.set_uri("/bar")
531531
';
532532
proxy_pass http://127.0.0.1:$TEST_NGINX_SERVER_PORT;
533+
proxy_http_version 1.0;
534+
proxy_set_header Connection close;
533535
}
534536
--- request
535537
GET /foo?world
@@ -550,6 +552,8 @@ HTTP/1.0 hello
550552
ngx.req.set_uri_args({["ca t"] = "%"})
551553
';
552554
proxy_pass http://127.0.0.1:$TEST_NGINX_SERVER_PORT;
555+
proxy_http_version 1.0;
556+
proxy_set_header Connection close;
553557
}
554558
--- request
555559
GET /foo?world
@@ -1102,6 +1106,8 @@ CORE::join("", @k);
11021106
ngx.req.set_uri("/bar")
11031107
';
11041108
proxy_pass http://127.0.0.1:$TEST_NGINX_SERVER_PORT;
1109+
proxy_http_version 1.0;
1110+
proxy_set_header Connection close;
11051111
}
11061112
--- request
11071113
GET /foo?world
@@ -1508,6 +1514,8 @@ GET /lua
15081514
ngx.req.set_uri("/bar")
15091515
';
15101516
proxy_pass http://127.0.0.1:$TEST_NGINX_SERVER_PORT;
1517+
proxy_http_version 1.0;
1518+
proxy_set_header Connection close;
15111519
}
15121520
--- request
15131521
GET /foo?world
@@ -1534,6 +1542,8 @@ GET /lua
15341542
ngx.req.set_uri("/bar")
15351543
';
15361544
proxy_pass http://127.0.0.1:$TEST_NGINX_SERVER_PORT;
1545+
proxy_http_version 1.0;
1546+
proxy_set_header Connection close;
15371547
}
15381548
--- request
15391549
GET /foo?world

t/062-count.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ worker: 5
460460
--- request
461461
GET /test
462462
--- response_body
463-
n = 22
463+
n = 21
464464
--- no_error_log
465465
[error]
466466

t/129-ssl-socket.t

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,16 +807,15 @@ $::DSTRootCertificate"
807807
GET /t
808808
--- response_body eval
809809
qr{connected: 1
810-
failed to do SSL handshake: (22: certificate chain too long|20: unable to get local issuer certificate|21: unable to verify the first certificate)
810+
failed to do SSL handshake: (22: certificate chain too long|(?:2|20): unable to get (?:local )?issuer certificate|21: unable to verify the first certificate)
811811
failed to send http request: closed
812812
}
813-
814813
--- log_level: debug
815814
--- grep_error_log eval: qr/lua ssl (?:set|save|free) session: [0-9A-F]+/
816815
--- grep_error_log_out
817816
--- error_log eval
818817
['lua ssl server name: "openresty.org"',
819-
qr/lua ssl certificate verify error: \((22: certificate chain too long|20: unable to get local issuer certificate|21: unable to verify the first certificate)\)/]
818+
qr/lua ssl certificate verify error: \((22: certificate chain too long|(?:2|20): unable to get (?:local )?issuer certificate|21: unable to verify the first certificate)\)/]
820819
--- no_error_log
821820
SSL reused session
822821
[alert]
@@ -887,7 +886,7 @@ $::DSTRootCertificate"
887886
GET /t
888887
--- response_body eval
889888
qr/connected: 1
890-
failed to do SSL handshake: (22: certificate chain too long|20: unable to get local issuer certificate|21: unable to verify the first certificate)
889+
failed to do SSL handshake: (22: certificate chain too long|(?:2|20): unable to get (?:local )?issuer certificate|21: unable to verify the first certificate)
891890
failed to send http request: closed
892891
/
893892

0 commit comments

Comments
 (0)