]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fetch all event messages in wpas_ctrl_many_networks
authorJouni Malinen <quic_jouni@quicinc.com>
Sat, 26 Feb 2022 17:07:10 +0000 (19:07 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 26 Feb 2022 17:12:11 +0000 (19:12 +0200)
Do not leave a large number of network added/removed events remaining
for the following test case to handle. This removes some possible
failure test case sequences like the following one:
wpas_ctrl_many_networks dbus_ap_scan_2_ap_mode_scan

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_wpas_ctrl.py

index 210c11907ee76ef4b666c76219e386431da54b95..898e8bdea3a1e705ae112bc2c04d86300c2eae67 100644 (file)
@@ -303,6 +303,13 @@ def test_wpas_ctrl_many_networks(dev, apdev):
     """wpa_supplicant ctrl_iface LIST_NETWORKS with huge number of networks"""
     for i in range(1000):
         id = dev[0].add_network()
+    ev = dev[0].wait_event(["CTRL-EVENT-NETWORK-ADDED %d" % id])
+    if ev is None:
+        raise Exception("Network added event not seen for the last network")
+    ev = dev[0].wait_global_event(["CTRL-EVENT-NETWORK-ADDED %d" % id], timeout=10)
+    if ev is None:
+        raise Exception("Network added event (global) not seen for the last network")
+    dev[0].dump_monitor()
     res = dev[0].request("LIST_NETWORKS")
     if str(id) in res:
         raise Exception("Last added network was unexpectedly included")
@@ -313,6 +320,13 @@ def test_wpas_ctrl_many_networks(dev, apdev):
     # power CPU, so increase the command timeout significantly to avoid issues
     # with the test case failing and following reset operation timing out.
     dev[0].request("REMOVE_NETWORK all", timeout=60)
+    ev = dev[0].wait_event(["CTRL-EVENT-NETWORK-REMOVED %d" % id])
+    if ev is None:
+        raise Exception("Network removed event not seen for the last network")
+    ev = dev[0].wait_global_event(["CTRL-EVENT-NETWORK-REMOVED %d" % id], timeout=10)
+    if ev is None:
+        raise Exception("Network removed event (global) not seen for the last network")
+    dev[0].dump_monitor()
 
 @remote_compatible
 def test_wpas_ctrl_dup_network(dev, apdev):