Skip to content

Commit 81d7022

Browse files
authored
tests: switch HTTP/3 curl to static-curl 8.20.0.
CI switched to curl 8.20.0 (static-curl 8.20.0). Several curl changes since 8.3.0 altered the stderr messages our tests match against, so the affected `--- curl_error` expectations need updating. The changes map to three upstream curl commits: * http/3: add description for known server error codes (f6e8531c03ed, 8.19.0) appends the error code and its name to the HTTP/3 stream reset message: "HTTP/3 stream 0 reset by server" -> "HTTP/3 stream 0 reset by server (error 0x102 INTERNAL_ERROR)" -> t/005-exit.t * h2+h3: align stream close handling (0f042efcb1, 8.19.0) rewrites the HTTP/2 stream reset message and aligns it with HTTP/3: "HTTP/2 stream 1 was not closed cleanly" / "was reset" -> "HTTP/2 stream 1 reset by server (error 0x2 INTERNAL_ERROR)" (it also changed the HTTP/3 path that emits "ngtcp2_conn_writev_stream returned error: ERR_CLOSING") -> t/033-ctx.t, t/041-header-filter.t, t/091-coroutine.t * ngtcp2: check error code on connect failure (115fe808f2, 8.17.0) makes a QUIC handshake aborted by the server a permanent connect failure (CURLE_COULDNT_CONNECT, exit 7) instead of retrying until a timeout. The test (which deliberately fails the handshake via ngx.exit(500) in ssl_certificate_by_lua*) now sees: "curl: (28) Connection time-out" -> "Failed to connect to ... port ... after N ms: Could not connect to server" -> t/166-ssl-client-hello.t
1 parent eb227ca commit 81d7022

6 files changed

Lines changed: 36 additions & 35 deletions

File tree

‎.github/workflows/build_and_test.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ jobs:
153153
https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/drizzle7-$DRIZZLE_VER.tar.gz
154154
fi
155155
wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/boringssl-20230902-x64-focal.tar.gz
156-
wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/curl-h3-x64-focal.tar.gz
156+
wget https://github.com/stunnel/static-curl/releases/download/8.20.0/curl-linux-x86_64-glibc-8.20.0.tar.xz
157157
158-
- name: Install curl-h3
159-
run: sudo tar -C / -xf curl-h3-x64-focal.tar.gz
158+
- name: Install HTTP/3-capable curl
159+
run: |
160+
sudo mkdir -p /opt/curl/bin
161+
sudo tar -C /opt/curl/bin -xf curl-linux-x86_64-glibc-8.20.0.tar.xz curl
160162
161163
- name: Start memcached (native, UDP enabled)
162164
run: |
@@ -239,7 +241,7 @@ jobs:
239241
- name: Build nginx
240242
run: |
241243
export LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
242-
export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:/opt/curl-h3/bin:$PATH
244+
export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:/opt/curl/bin:$PATH
243245
export NGX_BUILD_CC=$CC
244246
sh util/build-without-ssl.sh ${{ matrix.NGINX_VERSION }} > build.log 2>&1 || (cat build.log && exit 1)
245247
sh util/build-with-dd.sh ${{ matrix.NGINX_VERSION }} > build.log 2>&1 || (cat build.log && exit 1)
@@ -250,7 +252,7 @@ jobs:
250252
251253
- name: Run releng check
252254
run: |
253-
export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:/opt/curl-h3/bin:$PATH
255+
export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:/opt/curl/bin:$PATH
254256
ngx-releng > check.txt || true
255257
lines=$(wc -l check.txt | awk '{print $1}')
256258
if [ "$lines" -gt 5 ]; then cat check.txt; exit 1; fi
@@ -272,7 +274,7 @@ jobs:
272274
- name: Run tests
273275
run: |
274276
export LD_LIBRARY_PATH=$LUAJIT_LIB:$PWD/mockeagain:$LD_LIBRARY_PATH
275-
export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:/opt/curl-h3/bin:$PATH
277+
export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:/opt/curl/bin:$PATH
276278
export LD_PRELOAD=$PWD/mockeagain/mockeagain.so
277279
export TEST_NGINX_HTTP3_CRT=$PWD/t/cert/http3/http3.crt
278280
export TEST_NGINX_HTTP3_KEY=$PWD/t/cert/http3/http3.key

‎t/005-exit.t‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ GET /t
783783
--- no_error_log
784784
[error]
785785
--- curl_error
786-
curl: (95) HTTP/3 stream 0 reset by server
786+
curl: (95) HTTP/3 stream 0 reset by server (error 0x102 INTERNAL_ERROR)
787787
788788
789789
@@ -802,8 +802,7 @@ GET /t
802802
--- no_error_log
803803
[error]
804804
--- curl_error
805-
curl: (95) HTTP/3 stream 0 reset by server
806-
805+
curl: (95) HTTP/3 stream 0 reset by server (error 0x102 INTERNAL_ERROR)
807806
808807
809808
=== TEST 29: refuses NGX_AGAIN

‎t/033-ctx.t‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ GET /t
279279
--- error_log
280280
ngx.ctx = 32
281281
--- curl_error eval
282-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
282+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
283283

284284

285285

‎t/041-header-filter.t‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ GET /read
125125
--- error_code
126126
--- response_body
127127
--- curl_error eval
128-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
128+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
129129

130130

131131

@@ -469,7 +469,7 @@ failed to run header_filter_by_lua*: header_filter_by_lua(nginx.conf:47):2: Some
469469
--- no_error_log
470470
[alert]
471471
--- curl_error eval
472-
qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(28\) Remote peer returned unexpected data|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/
472+
qr/curl: \(56\) ngtcp2_conn_writev_stream returned error: ERR_CLOSING|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(28\) Remote peer returned unexpected data|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/
473473

474474

475475

@@ -494,7 +494,7 @@ failed to run header_filter_by_lua*: unknown reason
494494
--- no_error_log
495495
[alert]
496496
--- curl_error eval
497-
qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(28\) Remote peer returned unexpected data|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/
497+
qr/curl: \(56\) ngtcp2_conn_writev_stream returned error: ERR_CLOSING|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(28\) Remote peer returned unexpected data|curl: \(52\) Empty reply from server|curl: \(95\) HTTP\/3 stream 0 reset by server/
498498

499499

500500

@@ -510,7 +510,7 @@ GET /lua
510510
--- error_log
511511
API disabled in the context of header_filter_by_lua*
512512
--- curl_error eval
513-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
513+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
514514

515515

516516

@@ -526,7 +526,7 @@ GET /lua
526526
--- error_log
527527
API disabled in the context of header_filter_by_lua*
528528
--- curl_error eval
529-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
529+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
530530

531531

532532

@@ -542,7 +542,7 @@ GET /lua
542542
--- error_log
543543
API disabled in the context of header_filter_by_lua*
544544
--- curl_error eval
545-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
545+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
546546

547547

548548

@@ -558,7 +558,7 @@ GET /lua
558558
--- error_log
559559
API disabled in the context of header_filter_by_lua*
560560
--- curl_error eval
561-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
561+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
562562

563563

564564

@@ -574,7 +574,7 @@ GET /lua
574574
--- error_log
575575
API disabled in the context of header_filter_by_lua*
576576
--- curl_error eval
577-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
577+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
578578

579579

580580

@@ -594,7 +594,7 @@ GET /lua
594594
--- error_log
595595
API disabled in the context of header_filter_by_lua*
596596
--- curl_error eval
597-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
597+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
598598

599599

600600

@@ -614,7 +614,7 @@ GET /lua
614614
--- error_log
615615
API disabled in the context of header_filter_by_lua*
616616
--- curl_error eval
617-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
617+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
618618

619619

620620

@@ -630,7 +630,7 @@ GET /lua
630630
--- error_log
631631
API disabled in the context of header_filter_by_lua*
632632
--- curl_error eval
633-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
633+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
634634

635635

636636

@@ -646,7 +646,7 @@ GET /lua
646646
--- error_log
647647
API disabled in the context of header_filter_by_lua*
648648
--- curl_error eval
649-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
649+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
650650

651651

652652

@@ -662,7 +662,7 @@ GET /lua
662662
--- error_log
663663
API disabled in the context of header_filter_by_lua*
664664
--- curl_error eval
665-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
665+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
666666

667667

668668

@@ -696,7 +696,7 @@ GET /lua
696696
--- error_log eval
697697
qr/API disabled in the context of header_filter_by_lua\*|http3 requests are not supported without content-length header/ms
698698
--- curl_error eval
699-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
699+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
700700

701701

702702

@@ -720,7 +720,7 @@ if (defined $ENV{TEST_NGINX_USE_HTTP3}) {
720720

721721
$err_log;
722722
--- curl_error eval
723-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
723+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
724724

725725

726726

@@ -736,7 +736,7 @@ GET /lua
736736
--- error_log
737737
API disabled in the context of header_filter_by_lua*
738738
--- curl_error eval
739-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
739+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
740740

741741

742742

@@ -752,7 +752,7 @@ GET /lua
752752
--- error_log
753753
API disabled in the context of header_filter_by_lua*
754754
--- curl_error eval
755-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
755+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
756756

757757

758758

@@ -801,7 +801,7 @@ in function 'error'
801801
in function 'bar'
802802
in function 'foo'
803803
--- curl_error eval
804-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
804+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
805805

806806

807807

@@ -821,7 +821,7 @@ GET /lua?a=1&b=2
821821
--- error_log eval
822822
qr/failed to load external Lua file ".*?test2\.lua": cannot open .*? No such file or directory/
823823
--- curl_error eval
824-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
824+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
825825

826826

827827

@@ -870,7 +870,7 @@ failed to load inlined Lua code: header_filter_by_lua(nginx.conf:41):2: unexpect
870870
--- no_error_log
871871
no_such_error
872872
--- curl_error eval
873-
qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/
873+
qr/curl: \(56\) ngtcp2_conn_writev_stream returned error: ERR_CLOSING|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)/
874874
875875
876876
@@ -901,7 +901,7 @@ failed to load inlined Lua code: header_filter_by_lua(nginx.conf:49):2: unexpect
901901
--- no_error_log
902902
no_such_error
903903
--- curl_error eval
904-
qr/curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/
904+
qr/curl: \(56\) ngtcp2_conn_writev_stream returned error: ERR_CLOSING|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)/
905905
906906
907907
@@ -927,4 +927,4 @@ failed to load inlined Lua code: header_filter_by_lua(...90123456789012345678901
927927
--- no_error_log
928928
[alert]
929929
--- curl_error eval
930-
qr/curl: \(56\) Failure when receiving data from the peer|curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly: INTERNAL_ERROR \(err 2\)/
930+
qr/curl: \(56\) ngtcp2_conn_writev_stream returned error: ERR_CLOSING|curl: \(56\) Failure when receiving data from the peer|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)/

‎t/091-coroutine.t‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ GET /lua
763763
--- error_log
764764
API disabled in the context of header_filter_by_lua*
765765
--- curl_error eval
766-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
766+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
767767
768768
769769
@@ -1701,7 +1701,7 @@ GET /t
17011701
"in function 'co'"
17021702
]
17031703
--- curl_error eval
1704-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
1704+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 reset by server \(error 0x2 INTERNAL_ERROR\)|curl: \(95\) HTTP\/3 stream 0 reset by server/
17051705
17061706
17071707

‎t/166-ssl-client-hello.t‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3437,7 +3437,7 @@ qr/test completed/,
34373437
GET /t
34383438
--- ignore_response
34393439
--- curl_error eval
3440-
qr/Connection time/
3440+
qr/Failed to connect to .* port .* after .* ms: Could not connect to server/
34413441
--- grep_error_log eval: qr/(client hello: cosocket test start|client hello: received memc reply: VERSION|client hello: cosocket test done|cert by: test start)/
34423442
--- grep_error_log_out eval
34433443
[

0 commit comments

Comments
 (0)