mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 19:28:00 +00:00
arg switches pt 1
This commit is contained in:
@@ -18,7 +18,7 @@ import pprint
|
||||
|
||||
|
||||
class IPv4Test(LFCliBase):
|
||||
def __init__(self, host, port, ssid, security, password, sta_list=None, number_template="00000", radio ="wiphy0", _debug_on=False,
|
||||
def __init__(self, ssid, security, password, sta_list=None, host="locahost", port=8080, number_template="00000", radio ="wiphy0", _debug_on=False,
|
||||
_exit_on_error=False,
|
||||
_exit_on_fail=False):
|
||||
super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail)
|
||||
@@ -69,9 +69,6 @@ class IPv4Test(LFCliBase):
|
||||
|
||||
|
||||
def main():
|
||||
lfjson_host = "localhost"
|
||||
lfjson_port = 8080
|
||||
|
||||
parser = LFCliBase.create_basic_argparse(
|
||||
prog='example_wpa_connection.py',
|
||||
# formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
@@ -85,19 +82,16 @@ def main():
|
||||
--------------------
|
||||
|
||||
Generic command example:
|
||||
python3 ./example_wpa_connection.py \\
|
||||
--host localhost (optional) \\
|
||||
--port 8080 (optional) \\
|
||||
--num_stations 3 \\
|
||||
--ssid netgear-wpa \\
|
||||
--passwd admin123-wpa \\
|
||||
python3 ./example_wpa_connection.py
|
||||
--host localhost
|
||||
--port 8080
|
||||
--num_stations 3
|
||||
--ssid netgear-wpa
|
||||
--passwd admin123-wpa
|
||||
--radio wiphy1
|
||||
--debug
|
||||
''')
|
||||
|
||||
parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m")
|
||||
parser.add_argument('--url', help='--url specifies upload/download, address, and dest', default="dl http://10.40.0.1 /dev/null")
|
||||
|
||||
args = parser.parse_args()
|
||||
num_sta = 2
|
||||
if (args.num_stations is not None) and (int(args.num_stations) > 0):
|
||||
@@ -110,7 +104,7 @@ def main():
|
||||
padding_number_=10000,
|
||||
radio=args.radio)
|
||||
|
||||
ip_test = IPv4Test(lfjson_host, lfjson_port, ssid=args.ssid, password=args.passwd, radio=args.radio,
|
||||
ip_test = IPv4Test(host=args.mgr, port=args.mgr_port, ssid=args.ssid, password=args.passwd, radio=args.radio,
|
||||
security="wpa", sta_list=station_list)
|
||||
ip_test.cleanup(station_list)
|
||||
ip_test.timeout = 60
|
||||
|
||||
Reference in New Issue
Block a user