]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Ensure the RoC is setup when the NAN frame arrives
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 11 Jun 2025 08:47:28 +0000 (10:47 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 21 Jun 2025 08:44:05 +0000 (11:44 +0300)
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 <benjamin.berg@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
tests/hwsim/test_dbus.py

index ffc59a181cca7d8a3fd9e457267f25ffe22be2e5..e07c6b94d18b1a295a4d1a663b6342b2dcc21ff4 100644 (file)
@@ -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')})