From ded1ba146c24dfc8e71c4b9e5c47d46f9fc90737 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 4 Feb 2022 07:25:32 +0900 Subject: [PATCH] test/nvmf_failover: Rename rpc_pid by run_test_pid and print log if failed test/bdev/bdevperf/bdevperf.py invokes a process to perform test case rather than processing RPC. run_test_pid may be a better name than rpc_pid. Besides, if the execution of the test hung up, try.txt is helpful to investigate the cause. So print try.txt if the execution of the test fails. Signed-off-by: Shuhei Matsumoto Change-Id: Iab973f55dde2ef793fc0d3f1a36b3b59b168f579 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11400 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk --- test/nvmf/host/failover.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/nvmf/host/failover.sh b/test/nvmf/host/failover.sh index df7b661e3..88f4c6b59 100755 --- a/test/nvmf/host/failover.sh +++ b/test/nvmf/host/failover.sh @@ -33,13 +33,13 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR $rootdir/test/bdev/bdevperf/bdevperf -z -r $bdevperf_rpc_sock -q 128 -o 4096 -w verify -t 10 -f &> $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 'process_shm --id $NVMF_APP_SHM_ID; cat $testdir/try.txt; rm -f $testdir/try.txt; killprocess $bdevperf_pid; nvmftestfini; exit 1' SIGINT SIGTERM EXIT waitforlisten $bdevperf_pid $bdevperf_rpc_sock $rpc_py -s $bdevperf_rpc_sock bdev_nvme_attach_controller -b NVMe0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -f ipv4 -n nqn.2016-06.io.spdk:cnode1 $rpc_py -s $bdevperf_rpc_sock bdev_nvme_attach_controller -b NVMe0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_SECOND_PORT -f ipv4 -n nqn.2016-06.io.spdk:cnode1 $rootdir/test/bdev/bdevperf/bdevperf.py -s $bdevperf_rpc_sock perform_tests & -rpc_pid=$! +run_test_pid=$! sleep 1 @@ -59,7 +59,7 @@ sleep 1 $rpc_py nvmf_subsystem_remove_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_THIRD_PORT -wait $rpc_pid +wait $run_test_pid killprocess $bdevperf_pid @@ -90,9 +90,9 @@ $rpc_py -s $bdevperf_rpc_sock bdev_nvme_detach_controller NVMe0 -t $TEST_TRANSPO sleep 3 $rpc_py -s $bdevperf_rpc_sock bdev_nvme_get_controllers | grep -q NVMe0 $rootdir/test/bdev/bdevperf/bdevperf.py -s $bdevperf_rpc_sock perform_tests & -rpc_pid=$! +run_test_pid=$! -wait $rpc_pid +wait $run_test_pid cat $testdir/try.txt $rpc_py -s $bdevperf_rpc_sock bdev_nvme_get_controllers | grep -q NVMe0