[PATCH] tests: fix mbo_assoc_disallow on old tshark

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

 



From: Benjamin Berg <benjamin.berg@xxxxxxxxx>

Older tshark seems to be a bit inconsistent. It returns the timestamp
with a timezone qualifier, but then doesn't accept it when passed in the
same format. Use the frame number instead of the timestamp to work
around that.

Signed-off-by: Benjamin Berg <benjamin.berg@xxxxxxxxx>
---
 tests/hwsim/test_mbo.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/hwsim/test_mbo.py b/tests/hwsim/test_mbo.py
index 0e373c48a3..7c307be859 100644
--- a/tests/hwsim/test_mbo.py
+++ b/tests/hwsim/test_mbo.py
@@ -225,9 +225,9 @@ def test_mbo_assoc_disallow(dev, apdev, params):
     if "Destination address: " + hapd1.own_addr() in out:
         raise Exception("Association request sent to disallowed AP")
 
-    timestamp = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"),
-                           "wlan.fc.type_subtype == 0x00",
-                           display=['frame.time'], wait=False)
+    frame_number = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"),
+                              "wlan.fc.type_subtype == 0x00",
+                              display=['frame.number'], wait=False)
 
     logger.debug("Allow associations to AP1 and disallow associations to AP2")
     if "OK" not in hapd1.request("SET mbo_assoc_disallow 0"):
@@ -243,7 +243,7 @@ def test_mbo_assoc_disallow(dev, apdev, params):
 
     dev[0].connect("MBO", key_mgmt="NONE", scan_freq="2412")
 
-    filter = 'wlan.fc.type == 0 && wlan.fc.type_subtype == 0x00 && frame.time > "' + timestamp.rstrip() + '"'
+    filter = f'wlan.fc.type == 0 && wlan.fc.type_subtype == 0x00 && frame.number > {frame_number.rstrip()}'
     out = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"),
                      filter, wait=False)
     if "Destination address: " + hapd2.own_addr() in out:
-- 
2.50.1


_______________________________________________
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