From 669c3ea68099b330943d5c3215f0cf381880c3ad Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 3 Jun 2024 07:11:11 +0200 Subject: Merging upstream version 3.0.0. Signed-off-by: Daniel Baumann --- reg-tests/connection/h2_glitches.vtc | 8 +++- reg-tests/connection/http_reuse_conn_hash.vtc | 67 +++++++++++++++++++++++++++ reg-tests/connection/reverse_connect_full.vtc | 2 +- reg-tests/connection/reverse_server.vtc | 2 +- reg-tests/connection/reverse_server_name.vtc | 2 +- 5 files changed, 77 insertions(+), 4 deletions(-) (limited to 'reg-tests/connection') diff --git a/reg-tests/connection/h2_glitches.vtc b/reg-tests/connection/h2_glitches.vtc index 39ec4d6..4f25164 100644 --- a/reg-tests/connection/h2_glitches.vtc +++ b/reg-tests/connection/h2_glitches.vtc @@ -11,7 +11,9 @@ haproxy hap -conf { listen fe1 bind "fd@${fe1}" proto h2 - http-request return status 200 hdr x-glitches %[fc_glitches] + tcp-request session track-sc0 src + http-request return status 200 hdr x-glitches %[fc_glitches] hdr x-glitch-cnt %[sc0_glitch_cnt] hdr x-glitch-rate %[sc0_glitch_rate] + stick-table type ip size 10 store glitch_cnt,glitch_rate(1m) } -start # valid request: no glitch @@ -73,6 +75,8 @@ client c2-path -connect ${hap_fe1_sock} { rxresp expect resp.status == 200 expect resp.http.x-glitches == 1 + expect resp.http.x-glitch-cnt == 1 + expect resp.http.x-glitch-rate == 1 } -run } -run @@ -104,5 +108,7 @@ client c3-scheme -connect ${hap_fe1_sock} { rxresp expect resp.status == 200 expect resp.http.x-glitches == 0 + expect resp.http.x-glitch-cnt == 1 + expect resp.http.x-glitch-rate == 1 } -run } -run diff --git a/reg-tests/connection/http_reuse_conn_hash.vtc b/reg-tests/connection/http_reuse_conn_hash.vtc index 991e86f..d77f759 100644 --- a/reg-tests/connection/http_reuse_conn_hash.vtc +++ b/reg-tests/connection/http_reuse_conn_hash.vtc @@ -13,6 +13,16 @@ haproxy h1 -conf { bind "fd@${feS_sni}" server srv2 ${h1_feR_ssl_addr}:${h1_feR_ssl_port} ssl sni "req.hdr(x-sni)" verify none pool-low-conn 2 + # pool-conn-name + listen sender-name + bind "fd@${feS_name}" + server srv2 ${h1_feR_addr}:${h1_feR_port} pool-conn-name "req.hdr(x-name)" pool-low-conn 2 + + # sni + pool-conn-name + listen sender-sni-name + bind "fd@${feS_sni_name}" + server srv2 ${h1_feR_ssl_addr}:${h1_feR_ssl_port} ssl sni "req.hdr(x-sni)" verify none pool-conn-name "req.hdr(x-name)" pool-low-conn 2 + # set-dst # specify dst1_addr for server, which should be identical to dst2_addr # port is specified by the client in header x-dst-port @@ -29,6 +39,7 @@ haproxy h1 -conf { server srv2 ${h1_feR_proxy_addr}:${h1_feR_proxy_port} send-proxy pool-low-conn 2 listen receiver + bind "fd@${feR}" bind "fd@${feR_ssl}" ssl crt ${testdir}/common.pem bind "fd@${feR_proxy}" accept-proxy http-request return status 200 @@ -72,6 +83,62 @@ client c_sni -connect ${h1_feS_sni_sock} { expect resp.http.http_first_request == "0" } -run +client c_name -connect ${h1_feS_name_sock} { + # first request + txreq \ + -hdr "x-name: www.custom.com" + rxresp + expect resp.http.http_first_request == "1" + + # second request with same name, connection must be reused + txreq \ + -hdr "x-name: www.custom.com" + rxresp + expect resp.http.http_first_request == "0" + + # third request with a different name, a new connection must be used + txreq \ + -hdr "x-name: www.custom2.com" + rxresp + expect resp.http.http_first_request == "1" + + # fourth request, reuse name2 + txreq \ + -hdr "x-name: www.custom2.com" + rxresp + expect resp.http.http_first_request == "0" +} -run + +client c_sni_name -connect ${h1_feS_sni_name_sock} { + # first request + txreq \ + -hdr "x-sni: www.custom.com" \ + -hdr "x-name: www.custom.com" + rxresp + expect resp.http.http_first_request == "1" + + # second request with same name but different sni, connection must be reused + txreq \ + -hdr "x-sni: www.custom2.com" \ + -hdr "x-name: www.custom.com" + rxresp + expect resp.http.http_first_request == "0" + + # third request with a different name, a new connection must be used + txreq \ + -hdr "x-sni: www.custom2.com" \ + -hdr "x-name: www.custom2.com" + rxresp + expect resp.http.http_first_request == "1" + + # fourth request, reuse name2 with a new sni + txreq \ + -hdr "x-sni: www.custom3.com" \ + -hdr "x-name: www.custom2.com" + rxresp + expect resp.http.http_first_request == "0" +} -run + # http-reuse with destination address client c_dst1 -connect ${h1_feS_dst_sock} { txreq \ diff --git a/reg-tests/connection/reverse_connect_full.vtc b/reg-tests/connection/reverse_connect_full.vtc index 238831f..cc88382 100644 --- a/reg-tests/connection/reverse_connect_full.vtc +++ b/reg-tests/connection/reverse_connect_full.vtc @@ -1,7 +1,7 @@ varnishtest "Reverse connect full test" feature ignore_unknown_macro -#REQUIRE_VERSION=2.9 +feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.9-dev0)'" server s1 { rxreq diff --git a/reg-tests/connection/reverse_server.vtc b/reg-tests/connection/reverse_server.vtc index 50fe8ce..5cd77ca 100644 --- a/reg-tests/connection/reverse_server.vtc +++ b/reg-tests/connection/reverse_server.vtc @@ -1,7 +1,7 @@ varnishtest "Reverse server test" feature ignore_unknown_macro -#REQUIRE_VERSION=2.9 +feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.9-dev0)'" barrier b1 cond 2 diff --git a/reg-tests/connection/reverse_server_name.vtc b/reg-tests/connection/reverse_server_name.vtc index 0fd850f..3a24601 100644 --- a/reg-tests/connection/reverse_server_name.vtc +++ b/reg-tests/connection/reverse_server_name.vtc @@ -2,7 +2,7 @@ varnishtest "Reverse server with a name parameter test" feature cmd "$HAPROXY_PROGRAM -cc 'feature(OPENSSL)'" feature ignore_unknown_macro -#REQUIRE_VERSION=2.9 +feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.9-dev0)'" barrier b1 cond 2 -- cgit v1.2.3