From d5482411cf6bfa0ebc2c261af543a4db0aee9f13 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 21 Nov 2015 17:06:41 +0200 Subject: [PATCH] tests: EAP-MD5 local error cases Signed-off-by: Jouni Malinen --- tests/hwsim/test_eap_proto.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py index 92bbe03e0..444a39d01 100644 --- a/tests/hwsim/test_eap_proto.py +++ b/tests/hwsim/test_eap_proto.py @@ -15,7 +15,7 @@ import threading import time import hostapd -from utils import HwsimSkip, fail_test, wait_fail_trigger +from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger from test_ap_eap import check_eap_capa EAP_CODE_REQUEST = 1 @@ -783,6 +783,32 @@ def test_eap_proto_md5(dev, apdev): finally: stop_radius_server(srv) +def test_eap_proto_md5_errors(dev, apdev): + """EAP-MD5 local error cases""" + check_eap_capa(dev[0], "MD5") + params = hostapd.wpa2_eap_params(ssid="eap-test") + hapd = hostapd.add_ap(apdev[0]['ifname'], params) + + with fail_test(dev[0], 1, "chap_md5"): + dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412", + eap="MD5", identity="phase1-user", password="password", + wait_connect=False) + ev = dev[0].wait_event(["CTRL-EVENT-EAP-METHOD"], timeout=15) + if ev is None: + raise Exception("Timeout on EAP start") + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + + with alloc_fail(dev[0], 1, "eap_msg_alloc;eap_md5_process"): + dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412", + eap="MD5", identity="phase1-user", password="password", + wait_connect=False) + ev = dev[0].wait_event(["CTRL-EVENT-EAP-METHOD"], timeout=15) + if ev is None: + raise Exception("Timeout on EAP start") + time.sleep(0.1) + dev[0].request("REMOVE_NETWORK all") + def test_eap_proto_otp(dev, apdev): """EAP-OTP protocol tests""" def otp_handler(ctx, req):