]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: reg-tests: make shell syntax errors fatal
authorIlia Shipitsin <chipitsine@gmail.com>
Wed, 22 Apr 2026 06:38:08 +0000 (08:38 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 22 Apr 2026 13:18:22 +0000 (15:18 +0200)
Detect shell parser errors in test LOG files right after vtest execution
and mark the run as failed when such errors are found.

This turns malformed feature cmd expressions from warning-like diagnostics
into hard failures, so broken test conditions are caught reliably.

scripts/run-regtests.sh

index a07c15dcadc01e4121854ab00eede3cc3bce0022..0fda975f2f635bd213b181a39e825c55203a1c9b 100755 (executable)
@@ -379,6 +379,11 @@ if [ -n "$testlist" ]; then
   cmd="$VTEST_PROGRAM -b $((2<<20)) -k -t ${VTEST_TIMEOUT} -L $verbose $debug $jobcount $vtestparams $testlist"
   eval $cmd
   _vtresult=$?
+  grep -rE --include="LOG" 'sh: -c: line [0-9]+: syntax error|syntax error near unexpected token|Syntax error' "$TESTDIR"
+  if [ $? -eq 0 ]; then
+    echo "########################## Fatal shell syntax errors ##########################"
+    _vtresult=1
+  fi
 else
   echo "No tests found that meet the required criteria"
 fi