]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix tshark refactoring
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 30 Jan 2015 13:28:59 +0000 (15:28 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 30 Jan 2015 16:55:22 +0000 (18:55 +0200)
Commit 2e1d7386e2766b57bc295702af543cc784a0d2be ('tests: Refactor tshark
running') added a helper function for running tshark. However, it did
not use the filter argument correctly, added an extra -Tfields on the
command line, and failed to use global variable. In practice, this ended
up disabling all the tshark sniffer checks. Fix that by using the filter
argument from the caller and marking the _tshark_filter_arg global.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/tshark.py

index 55e06175b448c7ebc8beb2184dc217cfcb1ccbb1..d5984ebfe51ed3289627b5d77233cf8dbe7d18cc 100644 (file)
@@ -16,14 +16,15 @@ logger = logging.getLogger()
 _tshark_filter_arg = '-Y'
 
 def run_tshark(filename, filter, display=None):
+    global _tshark_filter_arg
+
     # wait a bit to make it more likely for wlantest sniffer to have captured
     # and written the results into a file that we can process here
     time.sleep(1)
 
     try:
         arg = [ "tshark", "-r", filename,
-                _tshark_filter_arg, "wlan.fc.type_subtype == 4",
-                "-Tfields", ]
+                _tshark_filter_arg, filter ]
         if display:
             arg.append('-Tfields')
             for d in display: