3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/test
/common
/autotest_common.sh
6 source $rootdir/test
/nvmf
/common.sh
11 rpc_py
="$rootdir/scripts/rpc.py"
19 $rpc_py nvmf_create_transport
-t $TEST_TRANSPORT -u 8192
21 malloc_bdevs
="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE) "
22 malloc_bdevs
+="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
23 # Create a RAID-0 bdev from two malloc bdevs
24 raid_malloc_bdevs
="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE) "
25 raid_malloc_bdevs
+="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
26 $rpc_py construct_raid_bdev
-n raid0
-s 64 -r 0 -b "$raid_malloc_bdevs"
28 $rpc_py nvmf_subsystem_create nqn
.2016-06.io.spdk
:cnode1
-a -s SPDK00000000000001
29 for malloc_bdev
in $malloc_bdevs; do
30 $rpc_py nvmf_subsystem_add_ns nqn
.2016-06.io.spdk
:cnode1
"$malloc_bdev"
32 $rpc_py nvmf_subsystem_add_listener nqn
.2016-06.io.spdk
:cnode1
-t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
34 # Append the raid0 bdev into subsystem
35 $rpc_py nvmf_subsystem_add_ns nqn
.2016-06.io.spdk
:cnode1 raid0
37 nvme connect
-t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
43 $rootdir/scripts
/fio.py
-p nvmf
-i 4096 -d 1 -t write -r 1 -v
44 $rootdir/scripts
/fio.py
-p nvmf
-i 4096 -d 1 -t randwrite
-r 1 -v
45 $rootdir/scripts
/fio.py
-p nvmf
-i 4096 -d 128 -t write -r 1 -v
46 $rootdir/scripts
/fio.py
-p nvmf
-i 4096 -d 128 -t randwrite
-r 1 -v
50 #start hotplug test case
51 $rootdir/scripts
/fio.py
-p nvmf
-i 4096 -d 1 -t read -r 10 &
57 $rpc_py destroy_raid_bdev
"raid0"
58 for malloc_bdev
in $malloc_bdevs; do
59 $rpc_py delete_malloc_bdev
"$malloc_bdev"
65 nvme disconnect
-n "nqn.2016-06.io.spdk:cnode1" || true
67 if [ $fio_status -eq 0 ]; then
68 echo "nvmf hotplug test: fio successful - expected failure"
73 echo "nvmf hotplug test: fio failed as expected"
77 $rpc_py delete_nvmf_subsystem nqn
.2016-06.io.spdk
:cnode1
79 rm -f .
/local-job0-0-verify.state
80 rm -f .
/local-job1-1-verify.state
81 rm -f .
/local-job2-2-verify.state
83 trap - SIGINT SIGTERM EXIT