diff --git a/py-json/LANforge/lfcli_base.py b/py-json/LANforge/lfcli_base.py index 6ba3eea8..d2313e3c 100644 --- a/py-json/LANforge/lfcli_base.py +++ b/py-json/LANforge/lfcli_base.py @@ -437,19 +437,20 @@ class LFCliBase: description=description) else: parser = argparse.ArgumentParser() - - parser.add_argument('--mgr', help='hostname for where LANforge GUI is running', default='localhost') - parser.add_argument('--mgr_port', help='port LANforge GUI HTTP service is running on', default=8080) - parser.add_argument('-u', '--upstream_port', + optional = parser.add_argument_group('optional arguments') + required = parser.add_argument_group('required arguments') + optional.add_argument('--mgr', help='hostname for where LANforge GUI is running', default='localhost') + optional.add_argument('--mgr_port', help='port LANforge GUI HTTP service is running on', default=8080) + optional.add_argument('-u', '--upstream_port', help='non-station port that generates traffic: ., e.g: 1.eth1', default='1.eth1') - parser.add_argument('--radio', help='radio EID, e.g: 1.wiphy2', default=None) - parser.add_argument('--security', help='WiFi Security protocol: ', default=None) - parser.add_argument('--ssid', help='SSID for stations to associate to', default=None) - parser.add_argument('--passwd', help='WiFi passphrase', default=None) - parser.add_argument('--num_stations', help='Number of stations to create', default=0) - parser.add_argument('--test_id', help='Test ID (intended to use for ws events)', default="webconsole") - parser.add_argument('--debug', help='Enable debugging', default=False, action="store_true") + required.add_argument('--radio', help='radio EID, e.g: 1.wiphy2', required=True) + required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True) + required.add_argument('--ssid', help='SSID for stations to associate to', required=True) + required.add_argument('--passwd', '--password' ,'--key', help='WiFi passphrase/password/key', required=True) + optional.add_argument('--num_stations', help='Number of stations to create', default=0) + optional.add_argument('--test_id', help='Test ID (intended to use for ws events)', default="webconsole") + optional.add_argument('--debug', help='Enable debugging', default=False, action="store_true") return parser diff --git a/py-scripts/test_ipv4_connection.py b/py-scripts/test_ipv4_connection.py index b54b643f..6ff39be7 100755 --- a/py-scripts/test_ipv4_connection.py +++ b/py-scripts/test_ipv4_connection.py @@ -24,8 +24,8 @@ class IPv4Test(LFCliBase): ssid, security, password, - host="localhost", - port=8080, + host, + port, sta_list=None, number_template="00000", radio="wiphy0", @@ -138,20 +138,19 @@ def main(): test_ipv4_connection.py -------------------- Generic command example: -./test_ipv4_connection.py --upstream_port eth1 \\ - --radio wiphy0 \\ - --num_stations 3 \\ - --security open {open|wep|wpa|wpa2|wpa3} \\ - --ssid netgear \\ - --passwd BLANK \\ +./test_ipv4_connection.py + --upstream_port eth1 + --radio wiphy0 + --num_stations 3 + --security open + --ssid netgear + --passwd BLANK --debug ''') args = parser.parse_args() if (args.radio is None): raise ValueError("--radio required") - lfjson_host = args.mgr - lfjson_port = args.mgr_port num_sta = 2 if (args.num_stations is not None) and (int(args.num_stations) > 0):