mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
Modified add vlan method
Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com>
This commit is contained in:
@@ -338,7 +338,6 @@ class lf_libs:
|
|||||||
|
|
||||||
def create_dhcp_external(self):
|
def create_dhcp_external(self):
|
||||||
self.setup_connectivity_port(data=self.wan_ports)
|
self.setup_connectivity_port(data=self.wan_ports)
|
||||||
exit(1)
|
|
||||||
for wan_port in self.wan_ports:
|
for wan_port in self.wan_ports:
|
||||||
upstream_port = wan_port
|
upstream_port = wan_port
|
||||||
upstream_resources = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
|
upstream_resources = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
|
||||||
@@ -477,6 +476,7 @@ class lf_libs:
|
|||||||
data = self.json_get("/port/all")
|
data = self.json_get("/port/all")
|
||||||
flag = 0
|
flag = 0
|
||||||
profile_name = ""
|
profile_name = ""
|
||||||
|
port_list = []
|
||||||
temp_raw_lines = self.default_scenario_raw_lines
|
temp_raw_lines = self.default_scenario_raw_lines
|
||||||
for port in self.wan_ports:
|
for port in self.wan_ports:
|
||||||
for vlans in vlan_ids:
|
for vlans in vlan_ids:
|
||||||
@@ -490,10 +490,25 @@ class lf_libs:
|
|||||||
profile_name = "vlan_dhcp_profile"
|
profile_name = "vlan_dhcp_profile"
|
||||||
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))
|
||||||
temp_raw_lines.append(["profile_link " + port + " " + profile_name + " 1 " + port
|
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)])
|
||||||
print(temp_raw_lines)
|
print(temp_raw_lines)
|
||||||
self.chamber_view(raw_lines=temp_raw_lines)
|
self.chamber_view(raw_lines=temp_raw_lines)
|
||||||
|
if self.scenario == "dhcp-external":
|
||||||
|
print(port_list)
|
||||||
|
for port in port_list:
|
||||||
|
data = {
|
||||||
|
"shelf": port.split(".")[0],
|
||||||
|
"resource": port.split(".")[1],
|
||||||
|
"port": port.split(".")[2] + "." + port.split(".")[3],
|
||||||
|
"current_flags": 2147483648,
|
||||||
|
"interest": 16384
|
||||||
|
}
|
||||||
|
self.json_post("/cli-json/set_port", data)
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def chamber_view(self, delete_old_scenario=True, raw_lines=[]):
|
def chamber_view(self, delete_old_scenario=True, raw_lines=[]):
|
||||||
print(self.chamberview_object)
|
print(self.chamberview_object)
|
||||||
|
|||||||
@@ -831,7 +831,6 @@ if __name__ == '__main__':
|
|||||||
"supported_bands": ["2G", "5G"],
|
"supported_bands": ["2G", "5G"],
|
||||||
"wan_port": "1.1.eth1",
|
"wan_port": "1.1.eth1",
|
||||||
"supported_modes": ["BRIDGE", "NAT", "VLAN"],
|
"supported_modes": ["BRIDGE", "NAT", "VLAN"],
|
||||||
"wan_port": "1.1.eth2",
|
|
||||||
"ssid": {
|
"ssid": {
|
||||||
"2g-ssid": "OpenWifi",
|
"2g-ssid": "OpenWifi",
|
||||||
"5g-ssid": "OpenWifi",
|
"5g-ssid": "OpenWifi",
|
||||||
@@ -861,7 +860,7 @@ if __name__ == '__main__':
|
|||||||
"testbed": "basic",
|
"testbed": "basic",
|
||||||
"scenario": "dhcp-external", # dhcp-bridge / dhcp-external
|
"scenario": "dhcp-external", # dhcp-bridge / dhcp-external
|
||||||
"details": {
|
"details": {
|
||||||
"manager_ip": "10.28.3.32",
|
"manager_ip": "192.168.200.101",
|
||||||
"http_port": 8080,
|
"http_port": 8080,
|
||||||
"ssh_port": 22,
|
"ssh_port": 22,
|
||||||
"setup": {"method": "build", "DB": "Test_Scenario_Automation"}, # method: build/load,
|
"setup": {"method": "build", "DB": "Test_Scenario_Automation"}, # method: build/load,
|
||||||
@@ -874,18 +873,18 @@ if __name__ == '__main__':
|
|||||||
# }}},
|
# }}},
|
||||||
# # DB : Default database name
|
# # DB : Default database name
|
||||||
"wan_ports": {
|
"wan_ports": {
|
||||||
"1.1.eth2": {"addressing": "dhcp-server", "subnet": "172.16.0.1/16", "dhcp": {
|
"1.1.eth1": {"addressing": "dhcp-server", "subnet": "172.16.0.1/16", "dhcp": {
|
||||||
"lease-first": 10,
|
"lease-first": 10,
|
||||||
"lease-count": 10000,
|
"lease-count": 10000,
|
||||||
"lease-time": "6h"
|
"lease-time": "6h"
|
||||||
}}},
|
}}},
|
||||||
"lan_ports": {},
|
"lan_ports": {},
|
||||||
"uplink_nat_ports": {
|
# "uplink_nat_ports": {
|
||||||
"1.1.eth3": {"addressing": "static", "subnet": "10.28.2.1/24", "gateway_ip": "10.28.2.1",
|
# "1.1.eth3": {"addressing": "static", "subnet": "10.28.2.1/24", "gateway_ip": "10.28.2.1",
|
||||||
"dns_servers": "8.8.8.8", "ip_mask": "255.255.255.0"}
|
# "dns_servers": "8.8.8.8", "ip_mask": "255.255.255.0"}
|
||||||
# dhcp-server/{"addressing":
|
# # dhcp-server/{"addressing":
|
||||||
# "dynamic"} /{"addressing": "static", "subnet": "10.28.2.6/16"}
|
# # "dynamic"} /{"addressing": "static", "subnet": "10.28.2.6/16"}
|
||||||
}
|
# }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -896,10 +895,9 @@ if __name__ == '__main__':
|
|||||||
#obj.create_dhcp_external()
|
#obj.create_dhcp_external()
|
||||||
# obj.get_cx_data()
|
# obj.get_cx_data()
|
||||||
# obj.chamber_view()
|
# obj.chamber_view()
|
||||||
c = obj.client_connectivity_test(ssid="OpenWifi", passkey="OpenWifi", security="wpa2", extra_securities=[],
|
# c = obj.client_connectivity_test(ssid="OpenWifi", passkey="OpenWifi", security="wpa2", extra_securities=[],
|
||||||
num_sta=1, mode="BRIDGE", vlan_id=1,
|
# num_sta=1, mode="BRIDGE", vlan_id=1,
|
||||||
band="twog", ssid_channel=11)
|
# band="twog", ssid_channel=11)
|
||||||
print(c)
|
|
||||||
# obj.start_sniffer(radio_channel=1, radio="wiphy7", test_name="sniff_radio", duration=30)
|
# obj.start_sniffer(radio_channel=1, radio="wiphy7", test_name="sniff_radio", duration=30)
|
||||||
# print("started")
|
# print("started")
|
||||||
# time.sleep(30)
|
# time.sleep(30)
|
||||||
@@ -915,5 +913,7 @@ if __name__ == '__main__':
|
|||||||
# obj.client_connectivity_test(ssid="wpa2_5g", passkey="something", security="wpa2", extra_securities=[],
|
# obj.client_connectivity_test(ssid="wpa2_5g", passkey="something", security="wpa2", extra_securities=[],
|
||||||
# num_sta=1, mode="BRIDGE", vlan_id=1,
|
# num_sta=1, mode="BRIDGE", vlan_id=1,
|
||||||
# band="fiveg", ssid_channel=36)
|
# band="fiveg", ssid_channel=36)
|
||||||
# obj.chamber_view()
|
obj.chamber_view()
|
||||||
# obj.setup_relevent_profiles()
|
obj.setup_relevent_profiles()
|
||||||
|
obj.add_vlan(vlan_ids=[100, 200, 300])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user