[PATCH 02/12] tests: remote: kill correct hostapd/supplicant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kill hostapd and wpa_supplicant base on
config params.
Before we could kill wrong processes.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
 tests/remote/config.py        | 4 ++--
 tests/remote/hwsim_wrapper.py | 8 ++++----
 tests/remote/rutils.py        | 6 ++++++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/remote/config.py b/tests/remote/config.py
index 55c601316..5a6b728ac 100644
--- a/tests/remote/config.py
+++ b/tests/remote/config.py
@@ -17,8 +17,8 @@ logger = logging.getLogger()
 # definitions in the format as below. In other case HWSIM cfg will be used.
 #
 setup_params = {"setup_hw" : "./tests/setup_hw.sh",
-                "hostapd" : "./tests/hostapd",
-                "wpa_supplicant" : "./tests/wpa_supplicant",
+                "hostapd" : "./tests/hostapd-rt",
+                "wpa_supplicant" : "./tests/wpa_supplicant-rt",
                 "iperf" : "iperf",
                 "wlantest" : "./tests/wlantest",
                 "wlantest_cli" : "./tests/wlantest_cli",
diff --git a/tests/remote/hwsim_wrapper.py b/tests/remote/hwsim_wrapper.py
index c1bbb27d7..36df8d7a8 100644
--- a/tests/remote/hwsim_wrapper.py
+++ b/tests/remote/hwsim_wrapper.py
@@ -88,10 +88,10 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test):
             monitor.remove(dut_host)
 
         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)
         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)
         if mon is not None:
             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)
 
         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)
         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)
         if mon is not None:
             wlantest.Wlantest.reset_remote_wlantest()
diff --git a/tests/remote/rutils.py b/tests/remote/rutils.py
index 70255b999..5e8a86021 100644
--- a/tests/remote/rutils.py
+++ b/tests/remote/rutils.py
@@ -138,6 +138,12 @@ def run_wpasupplicant(host, setup_params):
     if status != 0:
         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):
     ssid = "test_" + channel + "_" + security + "_" + bw
 
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux