From 2e58926ef306df2264d70c01a1c12fe192211975 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 2 Dec 2019 16:35:03 +0200 Subject: [PATCH] tests: hostapd global control interface and per-interface events Signed-off-by: Jouni Malinen --- tests/hwsim/test_hapd_ctrl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/hwsim/test_hapd_ctrl.py b/tests/hwsim/test_hapd_ctrl.py index 245aad7d2..5b802e478 100644 --- a/tests/hwsim/test_hapd_ctrl.py +++ b/tests/hwsim/test_hapd_ctrl.py @@ -79,9 +79,20 @@ def run_hapd_ctrl_sta(dev, apdev): passphrase = "12345678" params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase) hapd = hostapd.add_ap(apdev[0], params) + hglobal = hostapd.HostapdGlobal(apdev[0]) dev[0].request("VENDOR_ELEM_ADD 13 2102ff02") dev[0].connect(ssid, psk=passphrase, scan_freq="2412") addr = dev[0].own_addr() + ev = hapd.wait_event(["AP-STA-CONNECTED"], timeout=2) + if ev is None: + raise Exception("No hostapd per-interface event reported") + ev2 = hglobal.wait_event(["AP-STA-CONNECTED"], timeout=2) + if ev2 is None: + raise Exception("No hostapd global event reported") + if not ev2.startswith("IFNAME=" + apdev[0]['ifname'] + " <"): + raise Exception("Unexpected global event prefix: " + ev2) + if ev not in ev2: + raise Exception("Event mismatch (%s,%s)" % (ev, ev2)) if "FAIL" in hapd.request("STA " + addr): raise Exception("Unexpected STA failure") if "FAIL" not in hapd.request("STA " + addr + " eapol"):