]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Hide stdout from Popen() to avoid undesired stdout prints
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 29 May 2014 10:43:01 +0000 (13:43 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 29 May 2014 12:37:18 +0000 (15:37 +0300)
ap_cipher_tkip_countermeasures_{ap,sta} printed out the MAC addresses in
stdout which resulted in the debug log not starting the PASS/FAIL
information at the beginning of the line. Hide these unnecessary prints
to avoid that.

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

index 970d193c50f975a59ef26d6e516b09a605601950..b06b1e791ca9beb06f24d01e1432a9bf3fde6364 100644 (file)
@@ -48,17 +48,21 @@ def test_ap_cipher_tkip_countermeasures_ap(dev, apdev):
 
     dev[0].dump_monitor()
     cmd = subprocess.Popen(["sudo", "tee", testfile],
-                           stdin=subprocess.PIPE)
+                           stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     cmd.stdin.write(apdev[0]['bssid'])
     cmd.stdin.close()
+    cmd.stdout.read()
+    cmd.stdout.close()
     ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1)
     if ev is not None:
         raise Exception("Unexpected disconnection on first Michael MIC failure")
 
     cmd = subprocess.Popen(["sudo", "tee", testfile],
-                           stdin=subprocess.PIPE)
+                           stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     cmd.stdin.write("ff:ff:ff:ff:ff:ff")
     cmd.stdin.close()
+    cmd.stdout.read()
+    cmd.stdout.close()
     ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=10)
     if ev is None:
         raise Exception("No disconnection after two Michael MIC failures")
@@ -86,17 +90,21 @@ def test_ap_cipher_tkip_countermeasures_sta(dev, apdev):
 
     dev[0].dump_monitor()
     cmd = subprocess.Popen(["sudo", "tee", testfile],
-                           stdin=subprocess.PIPE)
+                           stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     cmd.stdin.write(dev[0].p2p_dev_addr())
     cmd.stdin.close()
+    cmd.stdout.read()
+    cmd.stdout.close()
     ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1)
     if ev is not None:
         raise Exception("Unexpected disconnection on first Michael MIC failure")
 
     cmd = subprocess.Popen(["sudo", "tee", testfile],
-                           stdin=subprocess.PIPE)
+                           stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     cmd.stdin.write("ff:ff:ff:ff:ff:ff")
     cmd.stdin.close()
+    cmd.stdout.read()
+    cmd.stdout.close()
     ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=10)
     if ev is None:
         raise Exception("No disconnection after two Michael MIC failures")