updated args and example

This commit is contained in:
Dipti
2020-12-28 15:25:51 -08:00
parent 5b161d8619
commit 60b7c0d9dd
4 changed files with 76 additions and 43 deletions

View File

@@ -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):