]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Do not print to stdout during test execution
authorJouni Malinen <j@w1.fi>
Wed, 24 Dec 2014 11:06:25 +0000 (13:06 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 25 Dec 2014 14:37:12 +0000 (16:37 +0200)
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>
tests/hwsim/test_ap_psk.py
tests/hwsim/test_ibss.py
tests/hwsim/test_nfc_p2p.py
tests/hwsim/test_p2p_channel.py
tests/hwsim/test_scan.py

index 977a7d2a2df0f16ec0b649a512292a63234588b2..b3a81b7b2ad53f42327889287b36f2b7100c98fa 100644 (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"""
index b0bb398b9163c364351e8e3086a29394d0cab193..b5a855746eb93d8917fed5f3642198f421e398f8 100644 (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)
index 2cd9751d5c5519d561fff68359c8031e626e2783..66de717f85a4ae46949730208bab2a3321f3f050 100644 (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")
 
index 79cadddd6bfccbf3dbe77a846d5cf5f1f70b1cfc..89f9a999985887cb16e5bebe9c2ed9bc2cb43ef5 100644 (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))
index f7a30bef2af6932af3d62c45949ec9ec1b08c097..4939903f373f5ca2cad6e493c3299a3ea8306b6f 100644 (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: