test/common: check if pid is alive before kill
Need to check if process still exists before killing it. Otherwise if process crashed and no longer exists kill will return with "no such process" error and prevent other steps in trap from executing. Change-Id: I4402d06a4fafa09dc13fba4ef9ebeb2b2fc686bb Signed-off-by: Karol Latecki <karol.latecki@intel.com> Reviewed-on: https://review.gerrithub.io/425353 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
855633a597
commit
f0a2cc8247
@ -338,9 +338,11 @@ function killprocess() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if kill -0 $1; then
|
||||
echo "killing process with pid $1"
|
||||
kill $1
|
||||
wait $1
|
||||
fi
|
||||
}
|
||||
|
||||
function iscsicleanup() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user