mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
tests: Use hapd from hostapd.add_ap()
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
parent
4063590525
commit
6f334bf7a0
@ -19,13 +19,12 @@ def test_ap_change_ssid(dev, apdev):
|
||||
"""Dynamic SSID change with hostapd and WPA2-PSK"""
|
||||
params = hostapd.wpa2_params(ssid="test-wpa2-psk-start",
|
||||
passphrase="12345678")
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
id = dev[0].connect("test-wpa2-psk-start", psk="12345678",
|
||||
scan_freq="2412")
|
||||
dev[0].request("DISCONNECT")
|
||||
|
||||
logger.info("Change SSID dynamically")
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
res = hapd.request("SET ssid test-wpa2-psk-new")
|
||||
if "OK" not in res:
|
||||
raise Exception("SET command failed")
|
||||
|
@ -2873,8 +2873,7 @@ def test_ap_wpa2_eap_interactive(dev, apdev):
|
||||
"""WPA2-Enterprise connection using interactive identity/password entry"""
|
||||
check_eap_capa(dev[0], "MSCHAPV2")
|
||||
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
tests = [ ("Connection with dynamic TTLS/MSCHAPv2 password entry",
|
||||
"TTLS", "ttls", "DOMAIN\mschapv2 user", "auth=MSCHAPV2",
|
||||
@ -2915,8 +2914,7 @@ def test_ap_wpa2_eap_ext_enable_network_while_connected(dev, apdev):
|
||||
"""WPA2-Enterprise interactive identity entry and ENABLE_NETWORK"""
|
||||
check_eap_capa(dev[0], "MSCHAPV2")
|
||||
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
id_other = dev[0].connect("other", key_mgmt="NONE", scan_freq="2412",
|
||||
only_add_network=True)
|
||||
|
@ -1040,8 +1040,7 @@ def test_ap_hs20_gas_frag_while_associated(dev, apdev):
|
||||
bssid = apdev[0]['bssid']
|
||||
params = hs20_ap_params()
|
||||
params['hessid'] = bssid
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
hapd.set("gas_frag_limit", "50")
|
||||
|
||||
dev[0].hs20_enable()
|
||||
|
@ -38,7 +38,6 @@ def test_ap_pmf_required(dev, apdev):
|
||||
key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2",
|
||||
scan_freq="2412")
|
||||
hwsim_utils.test_connectivity(dev[1], hapd)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd.request("SA_QUERY " + dev[0].p2p_interface_addr())
|
||||
hapd.request("SA_QUERY " + dev[1].p2p_interface_addr())
|
||||
wt.require_ap_pmf_mandatory(apdev[0]['bssid'])
|
||||
|
@ -41,9 +41,8 @@ def wps_start_ap(apdev, ssid="test-wps-conf"):
|
||||
def test_ap_wps_init(dev, apdev):
|
||||
"""Initial AP configuration with first WPS Enrollee"""
|
||||
ssid = "test-wps"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
logger.info("WPS provisioning step")
|
||||
hapd.request("WPS_PBC")
|
||||
if "PBC Status: Active" not in hapd.request("WPS_GET_STATUS"):
|
||||
@ -98,9 +97,8 @@ def test_ap_wps_init_2ap_pbc(dev, apdev):
|
||||
"""Initial two-radio AP configuration with first WPS PBC Enrollee"""
|
||||
ssid = "test-wps"
|
||||
params = { "ssid": ssid, "eap_server": "1", "wps_state": "1" }
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
hostapd.add_ap(apdev[1], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
logger.info("WPS provisioning step")
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412", force_scan=True)
|
||||
@ -135,9 +133,8 @@ def test_ap_wps_init_2ap_pin(dev, apdev):
|
||||
"""Initial two-radio AP configuration with first WPS PIN Enrollee"""
|
||||
ssid = "test-wps"
|
||||
params = { "ssid": ssid, "eap_server": "1", "wps_state": "1" }
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
hostapd.add_ap(apdev[1], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
logger.info("WPS provisioning step")
|
||||
pin = dev[0].wps_read_pin()
|
||||
hapd.request("WPS_PIN any " + pin)
|
||||
@ -165,9 +162,8 @@ def test_ap_wps_init_2ap_pin(dev, apdev):
|
||||
def test_ap_wps_init_through_wps_config(dev, apdev):
|
||||
"""Initial AP configuration using wps_config command"""
|
||||
ssid = "test-wps-init-config"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
if "FAIL" in hapd.request("WPS_CONFIG " + ssid.encode("hex") + " WPA2PSK CCMP " + "12345678".encode("hex")):
|
||||
raise Exception("WPS_CONFIG command failed")
|
||||
ev = hapd.wait_event(["WPS-NEW-AP-SETTINGS"], timeout=5)
|
||||
@ -184,10 +180,9 @@ def test_ap_wps_init_through_wps_config(dev, apdev):
|
||||
def test_ap_wps_init_through_wps_config_2(dev, apdev):
|
||||
"""AP configuration using wps_config and wps_cred_processing=2"""
|
||||
ssid = "test-wps-init-config"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1",
|
||||
"wps_cred_processing": "2" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1",
|
||||
"wps_cred_processing": "2" })
|
||||
if "FAIL" in hapd.request("WPS_CONFIG " + ssid.encode("hex") + " WPA2PSK CCMP " + "12345678".encode("hex")):
|
||||
raise Exception("WPS_CONFIG command failed")
|
||||
ev = hapd.wait_event(["WPS-NEW-AP-SETTINGS"], timeout=5)
|
||||
@ -199,20 +194,18 @@ def test_ap_wps_init_through_wps_config_2(dev, apdev):
|
||||
def test_ap_wps_invalid_wps_config_passphrase(dev, apdev):
|
||||
"""AP configuration using wps_config command with invalid passphrase"""
|
||||
ssid = "test-wps-init-config"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
if "FAIL" not in hapd.request("WPS_CONFIG " + ssid.encode("hex") + " WPA2PSK CCMP " + "1234567".encode("hex")):
|
||||
raise Exception("Invalid WPS_CONFIG command accepted")
|
||||
|
||||
def test_ap_wps_conf(dev, apdev):
|
||||
"""WPS PBC provisioning with configured AP"""
|
||||
ssid = "test-wps-conf"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
logger.info("WPS provisioning step")
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
|
||||
@ -317,11 +310,10 @@ def test_ap_wps_twice(dev, apdev):
|
||||
def test_ap_wps_incorrect_pin(dev, apdev):
|
||||
"""WPS PIN provisioning with incorrect PIN"""
|
||||
ssid = "test-wps-incorrect-pin"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
|
||||
logger.info("WPS provisioning attempt 1")
|
||||
hapd.request("WPS_PIN any 12345670")
|
||||
@ -360,11 +352,10 @@ def test_ap_wps_incorrect_pin(dev, apdev):
|
||||
def test_ap_wps_conf_pin(dev, apdev):
|
||||
"""WPS PIN provisioning with configured AP"""
|
||||
ssid = "test-wps-conf-pin"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
logger.info("WPS provisioning step")
|
||||
pin = dev[0].wps_read_pin()
|
||||
hapd.request("WPS_PIN any " + pin)
|
||||
@ -399,12 +390,11 @@ def test_ap_wps_conf_pin(dev, apdev):
|
||||
def test_ap_wps_conf_pin_mixed_mode(dev, apdev):
|
||||
"""WPS PIN provisioning with configured AP (WPA+WPA2)"""
|
||||
ssid = "test-wps-conf-pin-mixed"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "3",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wpa_pairwise": "TKIP" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "3",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wpa_pairwise": "TKIP" })
|
||||
|
||||
logger.info("WPS provisioning step")
|
||||
pin = dev[0].wps_read_pin()
|
||||
@ -457,11 +447,10 @@ def test_ap_wps_conf_pin_mixed_mode(dev, apdev):
|
||||
def test_ap_wps_conf_pin_v1(dev, apdev):
|
||||
"""WPS PIN provisioning with configured WPS v1.0 AP"""
|
||||
ssid = "test-wps-conf-pin-v1"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
logger.info("WPS provisioning step")
|
||||
pin = dev[0].wps_read_pin()
|
||||
hapd.request("SET wps_version_number 0x10")
|
||||
@ -483,11 +472,10 @@ def test_ap_wps_conf_pin_v1(dev, apdev):
|
||||
def test_ap_wps_conf_pin_2sta(dev, apdev):
|
||||
"""Two stations trying to use WPS PIN at the same time"""
|
||||
ssid = "test-wps-conf-pin2"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
logger.info("WPS provisioning step")
|
||||
pin = "12345670"
|
||||
pin2 = "55554444"
|
||||
@ -505,11 +493,10 @@ def test_ap_wps_conf_pin_2sta(dev, apdev):
|
||||
def test_ap_wps_conf_pin_timeout(dev, apdev):
|
||||
"""WPS PIN provisioning with configured AP timing out PIN"""
|
||||
ssid = "test-wps-conf-pin"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
addr = dev[0].p2p_interface_addr()
|
||||
pin = dev[0].wps_read_pin()
|
||||
if "FAIL" not in hapd.request("WPS_PIN "):
|
||||
@ -620,17 +607,16 @@ def test_ap_wps_random_ap_pin(dev, apdev):
|
||||
"""WPS registrar using random AP PIN"""
|
||||
ssid = "test-wps-reg-random-ap-pin"
|
||||
ap_uuid = "27ea801a-9e5c-4e73-bd82-f89cbcd10d7e"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"device_name": "Wireless AP", "manufacturer": "Company",
|
||||
"model_name": "WAP", "model_number": "123",
|
||||
"serial_number": "12345", "device_type": "6-0050F204-1",
|
||||
"os_version": "01020300",
|
||||
"config_methods": "label push_button",
|
||||
"uuid": ap_uuid, "upnp_iface": "lo" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
params = { "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"device_name": "Wireless AP", "manufacturer": "Company",
|
||||
"model_name": "WAP", "model_number": "123",
|
||||
"serial_number": "12345", "device_type": "6-0050F204-1",
|
||||
"os_version": "01020300",
|
||||
"config_methods": "label push_button",
|
||||
"uuid": ap_uuid, "upnp_iface": "lo" }
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
appin = hapd.request("WPS_AP_PIN random")
|
||||
if "FAIL" in appin:
|
||||
raise Exception("Could not generate random AP PIN")
|
||||
@ -777,11 +763,11 @@ def test_ap_wps_setup_locked(dev, apdev):
|
||||
"""WPS registrar locking up AP setup on AP PIN failures"""
|
||||
ssid = "test-wps-incorrect-ap-pin"
|
||||
appin = "12345670"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"ap_pin": appin})
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"ap_pin": appin})
|
||||
new_ssid = "wps-new-ssid-test"
|
||||
new_passphrase = "1234567890"
|
||||
|
||||
@ -814,7 +800,6 @@ def test_ap_wps_setup_locked(dev, apdev):
|
||||
logger.info("BSS: " + str(bss))
|
||||
raise Exception("AP Setup Locked not indicated in scan results")
|
||||
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
status = hapd.request("WPS_GET_STATUS")
|
||||
if "Last WPS result: Failed" not in status:
|
||||
raise Exception("WPS failure result not shown correctly")
|
||||
@ -825,7 +810,6 @@ def test_ap_wps_setup_locked(dev, apdev):
|
||||
dev[0].dump_monitor()
|
||||
logger.info("WPS provisioning step")
|
||||
pin = dev[0].wps_read_pin()
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd.request("WPS_PIN any " + pin)
|
||||
dev[0].request("WPS_PIN %s %s" % (apdev[0]['bssid'], pin))
|
||||
ev = dev[0].wait_event(["WPS-SUCCESS"], timeout=30)
|
||||
@ -844,11 +828,11 @@ def test_ap_wps_setup_locked_timeout(dev, apdev):
|
||||
"""WPS re-enabling AP PIN after timeout"""
|
||||
ssid = "test-wps-incorrect-ap-pin"
|
||||
appin = "12345670"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"ap_pin": appin})
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"ap_pin": appin})
|
||||
new_ssid = "wps-new-ssid-test"
|
||||
new_passphrase = "1234567890"
|
||||
|
||||
@ -874,7 +858,6 @@ def test_ap_wps_setup_locked_timeout(dev, apdev):
|
||||
time.sleep(0.1)
|
||||
if not ap_setup_locked:
|
||||
raise Exception("AP setup was not locked")
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
ev = hapd.wait_event(["WPS-AP-SETUP-UNLOCKED"], timeout=80)
|
||||
if ev is None:
|
||||
raise Exception("AP PIN did not get unlocked on 60 second timeout")
|
||||
@ -919,19 +902,17 @@ def test_ap_wps_setup_locked_2(dev, apdev):
|
||||
|
||||
def test_ap_wps_pbc_overlap_2ap(dev, apdev):
|
||||
"""WPS PBC session overlap with two active APs"""
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": "wps1", "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wps_independent": "1"})
|
||||
hostapd.add_ap(apdev[1],
|
||||
{ "ssid": "wps2", "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "123456789", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wps_independent": "1"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
params = { "ssid": "wps1", "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wps_independent": "1"}
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
params = { "ssid": "wps2", "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "123456789", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wps_independent": "1"}
|
||||
hapd2 = hostapd.add_ap(apdev[1], params)
|
||||
hapd.request("WPS_PBC")
|
||||
hapd2 = hostapd.Hostapd(apdev[1]['ifname'])
|
||||
hapd2.request("WPS_PBC")
|
||||
logger.info("WPS provisioning step")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412", force_scan=True)
|
||||
@ -947,11 +928,10 @@ def test_ap_wps_pbc_overlap_2ap(dev, apdev):
|
||||
def test_ap_wps_pbc_overlap_2sta(dev, apdev):
|
||||
"""WPS PBC session overlap with two active STAs"""
|
||||
ssid = "test-wps-pbc-overlap"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
logger.info("WPS provisioning step")
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
|
||||
@ -985,12 +965,11 @@ def test_ap_wps_pbc_overlap_2sta(dev, apdev):
|
||||
def test_ap_wps_cancel(dev, apdev):
|
||||
"""WPS AP cancelling enabled config method"""
|
||||
ssid = "test-wps-ap-cancel"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
bssid = apdev[0]['bssid']
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
|
||||
logger.info("Verify PBC enable/cancel")
|
||||
hapd.request("WPS_PBC")
|
||||
@ -1908,13 +1887,12 @@ def test_ap_wps_fragmentation(dev, apdev):
|
||||
"""WPS with fragmentation in EAP-WSC and mixed mode WPA+WPA2"""
|
||||
ssid = "test-wps-fragmentation"
|
||||
appin = "12345670"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "3",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wpa_pairwise": "TKIP", "ap_pin": appin,
|
||||
"fragment_size": "50" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "3",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP",
|
||||
"wpa_pairwise": "TKIP", "ap_pin": appin,
|
||||
"fragment_size": "50" })
|
||||
logger.info("WPS provisioning step (PBC)")
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq=2412)
|
||||
@ -1960,11 +1938,10 @@ def test_ap_wps_fragmentation(dev, apdev):
|
||||
def test_ap_wps_new_version_sta(dev, apdev):
|
||||
"""WPS compatibility with new version number on the station"""
|
||||
ssid = "test-wps-ver"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
logger.info("WPS provisioning step")
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
|
||||
@ -1977,11 +1954,10 @@ def test_ap_wps_new_version_sta(dev, apdev):
|
||||
def test_ap_wps_new_version_ap(dev, apdev):
|
||||
"""WPS compatibility with new version number on the AP"""
|
||||
ssid = "test-wps-ver"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
logger.info("WPS provisioning step")
|
||||
if "FAIL" in hapd.request("SET wps_version_number 0x43"):
|
||||
raise Exception("Failed to enable test functionality")
|
||||
@ -1994,11 +1970,10 @@ def test_ap_wps_new_version_ap(dev, apdev):
|
||||
|
||||
def test_ap_wps_check_pin(dev, apdev):
|
||||
"""Verify PIN checking through control interface"""
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": "wps", "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": "wps", "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
|
||||
for t in [ ("12345670", "12345670"),
|
||||
("12345678", "FAIL-CHECKSUM"),
|
||||
("12345", "FAIL"),
|
||||
@ -2028,10 +2003,9 @@ def test_ap_wps_wep_config(dev, apdev):
|
||||
"""WPS 2.0 AP rejecting WEP configuration"""
|
||||
ssid = "test-wps-config"
|
||||
appin = "12345670"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"ap_pin": appin})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"ap_pin": appin})
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq=2412)
|
||||
dev[0].wps_reg(apdev[0]['bssid'], appin, "wps-new-ssid-wep", "OPEN", "WEP",
|
||||
"hello", no_wait=True)
|
||||
@ -2051,10 +2025,9 @@ def test_ap_wps_wep_config(dev, apdev):
|
||||
def test_ap_wps_wep_enroll(dev, apdev):
|
||||
"""WPS 2.0 STA rejecting WEP configuration"""
|
||||
ssid = "test-wps-wep"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"skip_cred_build": "1", "extra_cred": "wps-wep-cred" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
params = { "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"skip_cred_build": "1", "extra_cred": "wps-wep-cred" }
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq=2412)
|
||||
dev[0].request("WPS_PBC " + apdev[0]['bssid'])
|
||||
@ -2075,8 +2048,7 @@ def test_ap_wps_ie_fragmentation(dev, apdev):
|
||||
"model_name": "1234567890abcdef1234567890abcdef",
|
||||
"model_number": "1234567890abcdef1234567890abcdef",
|
||||
"serial_number": "1234567890abcdef1234567890abcdef" }
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
|
||||
dev[0].request("WPS_PBC " + apdev[0]['bssid'])
|
||||
@ -2237,12 +2209,11 @@ def test_ap_wps_pin_request_file(dev, apdev):
|
||||
pinfile = "/tmp/ap_wps_pin_request_file.log"
|
||||
if os.path.exists(pinfile):
|
||||
os.remove(pinfile)
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wps_pin_requests": pinfile,
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wps_pin_requests": pinfile,
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
uuid = dev[0].get_status_field("uuid")
|
||||
pin = dev[0].wps_read_pin()
|
||||
try:
|
||||
@ -3432,8 +3403,7 @@ def test_ap_wps_upnp_http_proto_chunked(dev, apdev):
|
||||
def test_ap_wps_disabled(dev, apdev):
|
||||
"""WPS operations while WPS is disabled"""
|
||||
ssid = "test-wps-disabled"
|
||||
hostapd.add_ap(apdev[0], { "ssid": ssid })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], { "ssid": ssid })
|
||||
if "FAIL" not in hapd.request("WPS_PBC"):
|
||||
raise Exception("WPS_PBC succeeded unexpectedly")
|
||||
if "FAIL" not in hapd.request("WPS_CANCEL"):
|
||||
@ -3442,10 +3412,9 @@ def test_ap_wps_disabled(dev, apdev):
|
||||
def test_ap_wps_mixed_cred(dev, apdev):
|
||||
"""WPS 2.0 STA merging mixed mode WPA/WPA2 credentials"""
|
||||
ssid = "test-wps-wep"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"skip_cred_build": "1", "extra_cred": "wps-mixed-cred" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
params = { "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"skip_cred_build": "1", "extra_cred": "wps-mixed-cred" }
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
hapd.request("WPS_PBC")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
|
||||
dev[0].request("WPS_PBC " + apdev[0]['bssid'])
|
||||
@ -3466,11 +3435,10 @@ def test_ap_wps_mixed_cred(dev, apdev):
|
||||
def test_ap_wps_while_connected(dev, apdev):
|
||||
"""WPS PBC provisioning while connected to another AP"""
|
||||
ssid = "test-wps-conf"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
|
||||
hostapd.add_ap(apdev[1], { "ssid": "open" })
|
||||
dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
|
||||
@ -3487,11 +3455,10 @@ def test_ap_wps_while_connected(dev, apdev):
|
||||
def test_ap_wps_while_connected_no_autoconnect(dev, apdev):
|
||||
"""WPS PBC provisioning while connected to another AP and STA_AUTOCONNECT disabled"""
|
||||
ssid = "test-wps-conf"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
|
||||
hostapd.add_ap(apdev[1], { "ssid": "open" })
|
||||
|
||||
@ -3568,9 +3535,8 @@ def test_ap_wps_ap_scan_2(dev, apdev):
|
||||
def test_ap_wps_eapol_workaround(dev, apdev):
|
||||
"""EAPOL workaround code path for 802.1X header length mismatch"""
|
||||
ssid = "test-wps"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
bssid = apdev[0]['bssid']
|
||||
hapd.request("SET ext_eapol_frame_io 1")
|
||||
dev[0].request("SET ext_eapol_frame_io 1")
|
||||
@ -3675,11 +3641,10 @@ def test_ap_wps_iteration_error(dev, apdev):
|
||||
def test_ap_wps_priority(dev, apdev):
|
||||
"""WPS PIN provisioning with configured AP and wps_priority"""
|
||||
ssid = "test-wps-conf-pin"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
logger.info("WPS provisioning step")
|
||||
pin = dev[0].wps_read_pin()
|
||||
hapd.request("WPS_PIN any " + pin)
|
||||
@ -3828,11 +3793,10 @@ def test_ap_wps_wpa_cli_action(dev, apdev, test_params):
|
||||
stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
|
||||
|
||||
ssid = "test-wps-conf"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "2",
|
||||
"wpa_passphrase": "12345678", "wpa": "2",
|
||||
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"})
|
||||
|
||||
prg = os.path.join(test_params['logdir'],
|
||||
'alt-wpa_supplicant/wpa_supplicant/wpa_cli')
|
||||
|
@ -52,8 +52,7 @@ def hs20_ap_params():
|
||||
def start_ap(ap):
|
||||
params = hs20_ap_params()
|
||||
params['hessid'] = ap['bssid']
|
||||
hostapd.add_ap(ap, params)
|
||||
return hostapd.Hostapd(ap['ifname'])
|
||||
return hostapd.add_ap(ap, params)
|
||||
|
||||
def get_gas_response(dev, bssid, info, allow_fetch_failure=False,
|
||||
extra_test=False):
|
||||
|
@ -38,8 +38,7 @@ def test_nfc_wps_password_token_sta(dev, apdev):
|
||||
"""NFC tag with password token on the station/Enrollee"""
|
||||
ssid = "test-wps-nfc-pw-token-conf"
|
||||
params = ap_wps_params(ssid)
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
logger.info("WPS provisioning step using password token from station")
|
||||
wps = dev[0].request("WPS_NFC_TOKEN WPS").rstrip()
|
||||
if "FAIL" in wps:
|
||||
@ -61,8 +60,7 @@ def test_nfc_wps_config_token(dev, apdev):
|
||||
"""NFC tag with configuration token from AP"""
|
||||
ssid = "test-wps-nfc-conf-token"
|
||||
params = ap_wps_params(ssid)
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
logger.info("NFC configuration token from AP to station")
|
||||
conf = hapd.request("WPS_NFC_CONFIG_TOKEN NDEF").rstrip()
|
||||
if "FAIL" in conf:
|
||||
@ -82,9 +80,8 @@ def test_nfc_wps_config_token(dev, apdev):
|
||||
def test_nfc_wps_config_token_init(dev, apdev):
|
||||
"""NFC tag with configuration token from AP with auto configuration"""
|
||||
ssid = "test-wps-nfc-conf-token-init"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
logger.info("NFC configuration token from AP to station")
|
||||
conf = hapd.request("WPS_NFC_CONFIG_TOKEN NDEF").rstrip()
|
||||
if "FAIL" in conf:
|
||||
@ -99,9 +96,8 @@ def test_nfc_wps_config_token_init(dev, apdev):
|
||||
def test_nfc_wps_password_token_sta_init(dev, apdev):
|
||||
"""Initial AP configuration with first WPS NFC Enrollee"""
|
||||
ssid = "test-wps-nfc-pw-token-init"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
logger.info("WPS provisioning step using password token from station")
|
||||
pw = dev[0].request("WPS_NFC_TOKEN NDEF").rstrip()
|
||||
if "FAIL" in pw:
|
||||
@ -119,9 +115,8 @@ def test_nfc_wps_password_token_sta_init(dev, apdev):
|
||||
def test_nfc_wps_password_token_ap(dev, apdev):
|
||||
"""WPS registrar configuring an AP using AP password token"""
|
||||
ssid = "test-wps-nfc-pw-token-init"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
logger.info("WPS configuration step")
|
||||
pw = hapd.request("WPS_NFC_TOKEN NDEF").rstrip()
|
||||
if "FAIL" in pw:
|
||||
@ -162,9 +157,8 @@ def test_nfc_wps_handover_init(dev, apdev):
|
||||
def _test_nfc_wps_handover_init(dev, apdev):
|
||||
dev[0].request("SET ignore_old_scan_res 1")
|
||||
ssid = "test-wps-nfc-handover-init"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
logger.info("NFC connection handover")
|
||||
req = dev[0].request("NFC_GET_HANDOVER_REQ NDEF WPS-CR").rstrip()
|
||||
if "FAIL" in req:
|
||||
@ -189,9 +183,8 @@ def _test_nfc_wps_handover_init(dev, apdev):
|
||||
def test_nfc_wps_handover_errors(dev, apdev):
|
||||
"""WPS AP NFC handover report error cases"""
|
||||
ssid = "test-wps-nfc-handover"
|
||||
hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0],
|
||||
{ "ssid": ssid, "eap_server": "1", "wps_state": "1" })
|
||||
sel = hapd.request("NFC_GET_HANDOVER_SEL NDEF WPS-CR").rstrip()
|
||||
if "FAIL" in sel:
|
||||
raise Exception("Failed to generate NFC connection handover select")
|
||||
@ -220,8 +213,7 @@ def test_nfc_wps_handover(dev, apdev):
|
||||
"""Connect to WPS AP with NFC connection handover"""
|
||||
ssid = "test-wps-nfc-handover"
|
||||
params = ap_wps_params(ssid)
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
logger.info("NFC connection handover")
|
||||
req = dev[0].request("NFC_GET_HANDOVER_REQ NDEF WPS-CR").rstrip()
|
||||
if "FAIL" in req:
|
||||
@ -307,8 +299,7 @@ def test_nfc_wps_handover_with_pw_token_set(dev, apdev):
|
||||
"""Connect to WPS AP with NFC connection handover (wps_nfc_* set)"""
|
||||
ssid = "test-wps-nfc-handover2"
|
||||
params = ap_wps_params(ssid)
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
# enable a password token (which won't be used in this test case)
|
||||
pw = hapd.request("WPS_NFC_TOKEN NDEF").rstrip()
|
||||
if "FAIL" in pw:
|
||||
@ -339,8 +330,7 @@ def test_nfc_wps_handover_pk_hash_mismatch_sta(dev, apdev):
|
||||
if "FAIL" in dev[0].request("SET wps_corrupt_pkhash 1"):
|
||||
raise Exception("Could not enable wps_corrupt_pkhash")
|
||||
params = ap_wps_params(ssid)
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
logger.info("NFC connection handover")
|
||||
req = dev[0].request("NFC_GET_HANDOVER_REQ NDEF WPS-CR").rstrip()
|
||||
if "FAIL" in req:
|
||||
@ -365,8 +355,7 @@ def test_nfc_wps_handover_pk_hash_mismatch_ap(dev, apdev):
|
||||
"""WPS NFC connection handover with invalid pkhash from AP (negative)"""
|
||||
ssid = "wps-nfc-handover-pkhash-ap"
|
||||
params = ap_wps_params(ssid)
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
if "FAIL" in hapd.request("SET wps_corrupt_pkhash 1"):
|
||||
raise Exception("Could not enable wps_corrupt_pkhash")
|
||||
logger.info("NFC connection handover")
|
||||
|
@ -31,8 +31,7 @@ def test_radius_auth_unreachable(dev, apdev):
|
||||
"""RADIUS Authentication server unreachable"""
|
||||
params = hostapd.wpa2_eap_params(ssid="radius-auth")
|
||||
params['auth_server_port'] = "18139"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
connect(dev[0], "radius-auth", wait_connect=False)
|
||||
ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"])
|
||||
if ev is None:
|
||||
@ -53,8 +52,7 @@ def test_radius_auth_unreachable2(dev, apdev):
|
||||
params = hostapd.wpa2_eap_params(ssid="radius-auth")
|
||||
params['auth_server_addr'] = "192.168.213.17"
|
||||
params['auth_server_port'] = "18139"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
subprocess.call(['ip', 'ro', 'del', '192.168.213.17', 'dev', 'lo'])
|
||||
connect(dev[0], "radius-auth", wait_connect=False)
|
||||
ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"])
|
||||
@ -73,8 +71,7 @@ def test_radius_auth_unreachable3(dev, apdev):
|
||||
subprocess.call(['ip', 'ro', 'replace', 'blackhole', '192.168.213.18'])
|
||||
params = hostapd.wpa2_eap_params(ssid="radius-auth")
|
||||
params['auth_server_addr'] = "192.168.213.18"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
connect(dev[0], "radius-auth", wait_connect=False)
|
||||
ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"])
|
||||
if ev is None:
|
||||
@ -93,8 +90,7 @@ def test_radius_acct_unreachable(dev, apdev):
|
||||
params['acct_server_addr'] = "127.0.0.1"
|
||||
params['acct_server_port'] = "18139"
|
||||
params['acct_server_shared_secret'] = "radius"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
connect(dev[0], "radius-acct")
|
||||
logger.info("Checking for RADIUS retries")
|
||||
time.sleep(4)
|
||||
@ -113,8 +109,7 @@ def test_radius_acct_unreachable2(dev, apdev):
|
||||
params['acct_server_addr'] = "192.168.213.17"
|
||||
params['acct_server_port'] = "18139"
|
||||
params['acct_server_shared_secret'] = "radius"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
subprocess.call(['ip', 'ro', 'del', '192.168.213.17', 'dev', 'lo'])
|
||||
connect(dev[0], "radius-acct")
|
||||
logger.info("Checking for RADIUS retries")
|
||||
@ -135,8 +130,7 @@ def test_radius_acct_unreachable3(dev, apdev):
|
||||
params['acct_server_addr'] = "192.168.213.18"
|
||||
params['acct_server_port'] = "1813"
|
||||
params['acct_server_shared_secret'] = "radius"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
connect(dev[0], "radius-acct")
|
||||
subprocess.call(['ip', 'ro', 'del', 'blackhole', '192.168.213.18'])
|
||||
time.sleep(0.1)
|
||||
@ -157,8 +151,7 @@ def test_radius_acct_unreachable4(dev, apdev):
|
||||
params['acct_server_addr'] = "127.0.0.1"
|
||||
params['acct_server_port'] = "18139"
|
||||
params['acct_server_shared_secret'] = "radius"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
for i in range(20):
|
||||
connect(dev[0], "radius-acct")
|
||||
dev[0].request("REMOVE_NETWORK all")
|
||||
@ -174,8 +167,7 @@ def test_radius_acct(dev, apdev):
|
||||
params['acct_server_shared_secret'] = "radius"
|
||||
params['radius_auth_req_attr'] = [ "126:s:Operator", "77:s:testing" ]
|
||||
params['radius_acct_req_attr'] = [ "126:s:Operator", "77:s:testing" ]
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
connect(dev[0], "radius-acct")
|
||||
dev[1].connect("radius-acct", key_mgmt="WPA-EAP", scan_freq="2412",
|
||||
eap="PAX", identity="test-class",
|
||||
@ -273,8 +265,7 @@ def test_radius_acct_interim(dev, apdev):
|
||||
params['acct_server_port'] = "1813"
|
||||
params['acct_server_shared_secret'] = "radius"
|
||||
params['radius_acct_interim_interval'] = "1"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
connect(dev[0], "radius-acct")
|
||||
logger.info("Checking for RADIUS counters")
|
||||
as_mib_start = as_hapd.get_mib(param="radius_server")
|
||||
|
@ -35,8 +35,7 @@ def test_wnm_disassoc_imminent(dev, apdev):
|
||||
"time_zone": "EST5",
|
||||
"wnm_sleep_mode": "1",
|
||||
"bss_transition": "1" }
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412")
|
||||
addr = dev[0].p2p_interface_addr()
|
||||
@ -57,8 +56,7 @@ def test_wnm_ess_disassoc_imminent(dev, apdev):
|
||||
"time_zone": "EST5",
|
||||
"wnm_sleep_mode": "1",
|
||||
"bss_transition": "1" }
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412")
|
||||
addr = dev[0].p2p_interface_addr()
|
||||
@ -78,8 +76,7 @@ def test_wnm_ess_disassoc_imminent_pmf(dev, apdev):
|
||||
params["wpa_key_mgmt"] = "WPA-PSK-SHA256";
|
||||
params["ieee80211w"] = "2";
|
||||
params["bss_transition"] = "1"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
dev[0].connect("test-wnm-rsn", psk="12345678", ieee80211w="2",
|
||||
key_mgmt="WPA-PSK-SHA256", proto="WPA2", scan_freq="2412")
|
||||
@ -137,8 +134,7 @@ def test_wnm_sleep_mode_open(dev, apdev):
|
||||
"time_zone": "EST5",
|
||||
"wnm_sleep_mode": "1",
|
||||
"bss_transition": "1" }
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412")
|
||||
ev = hapd.wait_event([ "AP-STA-CONNECTED" ], timeout=5)
|
||||
@ -162,8 +158,7 @@ def test_wnm_sleep_mode_rsn(dev, apdev):
|
||||
params["time_zone"] = "EST5"
|
||||
params["wnm_sleep_mode"] = "1"
|
||||
params["bss_transition"] = "1"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
dev[0].connect("test-wnm-rsn", psk="12345678", scan_freq="2412")
|
||||
ev = hapd.wait_event([ "AP-STA-CONNECTED" ], timeout=5)
|
||||
@ -200,8 +195,7 @@ def test_wnm_sleep_mode_rsn_pmf(dev, apdev):
|
||||
params["time_zone"] = "EST5"
|
||||
params["wnm_sleep_mode"] = "1"
|
||||
params["bss_transition"] = "1"
|
||||
hostapd.add_ap(apdev[0], params)
|
||||
hapd = hostapd.Hostapd(apdev[0]['ifname'])
|
||||
hapd = hostapd.add_ap(apdev[0], params)
|
||||
|
||||
dev[0].connect("test-wnm-rsn", psk="12345678", ieee80211w="2",
|
||||
key_mgmt="WPA-PSK-SHA256", proto="WPA2", scan_freq="2412")
|
||||
|
Loading…
Reference in New Issue
Block a user