summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-09-22 12:03:53 +0300
committerJouni Malinen <j@w1.fi>2015-09-22 12:03:53 +0300
commitf455998afe9e72e2f4a3c78a64cbab557f4ffeea (patch)
tree37f173adf840927d8023eacfe5fda684327473c4
parent5a1d9d1a8ea540f6d79d3a8f8fdf0ed0e2f19e54 (diff)
downloadhostap-f455998afe9e72e2f4a3c78a64cbab557f4ffeea.tar.gz
tests: WPA2-Enterprise interactive identity entry and ENABLE_NETWORK
This verifies that ENABLE_NETWORK does not trigger reconnection if already connected. The previous commit fixed a case where it was possible for that to happen. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--tests/hwsim/test_ap_eap.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py
index 2c7295daf..f7d910efe 100644
--- a/tests/hwsim/test_ap_eap.py
+++ b/tests/hwsim/test_ap_eap.py
@@ -2269,6 +2269,36 @@ def test_ap_wpa2_eap_interactive(dev, apdev):
dev[0].wait_connected(timeout=10)
dev[0].request("REMOVE_NETWORK all")
+def test_ap_wpa2_eap_ext_enable_network_while_connected(dev, apdev):
+ """WPA2-Enterprise interactive identity entry and ENABLE_NETWORK"""
+ check_eap_capa(dev[0], "MSCHAPV2")
+ params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
+ hostapd.add_ap(apdev[0]['ifname'], params)
+ hapd = hostapd.Hostapd(apdev[0]['ifname'])
+
+ id_other = dev[0].connect("other", key_mgmt="NONE", scan_freq="2412",
+ only_add_network=True)
+
+ req_id = "DOMAIN\mschapv2 user"
+ dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
+ anonymous_identity="ttls", identity=None,
+ password="password",
+ ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2",
+ wait_connect=False, scan_freq="2412")
+ ev = dev[0].wait_event(["CTRL-REQ-IDENTITY"])
+ if ev is None:
+ raise Exception("Request for identity timed out")
+ id = ev.split(':')[0].split('-')[-1]
+ dev[0].request("CTRL-RSP-IDENTITY-" + id + ":" + req_id)
+ dev[0].wait_connected(timeout=10)
+
+ if "OK" not in dev[0].request("ENABLE_NETWORK " + str(id_other)):
+ raise Exception("Failed to enable network")
+ ev = dev[0].wait_event(["SME: Trying to authenticate"], timeout=1)
+ if ev is not None:
+ raise Exception("Unexpected reconnection attempt on ENABLE_NETWORK")
+ dev[0].request("REMOVE_NETWORK all")
+
def test_ap_wpa2_eap_vendor_test(dev, apdev):
"""WPA2-Enterprise connection using EAP vendor test"""
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")