From ec14a7b6e36826bc822ddef2f7d101dd1822a2c5 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Thu, 2 Feb 2023 11:52:46 +0100 Subject: [PATCH] test/multipath: print bdevperf logs on failure This should help debugging issue #2865. Additionally, moved the trap code to a separate function, as it was getting too large. Signed-off-by: Konrad Sztyber Change-Id: Ieb4881cdfed4e5d88e38859fa0807b673a87913b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16664 Reviewed-by: Michal Berger Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/nvmf/host/multipath.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/nvmf/host/multipath.sh b/test/nvmf/host/multipath.sh index 0d463971a..004073f61 100755 --- a/test/nvmf/host/multipath.sh +++ b/test/nvmf/host/multipath.sh @@ -19,6 +19,14 @@ bdevperf_rpc_sock=/var/tmp/bdevperf.sock # NQN prefix to use for subsystem NQNs NQN=nqn.2016-06.io.spdk:cnode1 +cleanup() { + process_shm --id $NVMF_APP_SHM_ID || true + cat $testdir/try.txt + rm -f $testdir/try.txt + killprocess $bdevperf_pid + nvmftestfini +} + nvmftestinit nvmfappstart -m 0x3 @@ -35,7 +43,7 @@ $rpc_py nvmf_subsystem_add_listener $NQN -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGE $rootdir/build/examples/bdevperf -m 0x4 -z -r $bdevperf_rpc_sock -q 128 -o 4096 -w verify -t 90 &> $testdir/try.txt & bdevperf_pid=$! -trap 'process_shm --id $NVMF_APP_SHM_ID; rm -f $testdir/try.txt; killprocess $bdevperf_pid; nvmftestfini; exit 1' SIGINT SIGTERM EXIT +trap 'cleanup; exit 1' SIGINT SIGTERM EXIT waitforlisten $bdevperf_pid $bdevperf_rpc_sock # Create a controller and set multipath behavior