mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 03:37:55 +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")
|
||||
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()
|
||||
data = self.json_get("/port/all")
|
||||
flag = 0
|
||||
profile_name = ""
|
||||
port_list = []
|
||||
vlan_raws = []
|
||||
# temp_raw_lines = self.default_scenario_raw_lines.copy()
|
||||
for port in self.wan_ports:
|
||||
for vlans in vlan_ids:
|
||||
@@ -1119,9 +1120,12 @@ class lf_libs:
|
||||
elif self.scenario == "dhcp-external":
|
||||
profile_name = "vlan_profile"
|
||||
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
|
||||
+ " NA " + port.split(".")[2] + ",AUTO -1 " + str(vlans)])
|
||||
|
||||
if build:
|
||||
self.chamber_view(raw_lines="custom")
|
||||
if self.scenario == "dhcp-external":
|
||||
for port in port_list:
|
||||
@@ -1166,6 +1170,10 @@ class lf_libs:
|
||||
if vlan_ip_fail:
|
||||
# Fail if Vlan don't have IP
|
||||
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"):
|
||||
"""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,
|
||||
num_stations={}, add_stations=True):
|
||||
wificapacity_obj_list = []
|
||||
vlan_raw_lines = None
|
||||
for dut in self.dut_data:
|
||||
sets = [["DUT_NAME", dut["model"]]]
|
||||
identifier = dut["identifier"]
|
||||
@@ -989,7 +990,7 @@ class lf_tests(lf_libs):
|
||||
logging.error("VLAN ID is Unspecified in the VLAN Case")
|
||||
pytest.skip("VLAN ID is Unspecified in the VLAN Case")
|
||||
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()
|
||||
upstream_port = ret[identifier] + "." + str(vlan_id)
|
||||
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,
|
||||
dut_data=dut_data,
|
||||
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")
|
||||
wificapacity_obj = WiFiCapacityTest(lfclient_host=self.manager_ip,
|
||||
lf_port=self.manager_http_port,
|
||||
|
||||
Reference in New Issue
Block a user