Commit 39dce00b authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

test: add FreeBSD-specific ps options to get process name



Fixes issue #1145.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ifee3d8e041ca2f7acfb3e00c001e77027bf5cdb8

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/970


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 2b43f635
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -495,7 +495,12 @@ function killprocess() {
	fi

	if kill -0 $1; then
		if [ "$(ps --no-headers -o comm= $1)" = "sudo" ]; then
		if [ $(uname) = Linux ]; then
			process_name=$(ps --no-headers -o comm= $1)
		else
			process_name=$(ps -c -o command $1 | tail -1)
		fi
		if [ "$process_name" = "sudo" ]; then
			# kill the child process, which is the actual app
			# (assume $1 has just one child)
			local child