def test_ap_wps_er_add_enrollee(dev, apdev):
"""WPS ER configuring AP and adding a new enrollee using PIN"""
+ try:
+ _test_ap_wps_er_add_enrollee(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_ap_wps_er_add_enrollee(dev, apdev):
ssid = "wps-er-add-enrollee"
ap_pin = "12345670"
ap_uuid = "27ea801a-9e5c-4e73-bd82-f89cbcd10d7e"
def test_ap_wps_er_add_enrollee_pbc(dev, apdev):
"""WPS ER connected to AP and adding a new enrollee using PBC"""
+ try:
+ _test_ap_wps_er_add_enrollee_pbc(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_ap_wps_er_add_enrollee_pbc(dev, apdev):
ssid = "wps-er-add-enrollee-pbc"
ap_pin = "12345670"
ap_uuid = "27ea801a-9e5c-4e73-bd82-f89cbcd10d7e"
def test_ap_wps_er_pbc_overlap(dev, apdev):
"""WPS ER connected to AP and PBC session overlap"""
+ try:
+ _test_ap_wps_er_pbc_overlap(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_ap_wps_er_pbc_overlap(dev, apdev):
ssid = "wps-er-add-enrollee-pbc"
ap_pin = "12345670"
ap_uuid = "27ea801a-9e5c-4e73-bd82-f89cbcd10d7e"
def test_ap_wps_er_v10_add_enrollee_pin(dev, apdev):
"""WPS v1.0 ER connected to AP and adding a new enrollee using PIN"""
+ try:
+ _test_ap_wps_er_v10_add_enrollee_pin(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_ap_wps_er_v10_add_enrollee_pin(dev, apdev):
ssid = "wps-er-add-enrollee-pbc"
ap_pin = "12345670"
ap_uuid = "27ea801a-9e5c-4e73-bd82-f89cbcd10d7e"
def test_ap_wps_er_config_ap(dev, apdev):
"""WPS ER configuring AP over UPnP"""
+ try:
+ _test_ap_wps_er_config_ap(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_ap_wps_er_config_ap(dev, apdev):
ssid = "wps-er-ap-config"
ap_pin = "12345670"
ap_uuid = "27ea801a-9e5c-4e73-bd82-f89cbcd10d7e"
def test_nfc_wps_er_pw_token(dev, apdev):
"""WPS NFC password token from Enrollee to ER"""
+ try:
+ _test_nfc_wps_er_pw_token(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_nfc_wps_er_pw_token(dev, apdev):
ssid = "wps-nfc-er-pw-token"
start_ap_er(dev[0], apdev[0], ssid)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
def test_nfc_wps_er_config_token(dev, apdev):
"""WPS NFC configuration token from ER to Enrollee"""
+ try:
+ _test_nfc_wps_er_config_token(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_nfc_wps_er_config_token(dev, apdev):
ssid = "wps-nfc-er-config-token"
start_ap_er(dev[0], apdev[0], ssid)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
def test_nfc_wps_er_handover(dev, apdev):
"""WPS NFC connection handover between Enrollee and ER"""
+ try:
+ _test_nfc_wps_er_handover(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_nfc_wps_er_handover(dev, apdev):
ssid = "wps-nfc-er-handover"
start_ap_er(dev[0], apdev[0], ssid)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
def test_nfc_wps_er_handover_pk_hash_mismatch_sta(dev, apdev):
"""WPS NFC connection handover with invalid pkhash from station to ER (negative)"""
+ try:
+ _test_nfc_wps_er_handover_pk_hash_mismatch_sta(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_nfc_wps_er_handover_pk_hash_mismatch_sta(dev, apdev):
ssid = "wps-nfc-er-handover-pkhash-sta"
start_ap_er(dev[0], apdev[0], ssid)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
def test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev):
"""WPS NFC connection handover with invalid pkhash from ER to station (negative)"""
+ try:
+ _test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev)
+ finally:
+ dev[0].request("WPS_ER_STOP")
+
+def _test_nfc_wps_er_handover_pk_hash_mismatch_er(dev, apdev):
ssid = "wps-nfc-er-handover-pkhash-er"
start_ap_er(dev[0], apdev[0], ssid)
hapd = hostapd.Hostapd(apdev[0]['ifname'])