From 739b12d8e196eb4429afae7ad85a5ab87d0dd1f6 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 12 Jan 2022 12:19:00 -0800 Subject: [PATCH] regression_test: Add exit on error flag Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index 8e3243f7..46a1d3a2 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -21,7 +21,7 @@ Help() } -while getopts ":h:s:S:p:w:m:r:F:B:U:D:H:M:C:e:V:" option; do +while getopts ":h:s:S:p:w:m:r:F:B:U:D:H:M:C:e:V:E:" option; do case "${option}" in h) # display Help Help @@ -73,6 +73,9 @@ while getopts ":h:s:S:p:w:m:r:F:B:U:D:H:M:C:e:V:" option; do V) VAP_SSID=${OPTARG} ;; + E) + EXIT_ON_ERROR=${OPTARG} + ;; *) ;; @@ -444,12 +447,14 @@ function test() { if [[ $TEXT =~ "tests failed" ]]; then TEXTCLASS="partial_failure" TDTEXT="Partial Failure" + CONTINUE="False" echo "Partial Failure" LOGGING="Logging directory" elif [[ $TEXT =~ "FAILED" ]]; then TEXTCLASS="partial_failure" TDTEXT="ERROR" + CONTINUE="False" echo "ERROR" LOGGING="Logging directory" else @@ -461,6 +466,7 @@ function test() { if (( FILESIZE > 0)); then TEXTCLASS="failure" TDTEXT="Failure" + CONTINUE="False" STDERR="STDERR" LOGGING="Logging directory" fi @@ -509,7 +515,11 @@ function start_tests() { CHECK_PORTS+=("$UPSTREAM") fi PORTS=$( IFS=$','; echo "${CHECK_PORTS[*]}" ) - test + if [[ ${#EXIT_ON_ERROR} -gt 0 ]]; then + if [[ $(CONTINUE) == "True" ]]; then + test + fi + fi done } @@ -628,6 +638,7 @@ td.testname { #mail -s "Regression Results" scripters@candelatech.com <<<$content } +CONTINUE="True" results=() NOW=$(date +"%Y-%m-%d-%H-%M") NOW="${NOW/:/-}"