Commit f0a2cc82 authored by Karol Latecki's avatar Karol Latecki Committed by Ben Walker
Browse files

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: default avatarKarol 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 855633a5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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() {