mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-05 02:49:01 +00:00
This patch adds the `-cc` (check condition) argument to evaluate conditions on startup and return the result as the exit code. As an example this can be used to easily check HAProxy's version in scripts: haproxy -cc 'version_atleast(2.4)' This resolves GitHub issue #1246. Co-authored-by: Tim Duesterhus <tim@bastelstu.be>
14 lines
382 B
Plaintext
14 lines
382 B
Plaintext
varnishtest "Tests the -cc argument"
|
|
|
|
#REQUIRE_VERSION=2.5
|
|
feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.5-dev0)'"
|
|
|
|
shell {
|
|
$HAPROXY_PROGRAM -cc "version_atleast(2.4)"
|
|
! $HAPROXY_PROGRAM -cc "version_atleast(1024)"
|
|
|
|
$HAPROXY_PROGRAM -cc "streq(foo,'foo')"
|
|
$HAPROXY_PROGRAM -cc "streq(\"foo bar\",'foo bar')"
|
|
! $HAPROXY_PROGRAM -cc "streq(foo,bar)"
|
|
} -run
|