regression_test: trigger warning and exit at the beginning if LANforge manager cannot support scenario.py

Signed-off-by: matthew <stidmatt@gmail.com>
This commit is contained in:
matthew
2021-12-02 18:02:50 -08:00
parent e817ad7b03
commit 3e9ed2e6e5

View File

@@ -20,12 +20,6 @@ Help()
echo "If using the help flag, put the H flag at the end of the command after other flags." 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 while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do
case "${option}" in 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 esac
done 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 if [[ ${#SSID_USED} -eq 0 ]]; then #Network credentials
SSID_USED="jedway-wpa2-x2048-5-3" SSID_USED="jedway-wpa2-x2048-5-3"
PASSWD_USED="jedway-wpa2-x2048-5-3" PASSWD_USED="jedway-wpa2-x2048-5-3"