summaryrefslogtreecommitdiff
blob: 05baa7ee03a3d7a29dbfd054a902b44a0724aa1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/tests/exec_tests.sh b/tests/exec_tests.sh
index d96eaa3..b7f812d 100755
--- a/tests/exec_tests.sh
+++ b/tests/exec_tests.sh
@@ -33,6 +33,8 @@ fi
 
 echo "-- Executing configuration tests"
 
+retval=0
+
 for test in `ls -d ${TESTS}`; do
 	if [[ ! ${test} =~ ^..._ ]]; then
 		continue;
@@ -55,14 +57,16 @@ for test in `ls -d ${TESTS}`; do
 
 	if [ $statusexec -ne 0 ]; then
 		echo -e "\e[31mNFT EXEC ERROR\e[0m"
+		retval=1
 		continue;
 	fi
 
 	#~ nftfile=`echo ${file} | awk -F'.' '{ print $1 }'`
-	$NFTBIN list ruleset > ${reportfile}
+	$NFTBIN list ruleset > ${reportfile} || retval=1
 
 	if [ ! -f ${outputfile} ]; then
 		echo "Dump file doesn't exist"
+		retval=1
 		continue;
 	fi
 
@@ -74,6 +78,7 @@ for test in `ls -d ${TESTS}`; do
 		rm -f ${reportfile}
 	else
 		echo -e "\e[31mNFT DUMP ERROR\e[0m"
+		retval=1
 	fi
 done
 
@@ -83,4 +88,7 @@ fi
 
 if [ "`grep 'nft command error' /var/log/syslog`" != "" ]; then
 	echo -e "\e[33m* command errors found, please check syslog\e[0m"
+	retval=1
 fi
+
+exit ${retval}