[PATCH 6/7] tests: ensure the RoC is setup when the NAN frame arrives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Benjamin Berg <benjamin.berg@xxxxxxxxx>

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@xxxxxxxxx>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
 tests/hwsim/test_dbus.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py
index ffc59a181c..e07c6b94d1 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')})
-- 
2.49.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux