From: Jouni Malinen Date: Sun, 7 Mar 2021 10:41:16 +0000 (+0200) Subject: tests: hostapd ATTACH errors X-Git-Tag: hostap_2_10~452 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea82abc18acad1a137cb627bfe5a1b8e03d420fb;p=thirdparty%2Fhostap.git tests: hostapd ATTACH errors Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_hapd_ctrl.py b/tests/hwsim/test_hapd_ctrl.py index d1b8abfbb..93d3d177e 100644 --- a/tests/hwsim/test_hapd_ctrl.py +++ b/tests/hwsim/test_hapd_ctrl.py @@ -1057,3 +1057,15 @@ def test_hapd_ctrl_pmksa_add_failures(dev, apdev): for t in tests: if "FAIL" not in hapd.request("PMKSA_ADD " + t): raise Exception("Invalid PMKSA_ADD accepted: " + t) + +def test_hapd_ctrl_attach_errors(dev, apdev): + """hostapd ATTACH errors""" + params = {"ssid": "hapd-ctrl"} + hapd = hostapd.add_ap(apdev[0], params) + hglobal = hostapd.HostapdGlobal(apdev[0]) + with alloc_fail(hapd, 1, "ctrl_iface_attach"): + if "FAIL" not in hapd.request("ATTACH foo"): + raise Exception("Invalid ATTACH accepted") + with alloc_fail(hapd, 1, "ctrl_iface_attach"): + if "FAIL" not in hglobal.request("ATTACH foo"): + raise Exception("Invalid ATTACH accepted")