3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09:23 +01:00

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.
This commit is contained in:
Denis Kenzior 2016-12-20 12:41:17 -06:00
parent ed69774dbc
commit ada054cc30

View File

@ -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);