On 07/11/2018 09:12 PM, Илья Шипицин wrote:
Hello,
I'm playing with reg tests. Sometimes they fail for weird reasons.
(for example, fedora 28 on gitlab ci)
https://gitlab.com/chipitsine/haproxy/-/jobs/81106855
curl -i -k https://${h1_frt_addr}:${h1_frt_port}
became
curl -i -k https://::1:38627
which is not correct.
but I could not find any definition of h1_frt_addr, how is it defined?
Well, it is defined thanks to varnish lib APIs. The correct syntax
should be curl -i -k https://[::1]:38627 in this case
(https://www.ietf.org/rfc/rfc2732.txt).
But h1_frt_addr could also be defined as 127.0.0.1 I guess on hosts
where ipv6 is not enabled.
So could you try this patch attached to this mail? Note that with this
patch the test is a bit faster.
Fred.
diff --git a/reg-tests/ssl/h00000.vtc b/reg-tests/ssl/h00000.vtc
index 0765cb4..819f385 100644
--- a/reg-tests/ssl/h00000.vtc
+++ b/reg-tests/ssl/h00000.vtc
@@ -31,14 +31,13 @@ haproxy h1 -conf {
http-request redirect location /
} -start
-process p1 "curl -i -k https://${h1_frt_addr}:${h1_frt_port}" -start
-process p2 "curl -i -k https://${h1_frt_addr}:${h1_frt_port}" -start
-process p3 "curl -i -k https://${h1_frt_addr}:${h1_frt_port}" -start
-process p4 "curl -i -k https://${h1_frt_addr}:${h1_frt_port}" -start
-process p5 "curl -i -k https://${h1_frt_addr}:${h1_frt_port}" -start
-
-process p1 -wait
-process p2 -wait
-process p3 -wait
-process p4 -wait
-process p5 -wait
+shell {
+ HOST=${h1_frt_addr}
+ if [ "${h1_frt_addr}" = "::1" ] ; then
+ HOST="[::1]"
+ fi
+ for i in 1 2 3 4 5; do
+ curl -i -k https://$HOST:${h1_frt_port} & pids="$pids $!"
+ done
+ wait $pids
+}