]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: remote: Kill correct hostapd/wpa_supplicant process
authorJanusz Dziedzic <janusz.dziedzic@gmail.com>
Sun, 12 Jan 2020 22:02:16 +0000 (23:02 +0100)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2020 13:13:47 +0000 (15:13 +0200)
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>
tests/remote/config.py
tests/remote/hwsim_wrapper.py
tests/remote/rutils.py

index 55c6013163f57eeac23b7876bed8ea08ca90ecd3..5a6b728ac10fed70260647b951467cb43fd8fcd7 100644 (file)
@@ -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",
index c1bbb27d7c40adebae12d4c76a96e64f3c211544..36df8d7a82db1e906fd7e86e88a7a46714b78bff 100644 (file)
@@ -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()
index e80d7dc0ea4d76d72db7ba313dae5e90e8925b1c..70ad82c877d878c9c905b0a3bde0ce4191ea982d 100644 (file)
@@ -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