]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: add minimal CLI "add map" tests
authorWilly Tarreau <w@1wt.eu>
Thu, 29 Apr 2021 14:17:23 +0000 (16:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 29 Apr 2021 14:19:03 +0000 (16:19 +0200)
The map_redirect test already tests for "show map", "del map" and
"clear map" but doesn't have any "add map" command. Let's add some
trivial ones involving one regular entry and two other ones added as
payload, checking they are properly returned.

reg-tests/http-rules/map_redirect.vtc

index c4a2fbe3e115bbe23df2ffb56e319bc0dcbc89ee..7f4526a25bc26a57f07aace4f535bde157d3bbc5 100644 (file)
@@ -161,6 +161,17 @@ haproxy h1 -cli {
     send "show map ${testdir}/map_redirect.map"
     expect ~ "^\\n"
 
+    # add map ${testdir}/map_redirect.map
+    send "add map ${testdir}/map_redirect.map site1_key site1_value"
+    expect ~ "^\\n"
+
+    # add 2 more entries as payload
+    send "add map ${testdir}/map_redirect.map <<\nsite2_key site2_value\nsite3_key site3_value\n"
+    expect ~ "^\\n"
+
+    send "show map ${testdir}/map_redirect.map"
+    expect ~ "^0x[a-f0-9]+ site1_key site1_value\\n0x[a-f0-9]+ site2_key site2_value\\n0x[a-f0-9]+ site3_key site3_value\\n$"
+
     # del map ${testdir}/map_redirect-be.map test1.example.{com,invalid}
     send "del map ${testdir}/map_redirect-be.map test1.example.com"
     expect ~ "^\\n"