tests: remote: Kill correct hostapd/wpa_supplicant process
Kill hostapd and wpa_supplicant based on the configuration parameters. Previously, we could have killed wrong processes. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
This commit is contained in:
parent
ec5de19549
commit
0de85869a8
3 changed files with 12 additions and 6 deletions
|
@ -17,8 +17,8 @@ logger = logging.getLogger()
|
||||||
# definitions in the format as below. In other case HWSIM cfg will be used.
|
# definitions in the format as below. In other case HWSIM cfg will be used.
|
||||||
#
|
#
|
||||||
setup_params = {"setup_hw" : "./tests/setup_hw.sh",
|
setup_params = {"setup_hw" : "./tests/setup_hw.sh",
|
||||||
"hostapd" : "./tests/hostapd",
|
"hostapd" : "./tests/hostapd-rt",
|
||||||
"wpa_supplicant" : "./tests/wpa_supplicant",
|
"wpa_supplicant" : "./tests/wpa_supplicant-rt",
|
||||||
"iperf" : "iperf",
|
"iperf" : "iperf",
|
||||||
"wlantest" : "./tests/wlantest",
|
"wlantest" : "./tests/wlantest",
|
||||||
"wlantest_cli" : "./tests/wlantest_cli",
|
"wlantest_cli" : "./tests/wlantest_cli",
|
||||||
|
|
|
@ -88,10 +88,10 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test):
|
||||||
monitor.remove(dut_host)
|
monitor.remove(dut_host)
|
||||||
|
|
||||||
for ref_host in ref_hosts:
|
for ref_host in ref_hosts:
|
||||||
ref_host.execute(["killall", "wpa_supplicant"])
|
rutils.kill_wpasupplicant(ref_host, setup_params)
|
||||||
ref_host.get_logs(local_log_dir)
|
ref_host.get_logs(local_log_dir)
|
||||||
for dut_host in dut_hosts:
|
for dut_host in dut_hosts:
|
||||||
dut_host.execute(["killall", "hostapd"])
|
rutils.kill_hostapd(dut_host, setup_params)
|
||||||
dut_host.get_logs(local_log_dir)
|
dut_host.get_logs(local_log_dir)
|
||||||
if mon is not None:
|
if mon is not None:
|
||||||
wlantest.Wlantest.reset_remote_wlantest()
|
wlantest.Wlantest.reset_remote_wlantest()
|
||||||
|
@ -113,10 +113,10 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test):
|
||||||
monitor.remove(dut_host)
|
monitor.remove(dut_host)
|
||||||
|
|
||||||
for ref_host in ref_hosts:
|
for ref_host in ref_hosts:
|
||||||
ref_host.execute(["killall", "wpa_supplicant"])
|
rutils.kill_wpasupplicant(ref_host, setup_params)
|
||||||
ref_host.get_logs(local_log_dir)
|
ref_host.get_logs(local_log_dir)
|
||||||
for dut_host in dut_hosts:
|
for dut_host in dut_hosts:
|
||||||
dut_host.execute(["killall", "hostapd"])
|
rutils.kill_hostapd(dut_host, setup_params)
|
||||||
dut_host.get_logs(local_log_dir)
|
dut_host.get_logs(local_log_dir)
|
||||||
if mon is not None:
|
if mon is not None:
|
||||||
wlantest.Wlantest.reset_remote_wlantest()
|
wlantest.Wlantest.reset_remote_wlantest()
|
||||||
|
|
|
@ -138,6 +138,12 @@ def run_wpasupplicant(host, setup_params):
|
||||||
if status != 0:
|
if status != 0:
|
||||||
raise Exception("Could not run wpa_supplicant: " + buf)
|
raise Exception("Could not run wpa_supplicant: " + buf)
|
||||||
|
|
||||||
|
def kill_wpasupplicant(host, setup_params):
|
||||||
|
host.execute(['killall', setup_params['wpa_supplicant']])
|
||||||
|
|
||||||
|
def kill_hostapd(host, setup_params):
|
||||||
|
host.execute(['killall', setup_params['hostapd']])
|
||||||
|
|
||||||
def get_ap_params(channel="1", bw="HT20", country="US", security="open", ht_capab=None, vht_capab=None):
|
def get_ap_params(channel="1", bw="HT20", country="US", security="open", ht_capab=None, vht_capab=None):
|
||||||
ssid = "test_" + channel + "_" + security + "_" + bw
|
ssid = "test_" + channel + "_" + security + "_" + bw
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue