scenario.py: Use logic to test versions so that when we upgrade LANforge to 5.4.6 that scenario will still use the events tab without manual fixing.

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2022-01-21 08:49:47 -08:00
committed by shivam
parent f86e86545e
commit c9cdfe40be

View File

@@ -183,16 +183,18 @@ def main():
if scenario.are_any_ports_phantom(): if scenario.are_any_ports_phantom():
raise EnvironmentError("There are phantom ports on your LANforge") raise EnvironmentError("There are phantom ports on your LANforge")
if scenario.BuildVersion in ['5.4.4', '5.4.5']: build_version = [int(n) for n in scenario.BuildVersion.split('.')]
if build_version[0] >= 5 & build_version[1] >= 4 & build_version[2] >= 4:
scenario.start_test() scenario.start_test()
scenario.load_scenario() scenario.load_scenario()
if scenario.BuildVersion not in ['5.4.4', '5.4.5']: if build_version[0] <= 5 & build_version[1] <= 4 & build_version[2] < 4:
print('sleeping 30 seconds, please upgrade your LANforge for a better experience, more information at https://www.candelatech.com/downloads.php#releases') print('sleeping 30 seconds, please upgrade your LANforge for a better experience, more information at https://www.candelatech.com/downloads.php#releases')
time.sleep(30) time.sleep(30)
if scenario.BuildVersion in ['5.4.4', '5.4.5']: if build_version[0] >= 5 & build_version[1] >= 4 & build_version[2] >= 4:
scenario.check_if_complete() scenario.check_if_complete()
# scenario_loader.load_scenario() # scenario_loader.load_scenario()