]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: hostapd global control interface and per-interface events
authorJouni Malinen <jouni@codeaurora.org>
Mon, 2 Dec 2019 14:35:03 +0000 (16:35 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 2 Dec 2019 14:35:03 +0000 (16:35 +0200)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_hapd_ctrl.py

index 245aad7d29e1c6feed5ee6e83bacda511f714efb..5b802e478b8f4aa573de7549cfced56b04304096 100644 (file)
@@ -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"):