From 695ac4d5361ae66f6308924645c8a44556fb7afb Mon Sep 17 00:00:00 2001 From: matthew Date: Thu, 2 Dec 2021 18:12:14 -0800 Subject: [PATCH] regression_test: Fix logic for checking status code Signed-off-by: matthew --- py-scripts/regression_test.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index e5d6a83f..a95a84f2 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -70,8 +70,11 @@ while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do esac done -SCENARIO_CHECK=$(python -c "import requests; print(requests.get('http://${MGR}:8080/events/since=time/1h'))") -if [[ ${SCENARIO_CHECK} != 200 ]]; then +SCENARIO_CHECK="$(python -c "import requests; print(requests.get('http://${MGR}:8080/events/since=time/1h').status_code)")" +if [[ ${SCENARIO_CHECK} -eq 200 ]]; then + pass +else + echo "${SCENARIO_CHECK}" echo "Your LANforge Manager is out of date. Regression test requires LANforge version 5.4.4 or higher in order to run" echo "Please upgrade your LANforge using instructions found at https://www.candelatech.com/downloads.php#releases" exit 1