From df1d01cfed9d7d090bc710cbfa4a469e4ba337b6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 16 Aug 2015 22:41:21 +0300 Subject: [PATCH] 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 --- tests/hwsim/test_ap_wps.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 729fe4b80..8c2ce8d7e 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/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"