From 9851cee303710c849bd329009c6a0a7e272a7445 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Wed, 22 Dec 2021 11:43:22 -0800 Subject: [PATCH] regression_text: add in end text function regression commands file Signed-off-by: Matthew Stidham --- py-scripts/regression_test.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index aaa710c9..58719578 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:A:r:F:B:U:D:H:M:C:" option; do +while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:C:e:" option; do case "${option}" in h) # display Help Help @@ -49,7 +49,7 @@ while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:C:" option; do RADIO_USED=${OPTARG} ;; F) - RC_FILE=${OPTARG} + REGRESSION_COMMANDS=${OPTARG} ;; B) BSSID=${OPTARG} @@ -70,6 +70,9 @@ while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:M:C:" option; do C) RESOURCE=${OPTARG} ;; + e) + END_TEXT=${OPTARG} + ;; *) ;; @@ -140,10 +143,6 @@ fi HOMEPATH=$(realpath ~) -if [[ ${#RC_FILE} -gt 0 ]]; then - source "$RC_FILE" -fi - if [[ ${#SSID_USED} -gt 0 ]]; then if [ -f ./regression_test.rc ]; then source ./regression_test.rc # this version is a better unix name @@ -259,6 +258,8 @@ if [[ ${#SHORT} -gt 0 ]]; then ) +elif [[ ${#REGRESSION_COMMANDS} -gt 0 ]]; then + testCommands=(cat "$REGRESSION_COMMANDS") else testCommands=( "./create_bond.py --network_dev_list $RESOURCE.eth0,$UPSTREAM --debug --mgr $MGR" @@ -669,7 +670,7 @@ td.testname { " - f="" + tail="" fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html" echo "$header" >> "$fname" @@ -704,6 +705,10 @@ td.testname { " >> "$fname" + if [[ ${#END_TEXT} -gt 0 ]]; then + end_text=$(cat "$END_TEXT") + "

${end_text}

" >> "$fname" + fi echo "$tail" >> "$fname" if [ -f "${HOMEPATH}/html-reports/latest.html" ]; then rm -f "${HOMEPATH}/html-reports/latest.html"