mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
adding bridge as flag value and removing hardcoded resources
This commit is contained in:
@@ -213,7 +213,7 @@ class VAPProfile(LFCliBase):
|
|||||||
|
|
||||||
def create(self, resource, radio, channel=None, up_=None, debug=False, use_ht40=True, use_ht80=True,
|
def create(self, resource, radio, channel=None, up_=None, debug=False, use_ht40=True, use_ht80=True,
|
||||||
use_ht160=False,
|
use_ht160=False,
|
||||||
suppress_related_commands_=True, use_radius=False, hs20_enable=False):
|
suppress_related_commands_=True, use_radius=False, hs20_enable=False, bridge=True):
|
||||||
port_list = self.local_realm.json_get("port/1/1/list")
|
port_list = self.local_realm.json_get("port/1/1/list")
|
||||||
if port_list is not None:
|
if port_list is not None:
|
||||||
port_list = port_list['interfaces']
|
port_list = port_list['interfaces']
|
||||||
@@ -329,25 +329,27 @@ class VAPProfile(LFCliBase):
|
|||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
# create bridge
|
# create bridge
|
||||||
data = {
|
if bridge :
|
||||||
"shelf": 1,
|
print("creating bridge")
|
||||||
"resource": resource,
|
data = {
|
||||||
"port": "br0",
|
"shelf": 1,
|
||||||
"network_devs": "eth1,%s" % self.vap_name
|
"resource": resource,
|
||||||
}
|
"port": "br0",
|
||||||
self.local_realm.json_post("cli-json/add_br", data)
|
"network_devs": "eth1,%s" % self.vap_name
|
||||||
|
}
|
||||||
|
self.local_realm.json_post("cli-json/add_br", data)
|
||||||
|
|
||||||
bridge_set_port = {
|
bridge_set_port = {
|
||||||
"shelf": 1,
|
"shelf": 1,
|
||||||
"resource": 1,
|
"resource": resource,
|
||||||
"port": "br0",
|
"port": "br0",
|
||||||
"current_flags": 0x80000000,
|
"current_flags": 0x80000000,
|
||||||
"interest": 0x4000 # (0x2 + 0x4000 + 0x800000) # current, dhcp, down
|
"interest": 0x4000 # (0x2 + 0x4000 + 0x800000) # current, dhcp, down
|
||||||
}
|
}
|
||||||
self.local_realm.json_post("cli-json/set_port", bridge_set_port)
|
self.local_realm.json_post("cli-json/set_port", bridge_set_port)
|
||||||
|
|
||||||
if (self.up):
|
if (self.up):
|
||||||
self.admin_up(1)
|
self.admin_up(resource)
|
||||||
|
|
||||||
def cleanup(self, resource, delay=0.03):
|
def cleanup(self, resource, delay=0.03):
|
||||||
print("Cleaning up VAPs")
|
print("Cleaning up VAPs")
|
||||||
@@ -361,3 +363,4 @@ class VAPProfile(LFCliBase):
|
|||||||
|
|
||||||
# And now see if they are gone
|
# And now see if they are gone
|
||||||
LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=desired_ports)
|
LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=desired_ports)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user