From: Jonathan Afek Date: Tue, 7 Jun 2016 13:42:41 +0000 (+0300) Subject: tests: Use cmd_execute() function in ap_ht40_scan_not_affected X-Git-Tag: hostap_2_6~306 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=3e3cbbd03159cdb350a44bce37740b2978cb763a;p=mech_eap.git tests: Use cmd_execute() function in ap_ht40_scan_not_affected The ap_ht tests used to execute shell commands in the tests using the subprocess python module. Start using the cmd_execute() general function for executing shell commands so that this would also work on remote setups. Signed-off-by: Jonathan Afek --- diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py index e0f6047..ce8710e 100644 --- a/tests/hwsim/test_ap_ht.py +++ b/tests/hwsim/test_ap_ht.py @@ -152,13 +152,13 @@ def test_ap_ht40_scan_not_affected(dev, apdev): "channel": "11" } hostapd.add_ap(apdev[1], params) - subprocess.call(['ifconfig', apdev[0]['ifname'], 'up']) - subprocess.call(['iw', apdev[0]['ifname'], 'scan', 'trigger', 'freq', '2462']) + hostapd.cmd_execute(apdev[0], ['ifconfig', apdev[0]['ifname'], 'up']) + hostapd.cmd_execute(apdev[0], ['iw', apdev[0]['ifname'], 'scan', 'trigger', + 'freq', '2462']) time.sleep(0.5) - subprocess.call(['iw', apdev[0]['ifname'], 'scan', 'dump'], - stdout=open('/dev/null', 'w')) + hostapd.cmd_execute(apdev[0], ['iw', apdev[0]['ifname'], 'scan', 'dump']) time.sleep(0.1) - subprocess.call(['ifconfig', apdev[0]['ifname'], 'down']) + hostapd.cmd_execute(apdev[0], ['ifconfig', apdev[0]['ifname'], 'down']) params = { "ssid": "test-ht40", "channel": "1",