From 8bc67f2db3d2e42ab06133ef9fd7c6c5df0cdccb Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Tue, 27 Aug 2019 13:02:29 +0200 Subject: [PATCH] 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: Karol Latecki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466412 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- test/json_config/json_config.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/json_config/json_config.sh b/test/json_config/json_config.sh index 2cc9f8729..c481a87b1 100755 --- a/test/json_config/json_config.sh +++ b/test/json_config/json_config.sh @@ -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[@]}"