tests: Do not print to stdout during test execution

This cleans up vm-run.sh output and makes information more easily
available from the *.log files.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-12-24 13:06:25 +02:00
parent d3fb9c1403
commit 2e0d48e5c8
5 changed files with 6 additions and 12 deletions

View file

@ -384,14 +384,11 @@ def test_ap_wpa2_in_different_bridge(dev, apdev):
raise Exception("Unexpected added_if_into_bridge value")
dev[0].request("DISCONNECT")
hapd.disable()
subprocess.call(['ip', 'link', 'show', 'ap-br0'])
subprocess.call(['brctl', 'show'])
finally:
subprocess.call(['ip', 'link', 'set', 'dev', br_ifname, 'down'])
subprocess.call(['brctl', 'delif', br_ifname, ifname],
stderr=open('/dev/null', 'w'))
subprocess.call(['brctl', 'delbr', br_ifname])
subprocess.call(['brctl', 'show'])
def test_ap_wpa2_ext_add_to_bridge(dev, apdev):
"""hostapd behavior with interface added to bridge externally"""

View file

@ -168,9 +168,7 @@ def test_ibss_wpa_none(dev):
logger.info("STA0 BSSID " + bssid0 + " differs from STA2 BSSID " + bssid2)
bssid2 = wait_ibss_connection(dev[2])
print bssid0
print bssid1
print bssid2
logger.info("bssid0=%s bssid1=%s bssid2=%s" % (bssid0, bssid1, bssid2))
bss = dev[0].get_bss(bssid0)
if not bss:
@ -227,8 +225,7 @@ def test_ibss_wpa_none_ccmp(dev):
logger.info("STA0 BSSID " + bssid0 + " differs from STA1 BSSID " + bssid1)
bssid1 = wait_ibss_connection(dev[1])
print bssid0
print bssid1
logger.info("bssid0=%s bssid1=%s" % (bssid0, bssid1))
# Allow some time for all peers to complete key setup
time.sleep(1)

View file

@ -686,7 +686,7 @@ def test_nfc_p2p_ip_addr_assignment2(dev):
raise Exception("Unexpected roles negotiated")
hwsim_utils.test_connectivity_p2p(dev[0], dev[1])
check_ip_addr(res0)
print "Client 1 IP address: " + res0['ip_addr']
logger.info("Client 1 IP address: " + res0['ip_addr'])
logger.info("Connect a P2P client")
pin = dev[2].wps_read_pin()
@ -695,7 +695,7 @@ def test_nfc_p2p_ip_addr_assignment2(dev):
logger.info("Client connected")
hwsim_utils.test_connectivity_p2p(dev[1], dev[2])
check_ip_addr(res)
print "Client 2 IP address: " + res['ip_addr']
logger.info("Client 2 IP address: " + res['ip_addr'])
if res['ip_addr'] == res0['ip_addr']:
raise Exception("Same IP address assigned to both clients")

View file

@ -541,7 +541,7 @@ def _test_autogo_ht_vht(dev):
raise Exception("Unexpected freq=5 channel: " + str(freq))
res = run_autogo(dev[0], "freq=5 ht40 vht")
print res
logger.info(str(res))
freq = int(res['freq'])
if freq < 5000 or freq >= 6000:
raise Exception("Unexpected freq=5 ht40 vht channel: " + str(freq))

View file

@ -203,7 +203,7 @@ def test_scan_int(dev, apdev):
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 10)
if ev is None:
raise Exception("did not complete a scan")
print times
logger.info("times=" + str(times))
if times[0] > 1 or times[1] < 0.5 or times[1] > 1.5 or times[2] < 0.5 or times[2] > 1.5:
raise Exception("Unexpected scan timing: " + str(times))
finally: