REGTESTS: make use of HAPROXY_ARGS and pass -dM by default

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).

(cherry picked from commit a4009cd6103a92752db27c3a85051c6adcc832c1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit f13c7dbe51f3eda453c6aa596b3b56e2274c106d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 4652c51bf24d5c17c7a441c17994c46c72600bf5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d47bb3ef8879d42d869b5e9223cbb8e8aacc580f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/scripts/run-regtests.sh b/scripts/run-regtests.sh
index 19e8a15..c30c8cf 100755
--- a/scripts/run-regtests.sh
+++ b/scripts/run-regtests.sh
@@ -66,9 +66,11 @@
   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
 }
@@ -278,6 +280,7 @@
 
 
 HAPROXY_PROGRAM="${HAPROXY_PROGRAM:-${PWD}/haproxy}"
+HAPROXY_ARGS="${HAPROXY_ARGS--dM}"
 VTEST_PROGRAM="${VTEST_PROGRAM:-vtest}"
 TESTDIR="${TMPDIR:-/tmp}"
 REGTESTS=""
@@ -308,7 +311,7 @@
 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)
@@ -321,6 +324,9 @@
 
 export TMPDIR="$TESTDIR"
 export HAPROXY_PROGRAM="$HAPROXY_PROGRAM"
+if [ -n "$HAPROXY_ARGS" ]; then
+   export HAPROXY_ARGS
+fi
 
 echo "Target : $TARGET"
 echo "Options : $FEATURES"