Commit 82f60376 authored by GangCao's avatar GangCao Committed by Tomasz Zawadzki
Browse files

test: properly handle the killprocess case

To check whether the process already killed and if the
process is not there, return error.

This is to fix the below issue:
https://github.com/spdk/spdk/issues/1066



Change-Id: I5f36213237a4b0eed8edbc69e666037cf17488b2
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476127


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
parent f506cc42
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -483,6 +483,10 @@ function killprocess() {
		# wait for the process regardless if its the dummy sudo one
		# or the actual app - it should terminate anyway
		wait $1
	else
		# the process is not there anymore
		echo "Process with pid $1 is not found"
		exit 1
	fi
}

+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ function nvmf_filesystem_part {
	trap - SIGINT SIGTERM EXIT

	killprocess $nvmfpid
	nvmfpid=
}

run_test "suite" "nvmf_filesystem_no_incapsule" nvmf_filesystem_part 0
+1 −0
Original line number Diff line number Diff line
@@ -38,5 +38,6 @@ trap - SIGINT SIGTERM EXIT

nvmfcleanup
killprocess $nvmfpid
nvmfpid=

nvmftestfini
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ function nvmf_shutdown_tc3 {

	# Kill the target half way through
	killprocess $nvmfpid
	nvmfpid=

	# Verify bdevperf exits successfully
	sleep 1