mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	arg switches pt 1
This commit is contained in:
		| @@ -17,7 +17,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, number_template="00000",  host="localhost", port=8080,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) | ||||
| @@ -66,8 +66,6 @@ class IPv4Test(LFCliBase): | ||||
|                                            debug=self.debug) | ||||
|  | ||||
| def main(): | ||||
|     lfjson_host = "localhost" | ||||
|     lfjson_port = 8080 | ||||
|  | ||||
|     parser = LFCliBase.create_basic_argparse( | ||||
|         prog='example_security_connection.py', | ||||
| @@ -84,17 +82,20 @@ def main(): | ||||
|         -------------------- | ||||
|  | ||||
|         Generic command example: | ||||
|     python3 ./example_security_connection.py  \\ | ||||
|         --host localhost (optional) \\ | ||||
|         --port 8080  (optional) \\ | ||||
|         --num_stations 6 \\ | ||||
|     python3 ./example_security_connection.py   | ||||
|         --mgr localhost  | ||||
|         --mgr_port 8080   | ||||
|         --num_stations 6  | ||||
|         --radio wiphy2 | ||||
|         --security {open|wep|wpa|wpa2|wpa3} \\ | ||||
|         --ssid netgear-wpa3 \\ | ||||
|         --passwd admin123-wpa3 \\ | ||||
|         --security {open|wep|wpa|wpa2|wpa3}  | ||||
|         --ssid netgear-wpa3  | ||||
|         --passwd admin123-wpa3  | ||||
|         --debug  | ||||
|  | ||||
|             ''') | ||||
|     optional = parser.add_argument_group('optional arguments') | ||||
|     required = parser.add_argument_group('required arguments') | ||||
|     required.add_argument('--security',       help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True) | ||||
|  | ||||
|     args = parser.parse_args() | ||||
|     num_sta = 2 | ||||
| @@ -107,7 +108,7 @@ def main(): | ||||
|                                         end_id_=num_sta-1, | ||||
|                                         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=args.security, sta_list=station_list) | ||||
|     ip_test.cleanup(station_list) | ||||
|     ip_test.timeout = 60 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dipti
					Dipti