2017-03-27 05:33:06 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2018-02-27 22:14:08 +00:00
|
|
|
source $rootdir/test/common/autotest_common.sh
|
2017-12-05 22:07:48 +00:00
|
|
|
source $rootdir/scripts/common.sh
|
2017-03-27 05:33:06 +00:00
|
|
|
source $rootdir/test/nvmf/common.sh
|
|
|
|
|
2018-09-11 13:26:14 +00:00
|
|
|
rpc_py="$rootdir/scripts/rpc.py"
|
2017-03-27 05:33:06 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-05-16 19:38:53 +00:00
|
|
|
nvmftestinit
|
2018-12-03 20:08:59 +00:00
|
|
|
|
2017-04-21 17:15:28 +00:00
|
|
|
if [ ! -d /usr/src/fio ]; then
|
|
|
|
echo "FIO not available"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-03-27 05:33:06 +00:00
|
|
|
timing_enter fio
|
2017-05-27 00:13:55 +00:00
|
|
|
timing_enter start_nvmf_tgt
|
2017-03-27 05:33:06 +00:00
|
|
|
|
2018-10-18 22:22:58 +00:00
|
|
|
$NVMF_APP -m 0xF &
|
2017-03-27 05:33:06 +00:00
|
|
|
nvmfpid=$!
|
|
|
|
|
2019-05-13 19:11:00 +00:00
|
|
|
trap "process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1" SIGINT SIGTERM EXIT
|
2017-03-27 05:33:06 +00:00
|
|
|
|
2017-11-09 23:33:29 +00:00
|
|
|
waitforlisten $nvmfpid
|
2019-05-16 21:39:52 +00:00
|
|
|
$rpc_py nvmf_create_transport -t RDMA -u 8192
|
2017-05-27 00:13:55 +00:00
|
|
|
timing_exit start_nvmf_tgt
|
2017-03-27 05:33:06 +00:00
|
|
|
|
2019-05-01 16:21:59 +00:00
|
|
|
$rpc_py construct_malloc_bdev 64 512 -b Malloc1
|
2018-09-10 19:04:31 +00:00
|
|
|
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
|
2019-05-01 16:21:59 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc1
|
2019-06-03 16:15:25 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t rdma -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
2017-03-27 05:33:06 +00:00
|
|
|
|
2017-06-13 18:50:32 +00:00
|
|
|
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
|
|
|
|
|
2017-12-05 22:07:48 +00:00
|
|
|
# Test fio_plugin as host with malloc backend
|
|
|
|
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=RDMA adrfam=IPv4 \
|
2019-06-03 16:15:25 +00:00
|
|
|
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
|
2019-01-08 21:56:39 +00:00
|
|
|
|
|
|
|
# second test mocking multiple SGL elements
|
|
|
|
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/mock_sgl_config.fio --filename="trtype=RDMA adrfam=IPv4 \
|
2019-06-03 16:15:25 +00:00
|
|
|
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
|
2017-03-27 05:33:06 +00:00
|
|
|
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
|
|
|
|
|
2017-12-05 22:07:48 +00:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
|
|
|
# Test fio_plugin as host with nvme lvol backend
|
|
|
|
bdfs=$(iter_pci_class_code 01 08 02)
|
2018-12-04 23:30:11 +00:00
|
|
|
$rpc_py construct_nvme_bdev -b Nvme0 -t PCIe -a $(echo $bdfs | awk '{ print $1 }') -i $NVMF_FIRST_TARGET_IP
|
2019-05-03 17:33:21 +00:00
|
|
|
ls_guid=$($rpc_py construct_lvol_store -c 1073741824 Nvme0n1 lvs_0)
|
2019-05-03 16:21:10 +00:00
|
|
|
get_lvs_free_mb $ls_guid
|
2019-05-01 16:21:59 +00:00
|
|
|
$rpc_py construct_lvol_bdev -l lvs_0 lbd_0 $free_mb
|
2018-09-10 19:04:31 +00:00
|
|
|
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode2 -a -s SPDK00000000000001
|
2019-05-01 16:21:59 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode2 lvs_0/lbd_0
|
2019-06-03 16:15:25 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode2 -t rdma -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
2017-12-05 22:07:48 +00:00
|
|
|
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=RDMA adrfam=IPv4 \
|
2019-06-03 16:15:25 +00:00
|
|
|
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
|
2017-12-05 22:07:48 +00:00
|
|
|
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode2
|
|
|
|
|
|
|
|
# Test fio_plugin as host with nvme lvol nested backend
|
2019-05-03 17:33:21 +00:00
|
|
|
ls_nested_guid=$($rpc_py construct_lvol_store --clear-method none lvs_0/lbd_0 lvs_n_0)
|
2019-05-03 16:21:10 +00:00
|
|
|
get_lvs_free_mb $ls_nested_guid
|
2019-05-01 16:21:59 +00:00
|
|
|
$rpc_py construct_lvol_bdev -l lvs_n_0 lbd_nest_0 $free_mb
|
2018-09-10 19:04:31 +00:00
|
|
|
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode3 -a -s SPDK00000000000001
|
2019-05-03 16:21:10 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode3 lvs_n_0/lbd_nest_0
|
2019-06-03 16:15:25 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode3 -t rdma -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
2017-12-05 22:07:48 +00:00
|
|
|
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=RDMA adrfam=IPv4 \
|
2019-06-03 16:15:25 +00:00
|
|
|
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
|
2017-12-05 22:07:48 +00:00
|
|
|
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode3
|
|
|
|
|
|
|
|
sync
|
|
|
|
# Delete lvol_bdev and destroy lvol_store.
|
2019-05-03 16:21:10 +00:00
|
|
|
$rpc_py destroy_lvol_bdev lvs_n_0/lbd_nest_0
|
2017-12-05 22:07:48 +00:00
|
|
|
$rpc_py destroy_lvol_store -l lvs_n_0
|
2019-05-01 16:21:59 +00:00
|
|
|
$rpc_py destroy_lvol_bdev lvs_0/lbd_0
|
2017-12-05 22:07:48 +00:00
|
|
|
$rpc_py destroy_lvol_store -l lvs_0
|
2018-07-26 12:54:20 +00:00
|
|
|
$rpc_py delete_nvme_controller Nvme0
|
2017-12-05 22:07:48 +00:00
|
|
|
fi
|
|
|
|
|
2017-03-27 05:33:06 +00:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
2019-04-05 18:15:10 +00:00
|
|
|
rm -f ./local-test-0-verify.state
|
2019-05-16 19:38:53 +00:00
|
|
|
nvmftestfini
|
2017-03-27 05:33:06 +00:00
|
|
|
timing_exit fio
|