]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Update tshark wlan_mgmt compatibility code for new version
authorJouni Malinen <j@w1.fi>
Tue, 16 Oct 2018 15:21:07 +0000 (18:21 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 16 Oct 2018 15:21:07 +0000 (18:21 +0300)
It looks like at least tshark 2.6.3 uses a different error message for
unknown display filter fields:
tshark: Neither "wlan_mgt.fixed.category_code" nor "4" are field or protocol names.
and a different status exit code (2 instead of 1).

Add a new handler for this combination to allow automatic wlan_mgt to
wlan conversion to happen.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/tshark.py

index 2d4389c699742a3041e39ec6238731162b0a7eff..c3b8f36d436fbb4be20e5e35142065151c403319 100644 (file)
@@ -70,6 +70,17 @@ def _run_tshark(filename, filter, display=None, wait=True):
                                stderr=open('/dev/null', 'w'))
         out = cmd.communicate()[0]
         cmd.wait()
+    if res == 2:
+        if "tshark: Neither" in output[1] and "are field or protocol names" in output[1]:
+            errors = output[1].split('\n')
+            fields = []
+            for f in errors:
+                if f.startswith("tshark: Neither "):
+                    f = f.split(' ')[2].strip('"')
+                    if f:
+                        fields.append(f)
+                    continue
+            raise UnknownFieldsException(fields)
 
     return out