tests: Use cmd_execute() in ap_ht clear_scan_cache()
authorJonathan Afek <jonathan@wizery.com>
Tue, 7 Jun 2016 13:42:41 +0000 (16:42 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 27 Jun 2016 18:10:35 +0000 (21:10 +0300)
The ap_ht tests used to execute shell commands in the tests using the
subprocess python module. Complete the move to using the cmd_execute()
general function for executing shell commands so that this would also
work on remote setups.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
tests/hwsim/test_ap_ht.py

index ce8710e..9b93cd6 100644 (file)
@@ -8,7 +8,6 @@ import time
 import logging
 logger = logging.getLogger()
 import struct
-import subprocess
 
 import hostapd
 from utils import HwsimSkip, alloc_fail
@@ -17,10 +16,11 @@ from test_ap_csa import csa_supported
 
 def clear_scan_cache(apdev):
     ifname = apdev['ifname']
-    subprocess.call(['ifconfig', ifname, 'up'])
-    subprocess.call(['iw', ifname, 'scan', 'trigger', 'freq', '2412', 'flush'])
+    hostapd.cmd_execute(apdev, ['ifconfig', ifname, 'up'])
+    hostapd.cmd_execute(apdev, ['iw', ifname, 'scan', 'trigger', 'freq', '2412',
+                                'flush'])
     time.sleep(0.1)
-    subprocess.call(['ifconfig', ifname, 'down'])
+    hostapd.cmd_execute(apdev, ['ifconfig', ifname, 'down'])
 
 def set_world_reg(apdev0=None, apdev1=None, dev0=None):
     if apdev0: