tests: Make FST kill_pid() more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 22 Aug 2016 10:17:44 +0000 (13:17 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 22 Aug 2016 14:44:05 +0000 (17:44 +0300)
commitd952f021361c428d7c9e947d57c3bf4a1706f69c
treedf6164d969070cd425f43a3a65915c522c6fdf89
parent7509b550f6fbdb1a336c554d00afab2ec5d9e4a0
tests: Make FST kill_pid() more robust

It looks like the attempt to read the process id from a PID file can
return empty data. This resulted in kill_pid() failing to kill the
process and all the following FST test cases using the extra interface
failing. While the PID file is really supposed to have a valid PID value
when we get this far, it is better to try multiple times to avoid
failing large number of test cases.

The current os_daemonize() implementation ends up calling daemon() first
and then writing the PID file from the remaining process that is running
in the background. This leaves a short race condition where an external
process that started hostapd/wpa_supplicant could end up trying to read
the PID file before it has been written.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_fst_config.py