From: Benjamin Berg Date: Tue, 10 Jun 2025 15:08:57 +0000 (+0200) Subject: tests: Try next tshark filter for UnknownFieldsException X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b3d723b90eb34750ceee8cbacc11aefd22333c;p=thirdparty%2Fhostap.git tests: Try next tshark filter for UnknownFieldsException 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 --- diff --git a/tests/hwsim/tshark.py b/tests/hwsim/tshark.py index 73e54b6df..89ccb6104 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)