From 5dc286bc1e21ad8bceefac3e3bf954417a5b5381 Mon Sep 17 00:00:00 2001
From: Anh <zenpoems@gmail.com>
Date: Wed, 21 Nov 2018 19:13:59 -0800
Subject: [PATCH] test_cmds.sh reports success when "fail" config results in
 test failing

Former-commit-id: 9eae8049ff18e10db709ee87b8dad3ee8f0b912d
---
 cicd_tests/verify-fails.sh | 14 +-------------
 tests/test_cmds.sh         |  4 +++-
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/cicd_tests/verify-fails.sh b/cicd_tests/verify-fails.sh
index ac6f91cff..4eb13f0e7 100755
--- a/cicd_tests/verify-fails.sh
+++ b/cicd_tests/verify-fails.sh
@@ -8,21 +8,9 @@ source set_env_vars
 cd $PEASOUP_HOME/tests
 make clean
 
-# these tests must fail
-
-# verify ls failure
+# verify "fail" configuration
 ./test_cmds.sh -l -c fail -a ls
-if [ $? -eq 0 ]; then
-	echo "Error: expected ls failure"
-	exit 1
-fi
-
-# verify grep failure
 ./test_cmds.sh -l -c fail -a grep
-if [ $? -eq 0 ]; then
-	echo "Error: expected grep failure"
-	exit 1
-fi
 
 exit 0
 
diff --git a/tests/test_cmds.sh b/tests/test_cmds.sh
index b6325bc02..84fd9c9ed 100755
--- a/tests/test_cmds.sh
+++ b/tests/test_cmds.sh
@@ -218,7 +218,9 @@ do_tests()
 	done
 
 	if [[ $progs_fail != "" ]] || [[ $progs_fail_peasoup != "" ]]; then
-		had_fails=1
+		if [[ $config != "fail" ]]; then
+			had_fails=1
+		fi
 	fi
 }
 
-- 
GitLab