]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: make use of HAPROXY_ARGS and pass -dM by default
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Dec 2020 09:39:20 +0000 (10:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Dec 2020 20:43:50 +0000 (21:43 +0100)
Enabling memory poisonning is often pretty effective for detecting
uninitialized structure fields. Let's enable it by default and let
the user change the arguments at will (e.g. forcing some memory limits
or disabling a poller). This will work with the latest vtest version
to date (02a9bc1).

scripts/run-regtests.sh

index 7bcc394cfc605fef94b2c19d56bd3974f7991df2..da20ae3dd634aaac096438c8f4b8ab1e1fb1141d 100755 (executable)
@@ -69,9 +69,11 @@ _help()
   Configure environment variables to set the haproxy and vtest binaries to use
     setenv HAPROXY_PROGRAM /usr/local/sbin/haproxy
     setenv VTEST_PROGRAM /usr/local/bin/vtest
+    setenv HAPROXY_ARGS "-dM -de -m 50"
   or
     export HAPROXY_PROGRAM=/usr/local/sbin/haproxy
     export VTEST_PROGRAM=/usr/local/bin/vtest
+    export HAPROXY_ARGS="-dM -de -m 50"
 EOF
   exit 0
 }
@@ -290,6 +292,7 @@ _version() {
 
 
 HAPROXY_PROGRAM="${HAPROXY_PROGRAM:-${PWD}/haproxy}"
+HAPROXY_ARGS="${HAPROXY_ARGS--dM}"
 VTEST_PROGRAM="${VTEST_PROGRAM:-vtest}"
 TESTDIR="${TMPDIR:-/tmp}"
 REGTESTS=""
@@ -320,7 +323,7 @@ if [ $preparefailed ]; then
 fi
 
 { read HAPROXY_VERSION; read TARGET; read FEATURES; } << EOF
-$($HAPROXY_PROGRAM -vv |grep 'HA-Proxy version\|TARGET.*=\|^Feature' | sed 's/.* [:=] //')
+$($HAPROXY_PROGRAM $HAPROXY_ARGS -vv |grep 'HA-Proxy version\|TARGET.*=\|^Feature' | sed 's/.* [:=] //')
 EOF
 
 HAPROXY_VERSION=$(echo $HAPROXY_VERSION | cut -d " " -f 3)
@@ -333,6 +336,9 @@ TESTDIR=$(mktemp -d "$TESTDIR/haregtests-$TESTRUNDATETIME.XXXXXX") || exit 1
 
 export TMPDIR="$TESTDIR"
 export HAPROXY_PROGRAM="$HAPROXY_PROGRAM"
+if [ -n "$HAPROXY_ARGS" ]; then
+   export HAPROXY_ARGS
+fi
 
 echo "Target : $TARGET"
 echo "Options : $FEATURES"