From 36d1cf3ad8a8e75bcdaa8b90c695495c5f888ae7 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 30 Apr 2019 14:12:17 -0700 Subject: [PATCH] test/nvmf: improve timing checks in shutdown.sh Signed-off-by: Jim Harris Change-Id: I51c63cf73085b38056f19870f1aa0659895d7093 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452741 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk --- test/nvmf/shutdown/shutdown.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/nvmf/shutdown/shutdown.sh b/test/nvmf/shutdown/shutdown.sh index da4df979a..d8938f25a 100755 --- a/test/nvmf/shutdown/shutdown.sh +++ b/test/nvmf/shutdown/shutdown.sh @@ -46,6 +46,7 @@ fi touch $testdir/bdevperf.conf echo "[Nvme]" > $testdir/bdevperf.conf +timing_enter create_subsystems # Create subsystems for i in `seq 1 $num_subsystems` do @@ -58,9 +59,11 @@ do echo " TransportID \"trtype:RDMA adrfam:IPv4 subnqn:nqn.2016-06.io.spdk:cnode$i traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT hostaddr:$NVMF_FIRST_TARGET_IP\" Nvme$i" >> $testdir/bdevperf.conf done +timing_exit create_subsystems # Test 1: Kill the initiator unexpectedly with no I/O outstanding +timing_enter test1 # Run bdev_svc, which connects but does not issue I/O $rootdir/test/app/bdev_svc/bdev_svc -i 1 -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf & perfpid=$! @@ -77,9 +80,11 @@ kill -0 $pid # Connect with bdevperf and confirm it works $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 1 +timing_exit test1 # Test 2: Kill initiator unexpectedly with I/O outstanding +timing_enter test2 # Run bdevperf $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 10 & perfpid=$! @@ -95,9 +100,11 @@ killprocess $perfpid # Verify the target stays up sleep 1 kill -0 $pid +timing_exit test2 # Test 3: Kill the target unexpectedly with I/O outstanding +timing_enter test3 # Run bdevperf $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 10 & perfpid=$! @@ -118,11 +125,16 @@ sleep 1 # TODO: Right now the NVMe-oF initiator will not correctly detect broken connections # and so it will never shut down. Just kill it. kill -9 $perfpid +timing_exit test3 rm -f ./local-job0-0-verify.state rm -rf $testdir/bdevperf.conf trap - SIGINT SIGTERM EXIT +timing_enter cleanup nvmfcleanup +timing_exit cleanup +timing_enter testfini nvmftestfini $1 +timing_exit testfini timing_exit shutdown