diff --git a/tests/hwsim/test_nfc_wps.py b/tests/hwsim/test_nfc_wps.py index 454a7ec53..f93aeefe4 100644 --- a/tests/hwsim/test_nfc_wps.py +++ b/tests/hwsim/test_nfc_wps.py @@ -40,6 +40,9 @@ def test_nfc_wps_password_token_sta(dev, apdev): hostapd.add_ap(apdev[0]['ifname'], params) hapd = hostapd.Hostapd(apdev[0]['ifname']) logger.info("WPS provisioning step using password token from station") + wps = dev[0].request("WPS_NFC_TOKEN WPS").rstrip() + if "FAIL" in wps: + raise Exception("Failed to generate password token (WPS only)") pw = dev[0].request("WPS_NFC_TOKEN NDEF").rstrip() if "FAIL" in pw: raise Exception("Failed to generate password token") @@ -437,6 +440,9 @@ def test_nfc_wps_er_config_token(dev, apdev): start_ap_er(dev[0], apdev[0], ssid) hapd = hostapd.Hostapd(apdev[0]['ifname']) logger.info("WPS provisioning step using configuration token from ER") + wps = dev[0].request("WPS_ER_NFC_CONFIG_TOKEN WPS " + apdev[0]['bssid']).rstrip() + if "FAIL" in wps: + raise Exception("Failed to generate configuration token (WPS format)") conf = dev[0].request("WPS_ER_NFC_CONFIG_TOKEN NDEF " + apdev[0]['bssid']).rstrip() if "FAIL" in conf: raise Exception("Failed to generate configuration token") diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index decd01c00..b77c4575f 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -540,6 +540,13 @@ def test_wpas_ctrl_wps_errors(dev): if "FAIL" not in dev[0].request("WPS_ER_NFC_CONFIG_TOKEN NDEF 00:11:22:33:44:55"): raise Exception("Unexpected success on invalid WPS_ER_NFC_CONFIG_TOKEN") + if "FAIL" not in dev[0].request("WPS_NFC_CONFIG_TOKEN FOO"): + raise Exception("Unexpected success on invalid WPS_NFC_CONFIG_TOKEN") + if "FAIL" not in dev[0].request("WPS_NFC_CONFIG_TOKEN WPS FOO"): + raise Exception("Unexpected success on invalid WPS_NFC_CONFIG_TOKEN") + if "FAIL" not in dev[0].request("WPS_NFC_TOKEN FOO"): + raise Exception("Unexpected success on invalid WPS_NFC_TOKEN") + def test_wpas_ctrl_config_parser(dev): """wpa_supplicant ctrl_iface SET config parser""" if "FAIL" not in dev[0].request("SET pbc_in_m1 qwerty"):