mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-07 22:23:29 +00:00
Added fix for Vlan creation in wifi capacity test logic
Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -1100,12 +1100,13 @@ class lf_libs:
|
|||||||
data = self.json_get("/radiostatus/all")
|
data = self.json_get("/radiostatus/all")
|
||||||
return data[radio]["max_vifs"]
|
return data[radio]["max_vifs"]
|
||||||
|
|
||||||
def add_vlan(self, vlan_ids=[]):
|
def add_vlan(self, vlan_ids=[], build=True):
|
||||||
self.temp_raw_lines = self.default_scenario_raw_lines.copy()
|
self.temp_raw_lines = self.default_scenario_raw_lines.copy()
|
||||||
data = self.json_get("/port/all")
|
data = self.json_get("/port/all")
|
||||||
flag = 0
|
flag = 0
|
||||||
profile_name = ""
|
profile_name = ""
|
||||||
port_list = []
|
port_list = []
|
||||||
|
vlan_raws = []
|
||||||
# temp_raw_lines = self.default_scenario_raw_lines.copy()
|
# temp_raw_lines = self.default_scenario_raw_lines.copy()
|
||||||
for port in self.wan_ports:
|
for port in self.wan_ports:
|
||||||
for vlans in vlan_ids:
|
for vlans in vlan_ids:
|
||||||
@@ -1119,9 +1120,12 @@ class lf_libs:
|
|||||||
elif self.scenario == "dhcp-external":
|
elif self.scenario == "dhcp-external":
|
||||||
profile_name = "vlan_profile"
|
profile_name = "vlan_profile"
|
||||||
port_list.append(str(port) + "." + str(vlans))
|
port_list.append(str(port) + "." + str(vlans))
|
||||||
|
vlan_raws.append(["profile_link " + port + " " + profile_name + " 1 " + port
|
||||||
|
+ " NA " + port.split(".")[2] + ",AUTO -1 " + str(vlans)])
|
||||||
self.temp_raw_lines.append(["profile_link " + port + " " + profile_name + " 1 " + port
|
self.temp_raw_lines.append(["profile_link " + port + " " + profile_name + " 1 " + port
|
||||||
+ " NA " + port.split(".")[2] + ",AUTO -1 " + str(vlans)])
|
+ " NA " + port.split(".")[2] + ",AUTO -1 " + str(vlans)])
|
||||||
|
|
||||||
|
if build:
|
||||||
self.chamber_view(raw_lines="custom")
|
self.chamber_view(raw_lines="custom")
|
||||||
if self.scenario == "dhcp-external":
|
if self.scenario == "dhcp-external":
|
||||||
for port in port_list:
|
for port in port_list:
|
||||||
@@ -1166,6 +1170,10 @@ class lf_libs:
|
|||||||
if vlan_ip_fail:
|
if vlan_ip_fail:
|
||||||
# Fail if Vlan don't have IP
|
# Fail if Vlan don't have IP
|
||||||
pytest.fail("VLAN do not have IP:-" + str(not_ip_vlans))
|
pytest.fail("VLAN do not have IP:-" + str(not_ip_vlans))
|
||||||
|
return vlan_raws
|
||||||
|
else:
|
||||||
|
return vlan_raws
|
||||||
|
|
||||||
|
|
||||||
def chamber_view(self, delete_old_scenario=True, raw_lines="default"):
|
def chamber_view(self, delete_old_scenario=True, raw_lines="default"):
|
||||||
"""create chamber view. raw_lines values are default | custom"""
|
"""create chamber view. raw_lines values are default | custom"""
|
||||||
|
|||||||
@@ -969,6 +969,7 @@ class lf_tests(lf_libs):
|
|||||||
sort="interleave", raw_lines=[], move_to_influx=False, dut_data={}, ssid_name=None,
|
sort="interleave", raw_lines=[], move_to_influx=False, dut_data={}, ssid_name=None,
|
||||||
num_stations={}, add_stations=True):
|
num_stations={}, add_stations=True):
|
||||||
wificapacity_obj_list = []
|
wificapacity_obj_list = []
|
||||||
|
vlan_raw_lines = None
|
||||||
for dut in self.dut_data:
|
for dut in self.dut_data:
|
||||||
sets = [["DUT_NAME", dut["model"]]]
|
sets = [["DUT_NAME", dut["model"]]]
|
||||||
identifier = dut["identifier"]
|
identifier = dut["identifier"]
|
||||||
@@ -989,7 +990,7 @@ class lf_tests(lf_libs):
|
|||||||
logging.error("VLAN ID is Unspecified in the VLAN Case")
|
logging.error("VLAN ID is Unspecified in the VLAN Case")
|
||||||
pytest.skip("VLAN ID is Unspecified in the VLAN Case")
|
pytest.skip("VLAN ID is Unspecified in the VLAN Case")
|
||||||
else:
|
else:
|
||||||
self.add_vlan(vlan_ids=[vlan_id])
|
vlan_raw_lines = self.add_vlan(vlan_ids=[vlan_id], build=True)
|
||||||
ret = self.get_wan_upstream_ports()
|
ret = self.get_wan_upstream_ports()
|
||||||
upstream_port = ret[identifier] + "." + str(vlan_id)
|
upstream_port = ret[identifier] + "." + str(vlan_id)
|
||||||
logging.info("Upstream data: " + str(upstream_port))
|
logging.info("Upstream data: " + str(upstream_port))
|
||||||
@@ -1028,6 +1029,9 @@ class lf_tests(lf_libs):
|
|||||||
self.add_stations(band=band_, num_stations=num_stations[band_], ssid_name=ssid_name,
|
self.add_stations(band=band_, num_stations=num_stations[band_], ssid_name=ssid_name,
|
||||||
dut_data=dut_data,
|
dut_data=dut_data,
|
||||||
identifier=identifier)
|
identifier=identifier)
|
||||||
|
if vlan_raw_lines is not None:
|
||||||
|
for i in vlan_raw_lines:
|
||||||
|
self.temp_raw_lines.append(i)
|
||||||
self.chamber_view(raw_lines="custom")
|
self.chamber_view(raw_lines="custom")
|
||||||
wificapacity_obj = WiFiCapacityTest(lfclient_host=self.manager_ip,
|
wificapacity_obj = WiFiCapacityTest(lfclient_host=self.manager_ip,
|
||||||
lf_port=self.manager_http_port,
|
lf_port=self.manager_http_port,
|
||||||
|
|||||||
Reference in New Issue
Block a user