From: Benjamin Berg Date: Wed, 11 Jun 2025 08:47:28 +0000 (+0200) Subject: tests: Ensure the RoC is setup when the NAN frame arrives X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52ec1a869dc88ebf4a731d976da1ebc6da9f0bba;p=thirdparty%2Fhostap.git tests: Ensure the RoC is setup when the NAN frame arrives At least in UML it could sometimes happen that the RoC is ready only slightly after the NAN frame is TXed (a few microseconds). Insert a short sleep to prevent this race from happening. Signed-off-by: Benjamin Berg Reviewed-by: Andrei Otcheretianski --- diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index ffc59a181..e07c6b94d 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -6598,6 +6598,9 @@ def test_dbus_nan_usd_subscribe_followup(dev, apdev): 'srv_proto_type': 3, 'ssi': dbus.ByteArray(b'test')}) + # Setting up the RoC takes a little bit of time. Avoid racing with + # the TX here by sleeping a little bit. + time.sleep(0.01) cmd = "NAN_PUBLISH service_name=_test srv_proto_type=3 ssi=6677 ttl=10" self.id1 = dev[1].request(cmd) if "FAIL" in self.id1: @@ -6664,6 +6667,9 @@ def test_dbus_nan_usd_publish_followup(dev, apdev): if "FAIL" in id1: raise Exception("NAN_SUBSCRIBE failed") + # Setting up the RoC takes a little bit of time. Avoid racing with + # the TX here by sleeping a little bit. + time.sleep(0.01) self.publish_id = iface.NANPublish({'srv_name': '_test', 'srv_proto_type': 2, 'ssi': dbus.ByteArray(b'test')})