Commit 8bc67f2d authored by Karol Latecki's avatar Karol Latecki Committed by Jim Harris
Browse files

test/json_config: kill spdk target outside of "if" instruction



In case there is an error while killing the process we won't
be able to fail the test, because non-zero return codes
are not respected by set -e option if they originate from
inside "if" instruction".

Change-Id: I2da2a00df52ae3530152a514cf86036079d61430
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466412


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>
parent 19baaa9a
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -385,11 +385,7 @@ function json_config_test_fini() {
	local ret=0

	if [[ -n "${app_pid[initiator]}" ]]; then
		if ! json_config_test_shutdown_app initiator; then
			kill -9 ${app_pid[initiator]}
			app_pid[initiator]=
			ret=1
		fi
		killprocess ${app_pid[initiator]}
	fi

	if [[ -n "${app_pid[target]}" ]]; then
@@ -398,12 +394,7 @@ function json_config_test_fini() {
		cleanup_bdev_subsystem_config

		# SPDK_TEST_NVMF: Should we clear something?

		if ! json_config_test_shutdown_app target; then
			kill -9 ${app_pid[target]}
			app_pid[target]=
			ret=1
		fi
		killprocess ${app_pid[target]}
	fi

	rm -f "${configs_path[@]}"