tests: Use cmd_execute() in ap_ht clear_scan_cache()

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>
This commit is contained in:
Jonathan Afek 2016-06-07 16:42:41 +03:00 committed by Jouni Malinen
parent 3e3cbbd031
commit 31209e1434

View 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: