]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: complete "add backend" reg-test
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 5 Aug 2026 08:37:59 +0000 (10:37 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 5 Aug 2026 09:38:21 +0000 (11:38 +0200)
Add new tests for "add backend" command, most notably a check on "mode"
argument in case defaults section does not define an explicit mode.

reg-tests/proxy/cli_add_backend.vtc

index c1d049590c7725ac415cb0f4ecbf335ecfa5aa0c..8bc8b37546d0477c11c3e559e088ffe560ed4262 100644 (file)
@@ -49,9 +49,15 @@ client c1 -connect ${h1_feS_sock} {
 } -run
 
 haproxy h1 -cli {
-       # non existent backend
-       send "add backend be from def"
+       # non existent defaults
+       send "add backend be from unknown"
+       expect ~ "Cannot find default proxy 'unknown'."
+
+       # defaults instance without mode set
+       send "add backend be2 from def"
        expect ~ "Mode is required"
+       send "add backend be2 from def mode http"
+       expect ~ "New backend registered."
 
        send "add backend be from def_http"
        expect ~ "New backend registered."