]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: don't rely on the stick-table dump order in the ipmask test
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 18 Aug 2026 12:49:03 +0000 (14:49 +0200)
committerOlivier Houchard <cognet@ci0.org>
Tue, 18 Aug 2026 12:43:33 +0000 (14:43 +0200)
"show table" dumps the entries bucket by bucket, so their order depends
on CONFIG_HAP_TBL_BUCKETS, which is 1 in builds without threads (e.g.
TARGET=generic) and 8 or more with them. The test hardcoded the order
seen with multiple buckets and failed on single-bucket builds.

Check the header and each of the three entries with a separate request
instead, so the order doesn't matter anymore.

reg-tests/http-rules/converters_ipmask_concat_strcmp_field_word.vtc

index 16596d03787a64ea8110c8efb9c7fbe7881b906e..2d40e5fc482c611fed81db59328d86ac26588326 100644 (file)
@@ -218,10 +218,18 @@ client c1 -connect ${h1_fe1_sock} -proxy2 "192.168.1.101:1234 127.0.0.1:2345" {
     expect resp.status == 200
 } -run
 
-# cli show be1 stick table
+# cli show be1 stick table. The entries are dumped bucket by bucket, so
+# their order depends on the number of buckets (thus on the build), let's
+# check them one at a time.
 haproxy h1 -cli {
     send "show table be1"
-    expect ~ "^# table: be1, type: ipv6, size:20, used:3\\n0x[a-f0-9]+: key=::ffff:192\\.168\\.1\\.101 use=0 exp=[[:digit:]]+ shard=0 gpc0=0 conn_cnt=1\\n0x[a-f0-9]+: key=::ffff:192\\.168\\.1\\.0 use=0 exp=[[:digit:]]+ shard=0 gpc0=0 conn_cnt=1\\n0x[a-f0-9]+: key=2001:db8:c001:c01a:[0:]+ use=0 exp=[[:digit:]]+ shard=0 gpc0=0 conn_cnt=1\\n"
+    expect ~ "^# table: be1, type: ipv6, size:20, used:3\\n"
+    send "show table be1"
+    expect ~ "0x[a-f0-9]+: key=::ffff:192\\.168\\.1\\.101 use=0 exp=[[:digit:]]+ shard=0 gpc0=0 conn_cnt=1\\n"
+    send "show table be1"
+    expect ~ "0x[a-f0-9]+: key=::ffff:192\\.168\\.1\\.0 use=0 exp=[[:digit:]]+ shard=0 gpc0=0 conn_cnt=1\\n"
+    send "show table be1"
+    expect ~ "0x[a-f0-9]+: key=2001:db8:c001:c01a:[0:]+ use=0 exp=[[:digit:]]+ shard=0 gpc0=0 conn_cnt=1\\n"
 }
 
 # concat,strcmp,word,field tests