]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Support older tshark versions
authorJouni Malinen <j@w1.fi>
Thu, 25 Dec 2014 13:51:10 +0000 (15:51 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 29 Dec 2014 13:49:05 +0000 (15:49 +0200)
The -Y command line argument may need to be replaced with -R when an
older tshark version is used.

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

index 3e57d08d16d2a3c01cf52d9b084877c5fba651ae..239b5105f0da00963364419e33525ef5271f00ee 100644 (file)
@@ -95,7 +95,16 @@ def test_cfg80211_tx_frame(dev, apdev, params):
         pass
 
     if cmd:
-        freq = cmd.stdout.read().splitlines()
+        (out,err) = cmd.communicate()
+        res = cmd.wait()
+        if res == 1:
+            arg[3] = '-R'
+            cmd = subprocess.Popen(arg, stdout=subprocess.PIPE,
+                                   stderr=open('/dev/null', 'w'))
+            (out,err) = cmd.communicate()
+            res = cmd.wait()
+
+        freq = out.splitlines()
         if len(freq) != 2:
             raise Exception("Unexpected number of Action frames (%d)" % len(freq))
         if freq[0] != "2422":
index e980e7a59046d6a1bee7e04d1091ed24f37dda92..19cad6ea900f394c019af600091c7de8b4186f7f 100644 (file)
@@ -144,8 +144,17 @@ def test_p2p_channel_random_social_with_op_class_change(dev, apdev, params):
             pass
 
         if cmd:
+            (out,err) = cmd.communicate()
+            res = cmd.wait()
+            if res == 1:
+                arg[3] = '-R'
+                cmd = subprocess.Popen(arg, stdout=subprocess.PIPE,
+                                       stderr=open('/dev/null', 'w'))
+                (out,err) = cmd.communicate()
+                res = cmd.wait()
+
             last = None
-            for l in cmd.stdout.read().splitlines():
+            for l in out.splitlines():
                 if "Operating Channel:" not in l:
                     continue
                 last = l