mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
Fixed the chamberview lan creation part
Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -185,7 +185,9 @@ class lf_libs:
|
||||
"""
|
||||
|
||||
def setup_dut(self):
|
||||
print(self.dut_data)
|
||||
for index in range(0, len(self.dut_data)):
|
||||
print(self.testbed)
|
||||
dut_obj = DUT(lfmgr=self.manager_ip,
|
||||
port=self.manager_http_port,
|
||||
dut_name=self.testbed + "-" + str(index),
|
||||
@@ -195,8 +197,11 @@ class lf_libs:
|
||||
serial_num=self.dut_data[index]["identifier"])
|
||||
dut_obj.setup()
|
||||
dut_obj.add_ssids()
|
||||
time.sleep(5)
|
||||
self.dut_objects.append(dut_obj)
|
||||
dut_obj.show_text_blob(None, None, True) # Show changes on GUI
|
||||
dut_obj.sync_cv()
|
||||
time.sleep(2)
|
||||
dut_obj.sync_cv()
|
||||
print("Creating DUT")
|
||||
|
||||
def setup_metadata(self):
|
||||
data = self.json_get("/port/all")
|
||||
@@ -298,7 +303,7 @@ class lf_libs:
|
||||
"port": eth_port.split(".")[2],
|
||||
"ip_addr": data[eth_port]["ip"].split("/")[0],
|
||||
"netmask": data[eth_port]["ip_mask"],
|
||||
"gateway": data[eth_port]["gateway_ip"],
|
||||
"gateway": data[eth_port]["gateway_ip"].split("/")[0],
|
||||
"dns_servers": data[eth_port]["dns_servers"],
|
||||
"current_flags": 562949953421312,
|
||||
"interest": 0x401e
|
||||
@@ -332,14 +337,23 @@ class lf_libs:
|
||||
upstream_resources = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
|
||||
uplink_port = uplink_nat_ports
|
||||
uplink_resources = uplink_port.split(".")[0] + "." + uplink_port.split(".")[1]
|
||||
print(uplink_nat_ports)
|
||||
uplink_subnet = self.uplink_nat_ports[uplink_nat_ports]["ip"]
|
||||
print(uplink_subnet)
|
||||
gateway_ip = self.uplink_nat_ports[uplink_nat_ports]["gateway_ip"]
|
||||
dut_obj = DUT(lfmgr=self.manager_ip,
|
||||
port=self.manager_http_port,
|
||||
dut_name="upstream",
|
||||
lan_port=gateway_ip)
|
||||
dut_obj.setup()
|
||||
dut_obj.add_ssids()
|
||||
dut_obj.show_text_blob(None, None, True) # Show changes on GUI
|
||||
dut_obj.sync_cv()
|
||||
time.sleep(2)
|
||||
dut_obj.sync_cv()
|
||||
self.default_scenario_raw_lines.append(["profile_link " + upstream_resources + " upstream-dhcp 1 NA NA " +
|
||||
upstream_port.split(".")[2] + ",AUTO -1 NA"])
|
||||
self.default_scenario_raw_lines.append(
|
||||
["profile_link " + uplink_resources + " uplink-nat 1 'DUT: upstream LAN "
|
||||
+ uplink_subnet
|
||||
+ gateway_ip +
|
||||
+ "' NA " + uplink_port.split(".")[2] + "," + upstream_port.split(".")[2] + " -1 NA"])
|
||||
return self.default_scenario_raw_lines
|
||||
def create_dhcp_external(self):
|
||||
|
||||
@@ -899,7 +899,7 @@ if __name__ == '__main__':
|
||||
"1.1.eth1": {
|
||||
"addressing": "static",
|
||||
"ip": "10.28.2.16",
|
||||
"gateway_ip": "10.28.2.1",
|
||||
"gateway_ip": "10.28.2.1/24",
|
||||
"ip_mask": "255.255.255.0",
|
||||
"dns_servers": "BLANK"
|
||||
}
|
||||
@@ -919,9 +919,9 @@ if __name__ == '__main__':
|
||||
# obj.create_dhcp_external()obj.add_vlan(vlan_ids=[100, 200, 300, 400, 500, 600])
|
||||
# obj.get_cx_data()
|
||||
# obj.chamber_view()
|
||||
c = obj.client_connectivity_test(ssid="OpenWifi", passkey="OpenWifi", security="wpa2", extra_securities=[],
|
||||
num_sta=1, mode="BRIDGE", vlan_id=[100],
|
||||
band="twog", ssid_channel=11)
|
||||
# c = obj.client_connectivity_test(ssid="OpenWifi", passkey="OpenWifi", security="wpa2", extra_securities=[],
|
||||
# num_sta=1, mode="BRIDGE", vlan_id=[100],
|
||||
# band="twog", ssid_channel=11)
|
||||
# obj.start_sniffer(radio_channel=1, radio="wiphy7", test_name="sniff_radio", duration=30)
|
||||
# print("started")
|
||||
# time.sleep(30)
|
||||
|
||||
@@ -72,6 +72,7 @@ cv_test_manager = importlib.import_module("py-json.cv_test_manager")
|
||||
cvtest = cv_test_manager.cv_test
|
||||
lf_logger_config = importlib.import_module("py-scripts.lf_logger_config")
|
||||
|
||||
|
||||
class DUT(dut):
|
||||
def __init__(self,
|
||||
lfmgr="localhost",
|
||||
@@ -82,6 +83,7 @@ class DUT(dut):
|
||||
hw_version="NA",
|
||||
serial_num="NA",
|
||||
model_num="NA",
|
||||
lan_port="BLANK",
|
||||
dut_flags=None,
|
||||
):
|
||||
super().__init__(
|
||||
@@ -100,6 +102,8 @@ class DUT(dut):
|
||||
self.cv_test = cvtest(lfmgr, port)
|
||||
self.dut_name = dut_name
|
||||
self.ssid = ssid
|
||||
self.lan_port = lan_port
|
||||
print("JITT")
|
||||
|
||||
def setup(self):
|
||||
self.create_dut()
|
||||
@@ -118,7 +122,7 @@ class DUT(dut):
|
||||
self.ssid[j] = shlex.split(self.ssid[j][0])
|
||||
for k in range(len(self.ssid[j])):
|
||||
kvp = self.ssid[j][k].split('=')
|
||||
#print("key -:%s:- val -:%s:-" % (kvp[0], kvp[1]))
|
||||
# print("key -:%s:- val -:%s:-" % (kvp[0], kvp[1]))
|
||||
self.ssid[j][k] = kvp
|
||||
|
||||
d = dict()
|
||||
@@ -131,10 +135,10 @@ class DUT(dut):
|
||||
if 'security' in self.ssid[j].keys():
|
||||
self.ssid[j]['security'] = self.ssid[j]['security'].split('|')
|
||||
for security in self.ssid[j]['security']:
|
||||
#print("security: %s flags: %s keys: %s" % (security, flags, flags.keys()))
|
||||
# print("security: %s flags: %s keys: %s" % (security, flags, flags.keys()))
|
||||
if security.lower() in flags:
|
||||
flag |= flags[security.lower()]
|
||||
#print("updated flag: %s" % (flag))
|
||||
# print("updated flag: %s" % (flag))
|
||||
else:
|
||||
emsg = "ERROR: Un-supported security flag: %s" % (security)
|
||||
logger.critical(emsg)
|
||||
@@ -219,7 +223,7 @@ def main():
|
||||
# set the logger level to requested value
|
||||
logger_config.set_level(level=args.log_level)
|
||||
logger_config.set_json(json_file=args.lf_logger_config_json)
|
||||
|
||||
|
||||
new_dut = DUT(lfmgr=args.lfmgr,
|
||||
port=args.port,
|
||||
dut_name=args.dut_name,
|
||||
|
||||
Reference in New Issue
Block a user