test/nvmf: Fix trap

Also, add at_app_exit() to make sure that all vhost and qemu
instances are terminated as well.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I917f1cb1b02d18b78a482d754a19f509e580fc98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15185
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Michal Berger 2022-10-31 09:25:11 +01:00 committed by Konrad Sztyber
parent 6a86385dad
commit b76cb37ce4

View File

@ -35,7 +35,7 @@ mkdir -p "$(get_vhost_dir 3)"
vhostpid=$!
waitforlisten $vhostpid $NVMF_SOCK
trap 'process_shm --id $NVMF_APP_SHM_ID; killprocess $vhostpid nvmftestfini; exit 1' SIGINT SIGTERM EXIT
trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; at_app_exit; exit 1' SIGINT SIGTERM EXIT
# Configure NVMF tgt on host machine
malloc_bdev="$($NVMF_RPC bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"