]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix mbo_assoc_disallow on old tshark
authorBenjamin Berg <benjamin.berg@intel.com>
Fri, 1 Aug 2025 07:47:16 +0000 (09:47 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 30 Sep 2025 15:02:00 +0000 (18:02 +0300)
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@intel.com>
tests/hwsim/test_mbo.py

index 0e373c48a3322b7749226d30e59a050bccc65989..7c307be859babc74451e9ba8b262add73b1ab757 100644 (file)
@@ -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: