]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: More coverage for WPS NFC error and uncommon cases
authorJouni Malinen <j@w1.fi>
Sun, 7 Dec 2014 15:36:22 +0000 (17:36 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 8 Dec 2014 09:07:56 +0000 (11:07 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_nfc_wps.py
tests/hwsim/test_wpas_ctrl.py

index 454a7ec53cb189976b78182c357ad0d5bbce02f2..f93aeefe4cfdd36a71f52aa320c562681d0e4eb0 100644 (file)
@@ -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")
index decd01c006d4d24e122886dc6d44388c47bbc318..b77c4575fbe06a0f303dd9155e61d9b83e4b5ec3 100644 (file)
@@ -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"):