From deee369cfabdea713e232c94c5d15f9613109fe9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 29 Apr 2021 16:17:23 +0200 Subject: [PATCH] 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. --- reg-tests/http-rules/map_redirect.vtc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reg-tests/http-rules/map_redirect.vtc b/reg-tests/http-rules/map_redirect.vtc index c4a2fbe..7f4526a 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" -- 1.7.10.4