From 3e9ed2e6e54f6735e398a88e9c67332e052a9b2f Mon Sep 17 00:00:00 2001 From: matthew Date: Thu, 2 Dec 2021 18:02:50 -0800 Subject: [PATCH] regression_test: trigger warning and exit at the beginning if LANforge manager cannot support scenario.py Signed-off-by: matthew --- py-scripts/regression_test.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index d356f057..e5d6a83f 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -20,12 +20,6 @@ Help() echo "If using the help flag, put the H flag at the end of the command after other flags." } -if [ -d "/home/lanforge/lanforge_env" ]; -then - pip3 install --upgrade lanforge-scripts -else - pip3 install --user -r ../requirements.txt --upgrade -fi while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do case "${option}" in @@ -76,6 +70,20 @@ 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 + 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 +fi + +if [ -d "/home/lanforge/lanforge_env" ] +then + pip3 install --upgrade lanforge-scripts +else + pip3 install --user -r ../requirements.txt --upgrade +fi + if [[ ${#SSID_USED} -eq 0 ]]; then #Network credentials SSID_USED="jedway-wpa2-x2048-5-3" PASSWD_USED="jedway-wpa2-x2048-5-3"