REGTESTS: Fix ssl_errors.vtc script to wait for connections close
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Feb 2023 10:24:04 +0000 (11:24 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Feb 2023 10:44:55 +0000 (11:44 +0100)
In this scripts, several clients perform a requests and exit because an SSL
error is expected and thus no response is sent. However, we must explicitly
wait for the connection close, via an "expect_close" statement.  Otherwise,
depending on the timing, HAProxy may detect the client abort before any
connection attempt on the server side and no SSL error is reported, making
the script to fail.

reg-tests/ssl/ssl_errors.vtc

index 45a22c1..8fb9c5a 100644 (file)
@@ -327,14 +327,17 @@ shell {
 
 client c4 -connect ${h1_clearlst_sock} {
     txreq
+    expect_close
 } -run
 
 client c5 -connect ${h1_clearlst_sock} {
     txreq
+    expect_close
 } -run
 
 client c6 -connect ${h1_clearlst_sock} {
     txreq
+    expect_close
 } -run
 
 barrier b1 sync
@@ -355,14 +358,17 @@ shell {
 
 client c7 -connect ${h1_clearlst_sock} {
     txreq
+    expect_close
 } -run
 
 client c8 -connect ${h1_clearlst_sock} {
     txreq
+    expect_close
 } -run
 
 client c9 -connect ${h1_clearlst_sock} {
     txreq
+    expect_close
 } -run
 
 barrier b1 sync
@@ -377,12 +383,15 @@ shell {
 # "No shared cipher" errors
 client c10 -connect ${h1_wrongcipherslst_sock} {
     txreq
+    expect_close
 } -run
 client c11 -connect ${h1_wrongcipherslst_sock} {
     txreq
+    expect_close
 } -run
 client c12 -connect ${h1_wrongcipherslst_sock} {
     txreq
+    expect_close
 } -run
 
 
@@ -399,22 +408,27 @@ client c13 -connect ${h1_backenderrorslst_sock} {
 barrier b2 sync
 client c14 -connect ${h1_backenderrorslst_sock} {
     txreq
+    expect_close
 } -run
 barrier b2 sync
 client c15 -connect ${h1_backenderrorslst_sock} {
     txreq
+    expect_close
 } -run
 barrier b2 sync
 client c16 -connect ${h1_backenderrorslst_sock} {
     txreq
+    expect_close
 } -run
 barrier b2 sync
 client c17 -connect ${h1_backenderrorslst_sock} {
     txreq
+    expect_close
 } -run
 barrier b2 sync
 client c18 -connect ${h1_backenderrorslst_sock} {
     txreq
+    expect_close
 } -run
 
 syslog Slg_cust_fmt -wait