From 2e0d48e5c8b8341b88a2245d5ea86a5083d73d43 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 24 Dec 2014 13:06:25 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_ap_psk.py | 3 --- tests/hwsim/test_ibss.py | 7 ++----- tests/hwsim/test_nfc_p2p.py | 4 ++-- tests/hwsim/test_p2p_channel.py | 2 +- tests/hwsim/test_scan.py | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 977a7d2..b3a81b7 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -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""" diff --git a/tests/hwsim/test_ibss.py b/tests/hwsim/test_ibss.py index b0bb398..b5a8557 100644 --- a/tests/hwsim/test_ibss.py +++ b/tests/hwsim/test_ibss.py @@ -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) diff --git a/tests/hwsim/test_nfc_p2p.py b/tests/hwsim/test_nfc_p2p.py index 2cd9751..66de717 100644 --- a/tests/hwsim/test_nfc_p2p.py +++ b/tests/hwsim/test_nfc_p2p.py @@ -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") diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py index 79caddd..89f9a99 100644 --- a/tests/hwsim/test_p2p_channel.py +++ b/tests/hwsim/test_p2p_channel.py @@ -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)) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index f7a30be..4939903 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -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: -- 2.1.4