mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-30 18:27:53 +00:00
merge quali-dev changes in create_wanlink.py and test_wanlink.py to master
This commit is contained in:
@@ -3,209 +3,236 @@
|
||||
# Written by Candela Technologies Inc.
|
||||
# Updated by: Erin Grimes
|
||||
import sys
|
||||
import urllib
|
||||
import os
|
||||
import importlib
|
||||
import time
|
||||
from time import sleep
|
||||
import urllib
|
||||
from urllib import error
|
||||
if sys.version_info[0] != 3:
|
||||
print("This script requires Python 3")
|
||||
exit()
|
||||
import time
|
||||
from time import sleep
|
||||
from urllib import error
|
||||
import pprint
|
||||
from LANforge import LFRequest
|
||||
from LANforge import LFUtils
|
||||
from LANforge.LFUtils import NA
|
||||
if 'lanforge-scripts' not in sys.path:
|
||||
sys.path.append(os.path.join(os.path.abspath('../..'), 'lanforge-scripts'))
|
||||
LANforge = importlib.import_module("lanforge-scripts.py-json.LANforge")
|
||||
LFRequest = importlib.import_module("lanforge-scripts.py-json.LANforge.LFRequest")
|
||||
LFUtils = importlib.import_module("lanforge-scripts.py-json.LANforge.LFUtils")
|
||||
# NA=importlib.import_module("lanforge-scripts.py-json.LANforge.LFUtils.NA")
|
||||
|
||||
j_printer = pprint.PrettyPrinter(indent=2)
|
||||
# todo: this needs to change
|
||||
resource_id = 1
|
||||
|
||||
def create(base_url="http://localhost:8080", args={}):
|
||||
json_post = ""
|
||||
json_response = ""
|
||||
num_wanlinks = -1
|
||||
|
||||
# see if there are old wanlinks to remove
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/list")
|
||||
print(lf_r.get_as_json())
|
||||
|
||||
# ports to set as endpoints
|
||||
port_a ="rd0a"
|
||||
port_b ="rd1a"
|
||||
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
for key,value in json_response.items():
|
||||
if (isinstance(value, dict) and "_links" in value):
|
||||
num_wanlinks = 1
|
||||
except urllib.error.HTTPError as error:
|
||||
num_wanlinks = 0;
|
||||
def main(base_url, args={}):
|
||||
print(base_url)
|
||||
json_post = ""
|
||||
json_response = ""
|
||||
num_wanlinks = -1
|
||||
|
||||
# remove old wanlinks
|
||||
if (num_wanlinks > 0):
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_cx")
|
||||
lf_r.addPostData({
|
||||
# see if there are old wanlinks to remove
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/list")
|
||||
print(lf_r.get_as_json())
|
||||
|
||||
# remove old wanlinks
|
||||
if (num_wanlinks > 0):
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_cx")
|
||||
lf_r.addPostData({
|
||||
'test_mgr': 'all',
|
||||
'cx_name': 'wl_eg1'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
'cx_name': args['name']
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp")
|
||||
lf_r.addPostData({
|
||||
'endp_name': 'wl_eg1-A'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
for key, value in json_response.items():
|
||||
if (isinstance(value, dict) and "_links" in value):
|
||||
num_wanlinks = 1
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp")
|
||||
lf_r.addPostData({
|
||||
'endp_name': 'wl_eg1-B'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp")
|
||||
lf_r.addPostData({
|
||||
'endp_name': args['name']+"_A"
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# create wanlink 1a
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp")
|
||||
lf_r.addPostData({
|
||||
'alias': 'wl_eg1-A',
|
||||
'shelf': 1,
|
||||
'resource': '1',
|
||||
'port': port_a,
|
||||
'latency': args['latency_A'],
|
||||
'max_rate': args['rate_A']
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/rm_endp")
|
||||
lf_r.addPostData({
|
||||
'endp_name': args['name']+"_B"
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# create wanlink 1b
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp")
|
||||
lf_r.addPostData({
|
||||
'alias': 'wl_eg1-B',
|
||||
'shelf': 1,
|
||||
'resource': '1',
|
||||
'port': port_b,
|
||||
'latency': args['latency_B'],
|
||||
'max_rate': args['rate_B']
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
# create wanlink endpoint A
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp")
|
||||
lf_r.addPostData({
|
||||
'alias': args['name']+"_A",
|
||||
'shelf': 1,
|
||||
'resource': '1',
|
||||
'port': args['port_A'],
|
||||
'latency': args['latency_A'],
|
||||
'max_rate': args['rate_A'],
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# create cx
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_cx")
|
||||
lf_r.addPostData({
|
||||
'alias': 'wl_eg1',
|
||||
'test_mgr': 'default_tm',
|
||||
'tx_endp': 'wl_eg1-A',
|
||||
'rx_endp': 'wl_eg1-B',
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
# create wanlink endpoint B
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_wl_endp")
|
||||
lf_r.addPostData({
|
||||
'alias': args['name']+"_B",
|
||||
'shelf': 1,
|
||||
'resource': '1',
|
||||
'port': args['port_B'],
|
||||
'latency': args['latency_B'],
|
||||
'max_rate': args['rate_B'],
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# start wanlink once we see it
|
||||
seen = 0
|
||||
while (seen < 1):
|
||||
sleep(1)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1?fields=name,state,_links")
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
if (json_response is None):
|
||||
# create cx
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/add_cx")
|
||||
lf_r.addPostData({
|
||||
'alias': args['name'],
|
||||
'test_mgr': 'default_tm',
|
||||
'tx_endp': args['name']+"_A",
|
||||
'rx_endp': args['name']+"_B",
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# modify wanlink endpoint A
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_wanlink_info")
|
||||
lf_r.addPostData({
|
||||
'name': args['name']+"_A",
|
||||
'max_jitter': args['jitter_A'],
|
||||
'jitter_freq': args['jitter_freq_A'],
|
||||
'drop_freq': args['drop_A']
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# modify wanlink endpoint B
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_wanlink_info")
|
||||
lf_r.addPostData({
|
||||
'name': args['name']+"_B",
|
||||
'max_jitter': args['jitter_B'],
|
||||
'jitter_freq': args['jitter_freq_B'],
|
||||
'drop_freq': args['drop_B']
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
sleep(0.05)
|
||||
|
||||
# start wanlink once we see it
|
||||
seen = 0
|
||||
while (seen < 1):
|
||||
sleep(1)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,state,_links")
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
if (json_response is None):
|
||||
continue
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
for key, value in json_response.items():
|
||||
if (isinstance(value, dict)):
|
||||
if ("_links" in value):
|
||||
if (value["name"] == args['name']):
|
||||
seen = 1
|
||||
else:
|
||||
pass
|
||||
# else:
|
||||
# print(" name was not wl_eg1")
|
||||
# else:
|
||||
# print("value lacks _links")
|
||||
# else:
|
||||
# print("value not a dict")
|
||||
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
continue
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
for key,value in json_response.items():
|
||||
if (isinstance(value, dict)):
|
||||
if ("_links" in value):
|
||||
if (value["name"] == "wl_eg1"):
|
||||
seen = 1
|
||||
#else:
|
||||
# print(" name was not wl_eg1")
|
||||
#else:
|
||||
# print("value lacks _links")
|
||||
#else:
|
||||
# print("value not a dict")
|
||||
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
continue
|
||||
print("starting wanlink:")
|
||||
# print("the latency is {laten}".format(laten=latency))
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state")
|
||||
lf_r.addPostData({
|
||||
'test_mgr': 'all',
|
||||
'cx_name': args['name'],
|
||||
'cx_state': 'RUNNING'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
|
||||
print("starting wanlink:")
|
||||
# print("the latency is {laten}".format(laten=latency))
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state")
|
||||
lf_r.addPostData({
|
||||
'test_mgr': 'all',
|
||||
'cx_name': 'wl_eg1',
|
||||
'cx_state': 'RUNNING'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
running = 0
|
||||
while (running < 1):
|
||||
sleep(1)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,state,_links")
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
if (json_response is None):
|
||||
continue
|
||||
for key, value in json_response.items():
|
||||
if (isinstance(value, dict)):
|
||||
if ("_links" in value):
|
||||
if (value["name"] == args['name']):
|
||||
if (value["state"].startswith("Run")):
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
running = 1
|
||||
|
||||
|
||||
running = 0
|
||||
while (running < 1):
|
||||
sleep(1)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1?fields=name,state,_links")
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
if (json_response is None):
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
continue
|
||||
for key,value in json_response.items():
|
||||
if (isinstance(value, dict)):
|
||||
if ("_links" in value):
|
||||
if (value["name"] == "wl_eg1"):
|
||||
if (value["state"].startswith("Run")):
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
running = 1
|
||||
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
continue
|
||||
print("Wanlink is running")
|
||||
|
||||
print("Wanlink is running")
|
||||
# stop wanlink
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state")
|
||||
lf_r.addPostData({
|
||||
'test_mgr': 'all',
|
||||
'cx_name': args['name'],
|
||||
'cx_state': 'STOPPED'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
running = 1
|
||||
while (running > 0):
|
||||
sleep(1)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,eid,state,_links")
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
if (json_response is None):
|
||||
continue
|
||||
for key, value in json_response.items():
|
||||
if (isinstance(value, dict)):
|
||||
if ("_links" in value):
|
||||
if (value["name"] == args['name']):
|
||||
if (value["state"].startswith("Stop")):
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
running = 0
|
||||
|
||||
# stop wanlink
|
||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state")
|
||||
lf_r.addPostData({
|
||||
'test_mgr': 'all',
|
||||
'cx_name': 'wl_eg1',
|
||||
'cx_state': 'STOPPED'
|
||||
})
|
||||
lf_r.jsonPost()
|
||||
running = 1
|
||||
while (running > 0):
|
||||
sleep(1)
|
||||
lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1?fields=name,eid,state,_links")
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
try:
|
||||
json_response = lf_r.getAsJson()
|
||||
if (json_response is None):
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
continue
|
||||
for key,value in json_response.items():
|
||||
if (isinstance(value, dict)):
|
||||
if ("_links" in value):
|
||||
if (value["name"] == "wl_eg1"):
|
||||
if (value["state"].startswith("Stop")):
|
||||
LFUtils.debug_printer.pprint(json_response)
|
||||
running = 0
|
||||
|
||||
except urllib.error.HTTPError as error:
|
||||
print("Error code "+error.code)
|
||||
continue
|
||||
print("Wanlink is stopped.")
|
||||
|
||||
print("Wanlink is stopped.")
|
||||
# print("Wanlink info:")
|
||||
# lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1")
|
||||
# json_response = lf_r.getAsJson()
|
||||
# LFUtils.debug_printer.pprint(json_response)
|
||||
|
||||
# print("Wanlink info:")
|
||||
# lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1")
|
||||
# json_response = lf_r.getAsJson()
|
||||
# LFUtils.debug_printer.pprint(json_response)
|
||||
# lf_r = LFRequest.LFRequest(base_url+"/wl_ep/wl_eg1-A")
|
||||
# json_response = lf_r.getAsJson()
|
||||
# LFUtils.debug_printer.pprint(json_response)
|
||||
|
||||
# lf_r = LFRequest.LFRequest(base_url+"/wl_ep/wl_eg1-A")
|
||||
# json_response = lf_r.getAsJson()
|
||||
# LFUtils.debug_printer.pprint(json_response)
|
||||
|
||||
# lf_r = LFRequest.LFRequest(base_url+"/wl_ep/wl_eg1-B")
|
||||
# json_response = lf_r.getAsJson()
|
||||
# LFUtils.debug_printer.pprint(json_response)
|
||||
# lf_r = LFRequest.LFRequest(base_url+"/wl_ep/wl_eg1-B")
|
||||
# json_response = lf_r.getAsJson()
|
||||
# LFUtils.debug_printer.pprint(json_response)
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -2,133 +2,109 @@
|
||||
# Create and modify WAN Links from the command line.
|
||||
# Written by Candela Technologies Inc.
|
||||
# Updated by: Erin Grimes
|
||||
"""
|
||||
sample command:
|
||||
./test_wanlink.py --name my_wanlink4 --latency_A 20 --latency_B 69 --rate 1000 --jitter_A 53 --jitter_B 73 --jitter_freq 6 --drop_A 12 --drop_B 11
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import importlib
|
||||
if sys.version_info[0] != 3:
|
||||
print("This script requires Python 3")
|
||||
exit(1)
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-json')
|
||||
if 'lanforge-scripts' not in sys.path:
|
||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../")))
|
||||
import argparse
|
||||
from LANforge.lfcli_base import LFCliBase
|
||||
from LANforge.LFUtils import *
|
||||
from realm import Realm
|
||||
import time
|
||||
import create_wanlink
|
||||
lfcli_base = importlib.import_module("lanforge-scripts.py-json.LANforge.lfcli_base")
|
||||
LFCliBase = lfcli_base.LFCliBase
|
||||
LFUtils = importlib.import_module("lanforge-scripts.py-json.LANforge.LFUtils")
|
||||
realm = importlib.import_module("lanforge-scripts.py-json.realm")
|
||||
Realm = realm.Realm
|
||||
create_wanlink = importlib.import_module("lanforge-scripts.py-json.create_wanlink")
|
||||
|
||||
|
||||
class LANtoWAN(Realm):
|
||||
def __init__(self, args):
|
||||
super().__init__(args['host'], args['port'])
|
||||
self.args = args
|
||||
self.lan_port="eth2"
|
||||
self.wan_port="eth3"
|
||||
# self.prefix='sta'
|
||||
# self.number_template="00000"
|
||||
self.radio="wiphy0"
|
||||
# self.sta_list = []
|
||||
# self.side_a_min_rate=0
|
||||
# self.side_a_max_rate=56
|
||||
# self.side_b_min_rate=0
|
||||
# self.side_b_max_rate=56
|
||||
self._debug_on=False
|
||||
self._exit_on_error=False
|
||||
self._exit_on_fail=False
|
||||
self._debug_on = False
|
||||
self._exit_on_error = False
|
||||
self._exit_on_fail = False
|
||||
|
||||
def create_wanlinks(self, shelf=1, resource=1, max_rate=1544000):
|
||||
print("Creating wanlinks")
|
||||
# print("the latency is {laten}\n".format(laten=self.latency))
|
||||
|
||||
# create redirects for wanlink
|
||||
url = "/cli-json/add_rdd"
|
||||
data = {
|
||||
"shelf": shelf,
|
||||
"resource": resource,
|
||||
"port": "rd0a",
|
||||
"peer_ifname": "rd1a"
|
||||
}
|
||||
self.json_post(url, data)
|
||||
|
||||
url = "/cli-json/add_rdd"
|
||||
data = {
|
||||
"shelf": shelf,
|
||||
"resource": resource,
|
||||
"port": "rd1a",
|
||||
"peer_ifname": "rd0a"
|
||||
}
|
||||
self.json_post(url, data)
|
||||
time.sleep(.05)
|
||||
|
||||
# create wanlink endpoints
|
||||
url = "/cli-json/add_wl_endp"
|
||||
data = {
|
||||
"alias": "wlan1",
|
||||
"shelf": shelf,
|
||||
"resource": resource,
|
||||
"port": "rd0a",
|
||||
"latency": self.args['latency_A'],
|
||||
"max_rate": self.args['rate_A']
|
||||
}
|
||||
self.json_post(url, data)
|
||||
|
||||
url = "/cli-json/add_wl_endp"
|
||||
data = {
|
||||
"alias": "wlan2",
|
||||
"shelf": shelf,
|
||||
"resource": resource,
|
||||
"port": "rd1a",
|
||||
"latency": self.args['latency_B'],
|
||||
"max_rate": self.args['rate_B']
|
||||
}
|
||||
self.json_post(url, data)
|
||||
create_wanlink.main('http://'+self.args['host']+':8080', self.args)
|
||||
|
||||
|
||||
def cleanup(self): pass
|
||||
|
||||
|
||||
def main():
|
||||
parser = LFCliBase.create_basic_argparse(
|
||||
prog='test_wanlink.py',
|
||||
formatter_class=argparse.RawTextHelpFormatter)
|
||||
for group in parser._action_groups:
|
||||
if group.title == "required arguments":
|
||||
required_args=group
|
||||
required_args = group
|
||||
break
|
||||
|
||||
optional_args=None
|
||||
optional_args = None
|
||||
for group in parser._action_groups:
|
||||
if group.title == "optional arguments":
|
||||
optional_args=group
|
||||
optional_args = group
|
||||
break
|
||||
if optional_args is not None:
|
||||
# optional_args.add_argument('--lanport', help='Select the port you want for lanport', default='wiphy0')
|
||||
# optional_args.add_argument('--wanport', help='Select the port you want for wanport', default='wiphy1'
|
||||
optional_args.add_argument('--name', help='The name of the wanlink', default="wl_eg1")
|
||||
optional_args.add_argument('--port_A', help='Endpoint A', default="eth1")
|
||||
optional_args.add_argument('--port_B', help='Endpoint B', default="eth2")
|
||||
optional_args.add_argument('--rate', help='The maximum rate of transfer at both endpoints (bits/s)', default=1000000)
|
||||
optional_args.add_argument('--rate_A', help='The max rate of transfer at endpoint A (bits/s)', default=None)
|
||||
optional_args.add_argument('--rate_B', help='The maximum rate of transfer (bits/s)', default=None)
|
||||
optional_args.add_argument('--latency', help='The delay of both ports', default=20)
|
||||
optional_args.add_argument('--latency_A', help='The delay of port A', default=None)
|
||||
optional_args.add_argument('--latency_B', help='The delay of port B', default=None)
|
||||
optional_args.add_argument('--jitter', help='The max jitter of both ports (ms)', default=None)
|
||||
optional_args.add_argument('--jitter_A', help='The max jitter of port A (ms)', default=None)
|
||||
optional_args.add_argument('--jitter_B', help='The max jitter of port B (ms)', default=None)
|
||||
optional_args.add_argument('--jitter_freq', help='The jitter frequency of both ports (%)', default=None)
|
||||
optional_args.add_argument('--jitter_freq_A', help='The jitter frequency of port A (%)', default=None)
|
||||
optional_args.add_argument('--jitter_freq_B', help='The jitter frequency of port B (%)', default=None)
|
||||
optional_args.add_argument('--drop', help='The drop frequency of both ports (%)', default=None)
|
||||
optional_args.add_argument('--drop_A', help='The drop frequency of port A (%)', default=None)
|
||||
optional_args.add_argument('--drop_B', help='The drop frequency of port B (%)', default=None)
|
||||
# todo: packet loss A and B
|
||||
# todo: jitter A and B
|
||||
for group in parser._action_groups:
|
||||
if group.title == "optional arguments":
|
||||
optional_args=group
|
||||
optional_args = group
|
||||
break
|
||||
parseargs = parser.parse_args()
|
||||
parseargs = parser.parse_args()
|
||||
args = {
|
||||
"host": parseargs.mgr,
|
||||
"port": parseargs.mgr_port,
|
||||
"ssid": parseargs.ssid,
|
||||
"security": parseargs.security,
|
||||
"password": parseargs.passwd,
|
||||
"name": parseargs.name,
|
||||
"port_A": parseargs.port_A,
|
||||
"port_B": parseargs.port_B,
|
||||
"latency": parseargs.latency,
|
||||
"latency_A": (parseargs.latency_A if parseargs.latency_A is not None else parseargs.latency),
|
||||
"latency_B": (parseargs.latency_B if parseargs.latency_B is not None else parseargs.latency),
|
||||
"rate": (parseargs.rate),
|
||||
"rate_A": (parseargs.rate_A if parseargs.rate_A is not None else parseargs.rate),
|
||||
"rate_B": (parseargs.rate_B if parseargs.rate_B is not None else parseargs.rate)
|
||||
"rate_B": (parseargs.rate_B if parseargs.rate_B is not None else parseargs.rate),
|
||||
"jitter": (parseargs.jitter),
|
||||
"jitter_A": (parseargs.jitter_A if parseargs.jitter_A is not None else parseargs.jitter),
|
||||
"jitter_B": (parseargs.jitter_B if parseargs.jitter_B is not None else parseargs.jitter),
|
||||
"jitter_freq": (parseargs.jitter),
|
||||
"jitter_freq_A": (parseargs.jitter_freq_A if parseargs.jitter_freq_A is not None else parseargs.jitter_freq),
|
||||
"jitter_freq_B": (parseargs.jitter_freq_B if parseargs.jitter_freq_B is not None else parseargs.jitter_freq),
|
||||
"drop": (parseargs.drop),
|
||||
"drop_A": (parseargs.drop_A if parseargs.drop_A is not None else parseargs.drop),
|
||||
"drop_B": (parseargs.drop_B if parseargs.drop_B is not None else parseargs.drop),
|
||||
}
|
||||
ltw=LANtoWAN(args)
|
||||
ltw = LANtoWAN(args)
|
||||
ltw.create_wanlinks()
|
||||
ltw.cleanup()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user