]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPA2-PSK AP and no PSK configured
authorJouni Malinen <j@w1.fi>
Mon, 26 Dec 2016 19:21:10 +0000 (21:21 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 26 Dec 2016 19:21:10 +0000 (21:21 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_params.py

index e0d402297a3372ddcba6f9de4a32481010fe915b..4804f05d017b781784547f9dddd5812c7ec5d6bf 100644 (file)
@@ -538,3 +538,17 @@ def test_ap_wep_to_wpa(dev, apdev):
 
     dev[0].connect("wep-to-wpa", psk="12345678", scan_freq="2412")
     hwsim_utils.test_connectivity(dev[0], hapd)
+
+def test_ap_missing_psk(dev, apdev):
+    """WPA2-PSK AP and no PSK configured"""
+    ssid = "test-wpa2-psk"
+    params = hostapd.wpa2_params(ssid=ssid)
+    try:
+        # "WPA-PSK enabled, but PSK or passphrase is not configured."
+        hostapd.add_ap(apdev[0], params)
+        raise Exception("AP setup succeeded unexpectedly")
+    except Exception, e:
+        if "Failed to enable hostapd" in str(e):
+            pass
+        else:
+            raise