mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	updated args and example
This commit is contained in:
		| @@ -3,7 +3,8 @@ | ||||
| # OPTION ONE: ./test_all_scripts.sh : this command runs all the scripts in the array "testCommands" | ||||
| # OPTION TWO: ./test_all_scripts.sh 4 5 :  this command runs py-script commands (in testCommands array) that include the py-script options beginning with 4 and 5 (inclusive) in case function ret_case_num. | ||||
| #Variables | ||||
| NUM_STA=4 | ||||
| NUM_STA=5 | ||||
| #ssid defaults to WPA2 security, ssid, and ssid key | ||||
| SSID_USED="jedway-wpa2-x2048-5-3" | ||||
| PASSWD_USED="jedway-wpa2-x2048-5-3" | ||||
| RADIO_USED="wiphy1" | ||||
| @@ -26,6 +27,7 @@ testCommands=("./example_security_connection.py --num_stations $NUM_STA --ssid j | ||||
|     "./test_ipv4_l4_wifi.py --upstream_port eth1 --radio wiphy0 --num_stations $NUM_STA --security $SECURITY --ssid jedway-wpa2-x2048-4-4 --passwd jedway-wpa2-x2048-4-4  --test_duration 3m" | ||||
|     "./test_ipv4_l4.py --radio wiphy3 --num_stations 4 --security wpa2 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1  --url \"dl http://10.40.0.1 /dev/null\"  --test_duration 2m --debug" | ||||
|     "./test_ipv4_variable_time.py --radio wiphy1 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --security wpa2 --mode 4 --ap 00:0e:8e:ff:86:e6 --test_duration 30s" | ||||
|     "./test_ipv4_l4_ftp_urls_per_ten.py --radio wiphy0 --ssid jedway-wpa2-x2048-4-1 --passwd jedway-wpa2-x2048-4-1 --security wpa2 --test_duration 30s  --url \"ul ftp://lanforge:lanforge@10.40.0.1/example.txt  /home/lanforge/example.txt\"" | ||||
| ) | ||||
| declare -A name_to_num | ||||
| name_to_num=( | ||||
|   | ||||
| @@ -175,15 +175,25 @@ python3 ./test_ipv4_l4_urls_per_ten.py | ||||
|     --test_duration 2m | ||||
|     --debug | ||||
|             ''') | ||||
|     required = parser.add_argument_group('required arguments') | ||||
|     optional = parser.add_argument_group('optional arguments') | ||||
|     parser.add_argument('--requests_per_ten', help='--requests_per_ten number of request per ten minutes', default=600) | ||||
|     parser.add_argument('--num_tests', help='--num_tests number of tests to run. Each test runs 10 minutes', default=1) | ||||
|     parser.add_argument('--url', help='--url specifies upload/download, address, and dest',default="dl http://10.40.0.1 /dev/null") | ||||
|     parser.add_argument('--test_duration', help='duration of test',default="2m") | ||||
|     parser.add_argument('--target_per_ten', help='--target_per_ten target number of request per ten minutes. test will check for 90 percent this value',default=600) | ||||
|     optional.add_argument('--mode',help='Used to force mode of stations') | ||||
|     optional.add_argument('--ap',help='Used to force a connection to a particular AP') | ||||
|     required = None | ||||
|     for agroup in parser._action_groups: | ||||
|         if agroup.title == "required arguments": | ||||
|             required = agroup | ||||
|     #if required is not None: | ||||
|  | ||||
|     optional = None | ||||
|     for agroup in parser._action_groups: | ||||
|         if agroup.title == "optional arguments": | ||||
|             optional = agroup | ||||
|  | ||||
|     if optional is not None: | ||||
|         optional.add_argument('--requests_per_ten', help='--requests_per_ten number of request per ten minutes', default=600) | ||||
|         optional.add_argument('--num_tests', help='--num_tests number of tests to run. Each test runs 10 minutes', default=1) | ||||
|         optional.add_argument('--url', help='--url specifies upload/download, address, and dest',default="dl http://10.40.0.1 /dev/null") | ||||
|         optional.add_argument('--test_duration', help='duration of test',default="2m") | ||||
|         optional.add_argument('--target_per_ten', help='--target_per_ten target number of request per ten minutes. test will check for 90 percent this value',default=600) | ||||
|         optional.add_argument('--mode',help='Used to force mode of stations') | ||||
|         optional.add_argument('--ap',help='Used to force a connection to a particular AP') | ||||
|     args = parser.parse_args() | ||||
|  | ||||
|     num_sta = 2 | ||||
|   | ||||
| @@ -19,7 +19,8 @@ import datetime | ||||
|  | ||||
|  | ||||
| class IPV4VariableTime(LFCliBase): | ||||
|     def __init__(self, host, port, ssid, security, password, sta_list, name_prefix, upstream, radio, | ||||
|     def __init__(self, ssid, security, password, sta_list, name_prefix, upstream, radio, | ||||
|                 host="localhost", port=8080, | ||||
|                  side_a_min_rate=56, side_a_max_rate=0, | ||||
|                  side_b_min_rate=56, side_b_max_rate=0, | ||||
|                  number_template="00000", test_duration="5m", use_ht160=False, | ||||
| @@ -169,7 +170,6 @@ class IPV4VariableTime(LFCliBase): | ||||
|  | ||||
|  | ||||
| def main(): | ||||
|     lfjson_port = 8080 | ||||
|  | ||||
|     parser = LFCliBase.create_basic_argparse( | ||||
|         prog='test_ipv4_variable_time.py', | ||||
| @@ -192,11 +192,20 @@ Generic command layout: | ||||
| --test_duration 2m | ||||
| --debug | ||||
|         ''') | ||||
|     required = parser.add_argument_group('required arguments') | ||||
|     required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True) | ||||
|     parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) | ||||
|     parser.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) | ||||
|     parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") | ||||
|     required = None | ||||
|     for agroup in parser._action_groups: | ||||
|         if agroup.title == "required arguments": | ||||
|             required = agroup | ||||
|     #if required is not None: | ||||
|  | ||||
|     optional = None | ||||
|     for agroup in parser._action_groups: | ||||
|         if agroup.title == "optional arguments": | ||||
|             optional = agroup | ||||
|     if optional is not None:  | ||||
|         optional.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) | ||||
|         optional.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) | ||||
|         optional.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") | ||||
|  | ||||
|     args = parser.parse_args() | ||||
|     num_sta = 2 | ||||
|   | ||||
| @@ -20,7 +20,7 @@ import pprint | ||||
|  | ||||
|  | ||||
| class TTLSTest(LFCliBase): | ||||
|     def __init__(self, host, port, | ||||
|     def __init__(self, host="localhost", port=8080, | ||||
|                  ssid="[BLANK]", | ||||
|                  security="wpa2", | ||||
|                  password="[BLANK]", | ||||
| @@ -203,10 +203,12 @@ class TTLSTest(LFCliBase): | ||||
|         if (len(sta_list) == len(ip_map)) and (len(sta_list) == len(associated_map)): | ||||
|             self._pass("PASS: All stations associated with IP", print_pass) | ||||
|         else: | ||||
|              | ||||
|             self._fail("FAIL: Not all stations able to associate/get IP", print_fail) | ||||
|             print("sta_list", sta_list) | ||||
|             print("ip_map", ip_map) | ||||
|             print("associated_map", associated_map) | ||||
|             if self.debug: | ||||
|                 print("sta_list", sta_list) | ||||
|                 print("ip_map", ip_map) | ||||
|                 print("associated_map", associated_map) | ||||
|  | ||||
|         # notice that this does not actually generate traffic | ||||
|         # please see test_ipv4_variable_time for example of generating traffic | ||||
| @@ -225,8 +227,6 @@ class TTLSTest(LFCliBase): | ||||
|                                            debug=self.debug) | ||||
|  | ||||
| def main(): | ||||
|     lfjson_host = "localhost" | ||||
|     lfjson_port = 8080 | ||||
|  | ||||
|     parser = LFCliBase.create_basic_argparse( | ||||
|         prog='test_ipv4_ttls.py', | ||||
| @@ -238,31 +238,43 @@ def main(): | ||||
| test_ipv4_ttls.py: | ||||
|  -------------------- | ||||
|  Generic command layout: | ||||
|  python ./test_ipv4_ttls.py --upstream_port <port> | ||||
|     --radio <radio 0> | ||||
|  python ./test_ipv4_ttls.py | ||||
|      | ||||
|     --upstream_port eth1 | ||||
|     --radio wiphy0  | ||||
|     --num_stations 3 | ||||
|     --ssid ssid-wpa-1 | ||||
|     --keyphrase ssid-wpa-1 | ||||
|     --security <security type: wpa2, open, wpa3> | ||||
|     --key ssid-wpa-1 | ||||
|     --security <security type: wpa2, open, wpa, wpa3> | ||||
|     --debug | ||||
|  | ||||
| ''') | ||||
|     required = parser.add_argument_group('required arguments') | ||||
|     required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True) | ||||
|     parser.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) | ||||
|     parser.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) | ||||
|     parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") | ||||
|     parser.add_argument('--key-mgmt', help="--key-mgt: { %s }"%", ".join(realm.wpa_ent_list()), default="WPA-EAP") | ||||
|     parser.add_argument('--wpa_psk', help='wpa-ent pre shared key', default="[BLANK]") | ||||
|     parser.add_argument('--eap', help='--eap eap method to use', default="TTLS") | ||||
|     parser.add_argument('--identity', help='--identity eap identity string', default="testuser") | ||||
|     parser.add_argument('--ttls_passwd', help='--ttls_passwd eap password string', default="testpasswd") | ||||
|     parser.add_argument('--ttls_realm', help='--ttls_realm 802.11u home realm to use', default="localhost.localdomain") | ||||
|     parser.add_argument('--domain', help='--domain 802.11 domain to use', default="localhost.localdomain") | ||||
|     parser.add_argument('--hessid', help='--hessid 802.11u HESSID (MAC addr format/peer for WDS)', default="00:00:00:00:00:01") | ||||
|     parser.add_argument('--ieee80211w', help='--ieee80211w <disabled(0),optional(1),required(2)', default='1') | ||||
|     parser.add_argument('--use_hs20', help='use HotSpot 2.0', default=False) | ||||
|     parser.add_argument('--enable_pkc', help='enable opportunistic PMKSA WPA2 key caching', default=False) | ||||
|     required = None | ||||
|     for agroup in parser._action_groups: | ||||
|         if agroup.title == "required arguments": | ||||
|             required = agroup | ||||
|     #if required is not None: | ||||
|  | ||||
|     optional = None | ||||
|     for agroup in parser._action_groups: | ||||
|         if agroup.title == "optional arguments": | ||||
|             optional = agroup | ||||
|      | ||||
|     if optional is not None: | ||||
|         optional.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000) | ||||
|         optional.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000) | ||||
|         optional.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="5m") | ||||
|         optional.add_argument('--key-mgmt', help="--key-mgt: { %s }"%", ".join(realm.wpa_ent_list()), default="WPA-EAP") | ||||
|         optional.add_argument('--wpa_psk', help='wpa-ent pre shared key', default="[BLANK]") | ||||
|         optional.add_argument('--eap', help='--eap eap method to use', default="TTLS") | ||||
|         optional.add_argument('--identity', help='--identity eap identity string', default="testuser") | ||||
|         optional.add_argument('--ttls_passwd', help='--ttls_passwd eap password string', default="testpasswd") | ||||
|         optional.add_argument('--ttls_realm', help='--ttls_realm 802.11u home realm to use', default="localhost.localdomain") | ||||
|         optional.add_argument('--domain', help='--domain 802.11 domain to use', default="localhost.localdomain") | ||||
|         optional.add_argument('--hessid', help='--hessid 802.11u HESSID (MAC addr format/peer for WDS)', default="00:00:00:00:00:01") | ||||
|         optional.add_argument('--ieee80211w', help='--ieee80211w <disabled(0),optional(1),required(2)', default='1') | ||||
|         optional.add_argument('--use_hs20', help='use HotSpot 2.0', default=False) | ||||
|         optional.add_argument('--enable_pkc', help='enable opportunistic PMKSA WPA2 key caching', default=False) | ||||
|     args = parser.parse_args() | ||||
|     num_sta = 2 | ||||
|     if (args.num_stations is not None) and (int(args.num_stations) > 0): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dipti
					Dipti