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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2014-05-29 13:43:01 +03:00 committed by Jouni Malinen
parent c50f0eac11
commit 9e669cb5ff

View 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")