nvmf: Update shutdown test to use wait_for_subsystems RPC

This makes it correctly wait until the bdevperf test has started
running prior to starting the sleep to allow I/O to begin.

Change-Id: Ia6c004ede1854e836479dd3a0707a91551f954bc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/433359
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ben Walker 2018-11-14 14:53:35 -07:00 committed by Jim Harris
parent 9a6fe60faa
commit f64bc0d10c

View File

@ -62,9 +62,13 @@ done
# Test 1: Kill initiator unexpectedly # Test 1: Kill initiator unexpectedly
# Run bdevperf # Run bdevperf
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 20 & $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 10 &
perfpid=$! perfpid=$!
sleep 10 waitforlisten $perfpid /var/tmp/bdevperf.sock
$rpc_py -s /var/tmp/bdevperf.sock wait_subsystem_init
# Sleep for a few seconds to allow I/O to begin
sleep 5
# Kill bdevperf half way through # Kill bdevperf half way through
killprocess $perfpid killprocess $perfpid
@ -76,14 +80,18 @@ kill -0 $pid
# Test 2: Kill the target unexpectedly # Test 2: Kill the target unexpectedly
# Run bdevperf # Run bdevperf
$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 20 & $rootdir/test/bdev/bdevperf/bdevperf -r /var/tmp/bdevperf.sock -i 0 -c $testdir/bdevperf.conf -q 64 -o 65536 -w verify -t 10 &
perfpid=$! perfpid=$!
waitforlisten $perfpid /var/tmp/bdevperf.sock
$rpc_py -s /var/tmp/bdevperf.sock wait_subsystem_init
# Expand the trap to clean up bdevperf if something goes wrong # Expand the trap to clean up bdevperf if something goes wrong
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $pid; kill -9 $perfpid; nvmfcleanup; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $pid; kill -9 $perfpid; nvmfcleanup; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
# Sleep for a few seconds to allow I/O to begin
sleep 5
# Kill the target half way through # Kill the target half way through
sleep 10
killprocess $pid killprocess $pid
# Verify bdevperf exits successfully # Verify bdevperf exits successfully