Browse Source

tests: WPS and non-WPS AP in single hostapd process

This is a regression test case for WPS_AP_PIN triggered hostapd segfault
when a non-WPS interface was enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 9 years ago
parent
commit
df1d01cfed
1 changed files with 19 additions and 0 deletions
  1. 19 0
      tests/hwsim/test_ap_wps.py

+ 19 - 0
tests/hwsim/test_ap_wps.py

@@ -2670,6 +2670,25 @@ def test_ap_wps_priority(dev, apdev):
     finally:
         dev[0].request("SET wps_priority 0")
 
+def test_ap_wps_and_non_wps(dev, apdev):
+    """WPS and non-WPS AP in single hostapd process"""
+    params = { "ssid": "wps", "eap_server": "1", "wps_state": "1" }
+    hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+
+    params = { "ssid": "no wps" }
+    hapd2 = hostapd.add_ap(apdev[1]['ifname'], params)
+
+    appin = hapd.request("WPS_AP_PIN random")
+    if "FAIL" in appin:
+        raise Exception("Could not generate random AP PIN")
+    if appin not in hapd.request("WPS_AP_PIN get"):
+        raise Exception("Could not fetch current AP PIN")
+
+    if "FAIL" in hapd.request("WPS_PBC"):
+        raise Exception("WPS_PBC failed")
+    if "FAIL" in hapd.request("WPS_CANCEL"):
+        raise Exception("WPS_CANCEL failed")
+
 def test_ap_wps_init_oom(dev, apdev):
     """Initial AP configuration and OOM during PSK generation"""
     ssid = "test-wps"