[PATCH 3/3] tests: try next tshark filter for UnknownFieldsException

Benjamin Berg benjamin at sipsolutions.net
Tue Jun 10 08:08:57 PDT 2025


From: Benjamin Berg <benjamin.berg at intel.com>

The intention in commit cc35ed3e257a ("tests: Permit passing multiple
valid tshark filters") was to permit passing multiple filters in order
to permit compatibility with older tshark versions. However, this did
not work as expected for the UnknownFieldsException.

Fix that by storing it in last_exception as for other errors. This fixes
running some EHT tests with older tshark versions.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
 tests/hwsim/tshark.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/hwsim/tshark.py b/tests/hwsim/tshark.py
index 73e54b6dfe..89ccb6104e 100644
--- a/tests/hwsim/tshark.py
+++ b/tests/hwsim/tshark.py
@@ -111,8 +111,12 @@ def run_tshark(filename, filters, display=None, wait=True):
                     all_wlan_mgt = False
                     break
             if not all_wlan_mgt:
-                raise
-            return _run_tshark(filename, filter, display, wait)
+                last_exception = e
+                continue
+            try:
+                return _run_tshark(filename, filter, display, wait)
+            except Exception as e:
+                last_exception = e
 
         except AssertionError as e:
             # Catch the error (and try the next provided filter)
-- 
2.49.0




More information about the Hostap mailing list