Merge branch 'WIFI-1321-create-a-lan-forge-pip-module' of https://github.com/Telecominfraproject/wlan-lanforge-scripts into WIFI-1321-create-a-lan-forge-pip-module

This commit is contained in:
jitendracandela
2022-11-20 16:41:38 +05:30

View File

@@ -567,15 +567,22 @@ class lf_tests(lf_libs):
if mpsk_data is None: if mpsk_data is None:
mpsk_data = {100: {"num_stations": num_sta, "passkey": "OpenWifi1"}, mpsk_data = {100: {"num_stations": num_sta, "passkey": "OpenWifi1"},
200: {"num_stations": num_sta, "passkey": "OpenWifi2"}} 200: {"num_stations": num_sta, "passkey": "OpenWifi2"}}
logging.info("Creating VLAN's")
# create VLAN's
vlans = list(mpsk_data.keys())
if "default" in vlans:
vlans.remove("default")
self.add_vlan(vlan_ids=list(mpsk_data.keys()))
logging.info("Wait until VLAN's bring up") logging.info("Creating VLAN's as per MPSK data")
time.sleep(10) # create VLAN's
vlan_ids = list(mpsk_data.keys())
if "default" in vlan_ids:
vlan_ids.remove("default")
data = self.setup_interfaces(ssid=ssid, passkey=passkey, encryption=encryption,
band=band, vlan_id=vlan_ids, mode="VLAN", num_sta=num_sta, dut_data_=dut_data)
if data == {}:
pytest.skip("Skipping This Test")
logging.info("Setup interface data:\n" + json.dumps(str(data), indent=2))
allure.attach(name="Interface Info: \n", body=json.dumps(str(data), indent=2),
attachment_type=allure.attachment_type.JSON)
# query and fetch vlan Ip Address # query and fetch vlan Ip Address
port_data = self.json_get(_req_url="/port?fields=alias,port+type,ip,mac")['interfaces'] port_data = self.json_get(_req_url="/port?fields=alias,port+type,ip,mac")['interfaces']
# Fail if Vlan don't have IP # Fail if Vlan don't have IP
@@ -620,6 +627,13 @@ class lf_tests(lf_libs):
logging.info("station data: " + str(sta_data)) logging.info("station data: " + str(sta_data))
for dut in dut_data.keys():
supplicant = data[str(dut)]['station_data'].keys()
try:
self.get_supplicant_logs(radio=str(supplicant))
except Exception as e:
logging.error(f"Error in getting Supplicant Logs: {str(e)}")
# check Pass/Fail # check Pass/Fail
table_heads = ["station name", "configured vlan-id", "expected IP Range", "allocated IP", "mac address", table_heads = ["station name", "configured vlan-id", "expected IP Range", "allocated IP", "mac address",
'pass/fail'] 'pass/fail']