]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPA2-PSK and local error cases on supplicant
authorJouni Malinen <jouni@codeaurora.org>
Tue, 16 Apr 2019 18:35:04 +0000 (21:35 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 16 Apr 2019 18:35:04 +0000 (21:35 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_psk.py

index 211acc2cbfdc294a9f86a7b56e03262db2a83eca..3be68e830c1496b1edf758bee9c44e525e1bef67 100644 (file)
@@ -3176,3 +3176,29 @@ def test_ap_wpa2_psk_mic_0(dev, apdev):
     if "EAPOL-TX" in ev:
         raise Exception("Unexpected EAPOL-Key message from wpa_supplicant")
     dev[0].request("DISCONNECT")
+
+def test_ap_wpa2_psk_local_error(dev, apdev):
+    """WPA2-PSK and local error cases on supplicant"""
+    ssid = "test-wpa2-psk"
+    passphrase = 'qwertyuiop'
+    params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
+    params["wpa_key_mgmt"] = "WPA-PSK WPA-PSK-SHA256"
+    hapd = hostapd.add_ap(apdev[0], params)
+
+    with fail_test(dev[0], 1, "sha1_prf;wpa_pmk_to_ptk"):
+        id = dev[0].connect(ssid, key_mgmt="WPA-PSK", psk=passphrase,
+                            scan_freq="2412", wait_connect=False)
+        ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=5)
+        if ev is None:
+            raise Exception("Disconnection event not reported")
+        dev[0].request("REMOVE_NETWORK all")
+        dev[0].dump_monitor()
+
+    with fail_test(dev[0], 1, "sha256_prf;wpa_pmk_to_ptk"):
+        id = dev[0].connect(ssid, key_mgmt="WPA-PSK-SHA256", psk=passphrase,
+                            scan_freq="2412", wait_connect=False)
+        ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=5)
+        if ev is None:
+            raise Exception("Disconnection event not reported")
+        dev[0].request("REMOVE_NETWORK all")
+        dev[0].dump_monitor()