From 9ff6da9961165c62ad6c60467ad61d7c2f6ebf78 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 14 Nov 2018 16:08:55 -0700 Subject: [PATCH] nvmf: Add test that kills initiator with no I/O outstanding This is a more difficult case to handle than killing with I/O outstanding because the target gets no notification that the connection went away. Effectively, this tests that keep alive is working correctly. Change-Id: I5bccea8bc51de6d1d2d40c2648ad7c40cce2c281 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/433360 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto --- test/nvmf/shutdown/shutdown.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/test/nvmf/shutdown/shutdown.sh b/test/nvmf/shutdown/shutdown.sh index 7d4a92af1..2ea196f44 100755 --- a/test/nvmf/shutdown/shutdown.sh +++ b/test/nvmf/shutdown/shutdown.sh @@ -59,7 +59,26 @@ do echo " TransportID \"trtype:RDMA adrfam:IPv4 subnqn:nqn.2016-06.io.spdk:cnode$i traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT\" Nvme$i" >> $testdir/bdevperf.conf done -# Test 1: Kill initiator unexpectedly +# Test 1: Kill the initiator unexpectedly with no I/O outstanding + +# 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=$! +waitforlisten $perfpid /var/tmp/bdevperf.sock +$rpc_py -s /var/tmp/bdevperf.sock wait_subsystem_init + +# Kill bdev_svc +kill -9 $perfpid +rm -f /var/run/spdk_bdev1 + +# Verify the target stays up +sleep 1 +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 + +# Test 2: Kill initiator unexpectedly with I/O outstanding # Run bdevperf $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 10 & @@ -77,7 +96,7 @@ killprocess $perfpid sleep 1 kill -0 $pid -# Test 2: Kill the target unexpectedly +# Test 3: Kill the target unexpectedly with I/O outstanding # Run bdevperf $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 10 &