From dc43293241c1cf2b696a51109b981bbdb7b6c86f Mon Sep 17 00:00:00 2001 From: Jaroslaw Chachulski Date: Wed, 27 Apr 2022 09:20:51 -0400 Subject: [PATCH] test/vhost: Fix test exit when there are NICs without RDMA support We have separated the process_shm function in order to avoid its call-out in "nvmftestinit" when there are no rdma cards Signed-off-by: Jaroslaw Chachulski Change-Id: I42d2d3426b71199a248bbfb238ab3811457c68bd Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12394 Community-CI: Broadcom CI Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu Reviewed-by: Konrad Sztyber Tested-by: SPDK CI Jenkins --- test/nvmf/common.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index 3a3f29ae6..7753c9156 100644 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -396,7 +396,7 @@ function nvmftestinit() { return 1 fi - trap 'process_shm --id $NVMF_APP_SHM_ID || :; nvmftestfini' SIGINT SIGTERM EXIT + trap 'nvmftestfini' SIGINT SIGTERM EXIT prepare_net_devs @@ -411,7 +411,7 @@ function nvmftestinit() { NVMF_SECOND_TARGET_IP=$(echo "$RDMA_IP_LIST" | tail -n +2 | head -n 1) if [ -z $NVMF_FIRST_TARGET_IP ]; then echo "no RDMA NIC for nvmf test" - exit 0 + exit 1 fi elif [[ "$TEST_TRANSPORT" == "tcp" ]]; then NVMF_TRANSPORT_OPTS="$NVMF_TRANSPORT_OPTS -o" @@ -433,6 +433,7 @@ function nvmfappstart() { nvmfpid=$! waitforlisten $nvmfpid timing_exit start_nvmf_tgt + trap 'process_shm --id $NVMF_APP_SHM_ID || :; nvmftestfini' SIGINT SIGTERM EXIT } function nvmftestfini() {