From 9e669cb5ff32c6425582c6304a479cf56f5c0902 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 29 May 2014 13:43:01 +0300 Subject: [PATCH] tests: Hide stdout from Popen() to avoid undesired stdout prints 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 --- tests/hwsim/test_ap_ciphers.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/test_ap_ciphers.py b/tests/hwsim/test_ap_ciphers.py index 970d193c5..b06b1e791 100644 --- a/tests/hwsim/test_ap_ciphers.py +++ b/tests/hwsim/test_ap_ciphers.py @@ -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")