mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
Modified Pass/Fail code in Max SSID method.
Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com>
This commit is contained in:
@@ -2995,9 +2995,8 @@ class lf_tests(lf_libs):
|
|||||||
upstream = list(up.values())
|
upstream = list(up.values())
|
||||||
upstream_port = upstream[0] + "." + str(vlan_id[0])
|
upstream_port = upstream[0] + "." + str(vlan_id[0])
|
||||||
|
|
||||||
sta_got_ip = []
|
|
||||||
radio = None
|
radio = None
|
||||||
timeout_sec = 100 if no_of_sta_2g <= 8 and no_of_sta_5g <= 8 else 10
|
timeout_sec = 1
|
||||||
for i in range(no_of_sta_2g):
|
for i in range(no_of_sta_2g):
|
||||||
logging.info(f"Creating a 2G station on {ssid_2g_list[i]['ssid_name']} ssid...")
|
logging.info(f"Creating a 2G station on {ssid_2g_list[i]['ssid_name']} ssid...")
|
||||||
for _radio in radio_dict_2g:
|
for _radio in radio_dict_2g:
|
||||||
@@ -3007,7 +3006,7 @@ class lf_tests(lf_libs):
|
|||||||
else:
|
else:
|
||||||
radio_dict_2g[radio] -= 1
|
radio_dict_2g[radio] -= 1
|
||||||
break
|
break
|
||||||
sta_got_ip.append(self.client_connect_using_radio(ssid=ssid_2g_list[i]['ssid_name'],
|
self.client_connect_using_radio(ssid=ssid_2g_list[i]['ssid_name'],
|
||||||
security=ssid_2g_list[i]['security'],
|
security=ssid_2g_list[i]['security'],
|
||||||
passkey=ssid_2g_list[i]['password'],
|
passkey=ssid_2g_list[i]['password'],
|
||||||
mode=mode,
|
mode=mode,
|
||||||
@@ -3017,7 +3016,7 @@ class lf_tests(lf_libs):
|
|||||||
attach_port_info=False,
|
attach_port_info=False,
|
||||||
timeout_sec=timeout_sec,
|
timeout_sec=timeout_sec,
|
||||||
vlan_id=vlan_id,
|
vlan_id=vlan_id,
|
||||||
create_vlan=False))
|
create_vlan=False)
|
||||||
for i in range(no_of_sta_5g):
|
for i in range(no_of_sta_5g):
|
||||||
logging.info(f"Creating a 5G station on {ssid_5g_list[i]['ssid_name']} ssid...")
|
logging.info(f"Creating a 5G station on {ssid_5g_list[i]['ssid_name']} ssid...")
|
||||||
for _radio in radio_dict_5g:
|
for _radio in radio_dict_5g:
|
||||||
@@ -3027,7 +3026,7 @@ class lf_tests(lf_libs):
|
|||||||
else:
|
else:
|
||||||
radio_dict_5g[radio] -= 1
|
radio_dict_5g[radio] -= 1
|
||||||
break
|
break
|
||||||
sta_got_ip.append(self.client_connect_using_radio(ssid=ssid_5g_list[i]['ssid_name'],
|
self.client_connect_using_radio(ssid=ssid_5g_list[i]['ssid_name'],
|
||||||
security=ssid_5g_list[i]['security'],
|
security=ssid_5g_list[i]['security'],
|
||||||
passkey=ssid_5g_list[i]['password'],
|
passkey=ssid_5g_list[i]['password'],
|
||||||
mode=mode,
|
mode=mode,
|
||||||
@@ -3037,7 +3036,10 @@ class lf_tests(lf_libs):
|
|||||||
attach_port_info=False,
|
attach_port_info=False,
|
||||||
timeout_sec=timeout_sec,
|
timeout_sec=timeout_sec,
|
||||||
vlan_id=vlan_id,
|
vlan_id=vlan_id,
|
||||||
create_vlan=False))
|
create_vlan=False)
|
||||||
|
|
||||||
|
logging.info("Sleeping 60 seconds to let stations get IP address...")
|
||||||
|
time.sleep(60)
|
||||||
|
|
||||||
logging.info("Fetching port info after all stations created")
|
logging.info("Fetching port info after all stations created")
|
||||||
port_data = self.json_get(_req_url="port?fields=ip")
|
port_data = self.json_get(_req_url="port?fields=ip")
|
||||||
@@ -3048,9 +3050,13 @@ class lf_tests(lf_libs):
|
|||||||
logging.info("Adding Station Data to the report")
|
logging.info("Adding Station Data to the report")
|
||||||
dict_table_sta = {}
|
dict_table_sta = {}
|
||||||
start_sta, end_sta = 1, 0
|
start_sta, end_sta = 1, 0
|
||||||
|
failed = False
|
||||||
for index, sta in enumerate(sta_names_2g):
|
for index, sta in enumerate(sta_names_2g):
|
||||||
end_sta += 1
|
end_sta += 1
|
||||||
result = self.json_get(_req_url="port/1/1/%s" % sta)
|
result = self.json_get(_req_url="port/1/1/%s" % sta)
|
||||||
|
if ((no_of_sta_2g <= 8 and result['interface']['ip'] == '0.0.0.0')
|
||||||
|
or (no_of_sta_2g > 8 and result['interface']['ip'] != '0.0.0.0')):
|
||||||
|
failed = True
|
||||||
if "Key" not in dict_table_sta:
|
if "Key" not in dict_table_sta:
|
||||||
dict_table_sta["Key"] = list(result["interface"].keys())
|
dict_table_sta["Key"] = list(result["interface"].keys())
|
||||||
dict_table_sta[f"Value ({sta})"] = list(result["interface"].values())
|
dict_table_sta[f"Value ({sta})"] = list(result["interface"].values())
|
||||||
@@ -3066,6 +3072,9 @@ class lf_tests(lf_libs):
|
|||||||
for index, sta in enumerate(sta_names_5g):
|
for index, sta in enumerate(sta_names_5g):
|
||||||
end_sta += 1
|
end_sta += 1
|
||||||
result = self.json_get(_req_url="port/1/1/%s" % sta)
|
result = self.json_get(_req_url="port/1/1/%s" % sta)
|
||||||
|
if ((no_of_sta_5g <= 8 and result['interface']['ip'] == '0.0.0.0')
|
||||||
|
or (no_of_sta_5g > 8 and result['interface']['ip'] != '0.0.0.0')):
|
||||||
|
failed = True
|
||||||
if "Key" not in dict_table_sta:
|
if "Key" not in dict_table_sta:
|
||||||
dict_table_sta["Key"] = list(result["interface"].keys())
|
dict_table_sta["Key"] = list(result["interface"].keys())
|
||||||
dict_table_sta[f"Value ({sta})"] = list(result["interface"].values())
|
dict_table_sta[f"Value ({sta})"] = list(result["interface"].values())
|
||||||
@@ -3078,16 +3087,17 @@ class lf_tests(lf_libs):
|
|||||||
dict_table_sta.clear()
|
dict_table_sta.clear()
|
||||||
|
|
||||||
if no_of_sta_2g > 8 or no_of_sta_5g > 8:
|
if no_of_sta_2g > 8 or no_of_sta_5g > 8:
|
||||||
if True in sta_got_ip:
|
self.pre_cleanup()
|
||||||
|
if failed:
|
||||||
logging.info("Some/All stations got the IP when more than 8 SSIDs were configured on a single band!")
|
logging.info("Some/All stations got the IP when more than 8 SSIDs were configured on a single band!")
|
||||||
pytest.fail("Some/All stations got the IP when more than 8 SSIDs were configured on a single band!")
|
pytest.fail("Some/All stations got the IP when more than 8 SSIDs were configured on a single band!")
|
||||||
else:
|
else:
|
||||||
logging.info("As expected, None of the stations got the IP when more than 8 SSIDs were configured "
|
logging.info("As expected, None of the stations got the IP when more than 8 SSIDs were configured "
|
||||||
"on a single band!")
|
"on a single band!")
|
||||||
self.pre_cleanup()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if False in sta_got_ip:
|
if failed:
|
||||||
|
self.pre_cleanup()
|
||||||
logging.info("Some/All Stations didn't get IP address")
|
logging.info("Some/All Stations didn't get IP address")
|
||||||
pytest.fail("Some/All Stations didn't get IP address")
|
pytest.fail("Some/All Stations didn't get IP address")
|
||||||
logging.info("All Stations got IP address")
|
logging.info("All Stations got IP address")
|
||||||
|
|||||||
Reference in New Issue
Block a user