From: Willy Tarreau Date: Thu, 29 Apr 2021 14:17:23 +0000 (+0200) Subject: REGTESTS: add minimal CLI "add map" tests X-Git-Tag: v2.4-dev18~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=deee369cfabdea713e232c94c5d15f9613109fe9;p=thirdparty%2Fhaproxy.git REGTESTS: add minimal CLI "add map" tests 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. --- diff --git a/reg-tests/http-rules/map_redirect.vtc b/reg-tests/http-rules/map_redirect.vtc index c4a2fbe3e1..7f4526a25b 100644 --- a/reg-tests/http-rules/map_redirect.vtc +++ b/reg-tests/http-rules/map_redirect.vtc @@ -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"