mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
sta_connect_multi_example.py: demonstrates using StaConnect to operate multiple tests on multiple ports
This commit is contained in:
@@ -20,7 +20,7 @@ import LANforge
|
|||||||
from LANforge import LFUtils
|
from LANforge import LFUtils
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# create multiple open stations
|
# create multiple OPEN stations
|
||||||
station_names = LFUtils.port_name_series(start_id=0, end_id=1)
|
station_names = LFUtils.port_name_series(start_id=0, end_id=1)
|
||||||
test = StaConnect("localhost", 8080, _debugOn=False)
|
test = StaConnect("localhost", 8080, _debugOn=False)
|
||||||
test.sta_mode = sta_connect.MODE_AUTO
|
test.sta_mode = sta_connect.MODE_AUTO
|
||||||
@@ -31,17 +31,20 @@ def main():
|
|||||||
test.dut_security = sta_connect.OPEN
|
test.dut_security = sta_connect.OPEN
|
||||||
test.dut_ssid = "jedway-open"
|
test.dut_ssid = "jedway-open"
|
||||||
test.dut_passwd = "NA"
|
test.dut_passwd = "NA"
|
||||||
test.name_list = station_names
|
test.station_names = station_names
|
||||||
test.run()
|
test.run()
|
||||||
is_passing = test.passes()
|
is_passing = test.passes()
|
||||||
if is_passing == False:
|
if is_passing == False:
|
||||||
# run_results = staConnect.get_failed_result_list()
|
# run_results = staConnect.get_failed_result_list()
|
||||||
fail_message = test.get_fail_message()
|
fail_message = test.get_fail_message()
|
||||||
print("Some tests failed:\n" + fail_message)
|
print("Some tests failed:\n" + fail_message)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
print("Tests pass")
|
print("Tests pass")
|
||||||
|
|
||||||
test.remove_stations()
|
test.remove_stations()
|
||||||
|
|
||||||
|
# Stations use WPA2
|
||||||
test.dut_security = sta_connect.WPA2
|
test.dut_security = sta_connect.WPA2
|
||||||
test.dut_ssid = "jedway-wpa2-x2048-5-1"
|
test.dut_ssid = "jedway-wpa2-x2048-5-1"
|
||||||
test.dut_passwd = "jedway-wpa2-x2048-5-1"
|
test.dut_passwd = "jedway-wpa2-x2048-5-1"
|
||||||
@@ -51,8 +54,10 @@ def main():
|
|||||||
# run_results = staConnect.get_failed_result_list()
|
# run_results = staConnect.get_failed_result_list()
|
||||||
fail_message = test.get_fail_message()
|
fail_message = test.get_fail_message()
|
||||||
print("Some tests failed:\n" + fail_message)
|
print("Some tests failed:\n" + fail_message)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
print("Tests pass")
|
print("Tests pass")
|
||||||
|
|
||||||
test.remove_stations()
|
test.remove_stations()
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|||||||
Reference in New Issue
Block a user