[PATCH] test: dbus: wait for connection before disconnect

Johannes Berg johannes at sipsolutions.net
Sun Jan 28 11:59:09 PST 2024


From: Johannes Berg <johannes.berg at intel.com>

The test here wants to connect and then disconnect again,
but it's driven only by the GO side, so the client may end
up (with UML time-travel) not fully connecting, and then
it all fails. Wait for the client to have connected first.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 tests/hwsim/test_dbus.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py
index 4dee2277bd78..324207894013 100644
--- a/tests/hwsim/test_dbus.py
+++ b/tests/hwsim/test_dbus.py
@@ -3993,6 +3993,9 @@ def test_dbus_p2p_autogo_pbc(dev, apdev):
 
         def staAuthorized(self, name):
             logger.debug("staAuthorized: " + name)
+            # wait for client to be fully connected
+            dev[1].wait_connected()
+            # so we can cleanly disconnect it now
             group_p2p = dbus.Interface(self.g_if_obj,
                                        WPAS_DBUS_IFACE_P2PDEVICE)
             group_p2p.Disconnect()
-- 
2.43.0




More information about the Hostap mailing list