From ada054cc30268c5e99e0d92111242c4efff5d75d Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 20 Dec 2016 12:41:17 -0600 Subject: [PATCH] test-runner: Don't use killall killall doesn't wait for the iwd process to clean up, so using it is not enough when cleaning up between tests. Using killall -w also doesn't work since iwd is launched by the script. By the time killall is invoked, the script process is also cleaned up. So when iwd is killed via killall, nobody is there to reap the zombie process (test-runner is running as init, but doesn't do this) The easiest solution is to make the test script itself clean up any iwd processes it launches. This is what has been implemented in the previous patch. --- tools/test-runner.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 641d2e04..bdf76ee5 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -1053,20 +1053,6 @@ static void terminate_iwd(pid_t iwd_pid) kill_process(iwd_pid); } -static void terminate_all_iwd(void) -{ - char *argv[3]; - pid_t pid; - - argv[0] = "killall"; - argv[1] = "iwd"; - argv[2] = NULL; - - pid = execute_program(argv, true); - if (pid < 0) - l_error("Failed to kill all IWD instances"); -} - static bool create_tmpfs_extra_stuff(char **tmpfs_extra_stuff) { size_t i = 0; @@ -1502,10 +1488,9 @@ static void create_network_and_run_tests(const void *key, void *value, remove_absolute_path_dirs(tmpfs_extra_stuff); + /* Script has responsibility to cleanup any iwd instances it started */ if (iwd_pid > 0) terminate_iwd(iwd_pid); - else - terminate_all_iwd(); terminate_medium(medium_pid);