test/fio: export single variable for running fio_plugins

This patch adds functions in autotest_common.sh,
fio_bdev() and fio_nvme() for their respective plugins.
It simplifies its usage throughout the scripts.

Additionally will help with expanding the fio cmd
line with nessecary changes only in single place.

This will be used in next patch in series to
LD_PRELOAD ASAN before fio_plugin.

Note: Did not implement changes for perf scripts,
since they are usualy run separately and didn't want
to affect those.
Similarly didn't change vhost initiator tests,
because the exported directories do not work for
inside the VM. Will need to think of a way to change it
there as well.

Change-Id: Idf750ee7aa9d5e30efc0ce430d15fa45ceccb203
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456314
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2019-05-30 02:59:51 -04:00 committed by Darek Stojaczyk
parent 2761079168
commit 3b9db6c403
8 changed files with 29 additions and 16 deletions

View File

@ -4,17 +4,16 @@ set -e
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
plugindir=$rootdir/examples/bdev/fio_plugin
rpc_py="$rootdir/scripts/rpc.py"
function run_fio()
{
if [ $RUN_NIGHTLY -eq 0 ]; then
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --iodepth=8 --bs=4k --runtime=10 $testdir/bdev.fio "$@"
fio_bdev --ioengine=spdk_bdev --iodepth=8 --bs=4k --runtime=10 $testdir/bdev.fio "$@"
elif [ $RUN_NIGHTLY_FAILING -eq 1 ]; then
# Use size 192KB which both exceeds typical 128KB max NVMe I/O
# size and will cross 128KB Intel DC P3700 stripe boundaries.
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --iodepth=128 --bs=192k --runtime=100 $testdir/bdev.fio "$@"
fio_bdev --ioengine=spdk_bdev --iodepth=128 --bs=192k --runtime=100 $testdir/bdev.fio "$@"
fi
}

View File

@ -755,6 +755,24 @@ function fio_config_add_job()
echo "filename=$filename" >> $config_file
}
function fio_bdev()
{
# Setup fio binary cmd line
local fio_dir="/usr/src/fio"
local bdev_plugin="$rootdir/examples/bdev/fio_plugin/fio_plugin"
LD_PRELOAD="$bdev_plugin" "$fio_dir"/fio "$@"
}
function fio_nvme()
{
# Setup fio binary cmd line
local fio_dir="/usr/src/fio"
local nvme_plugin="$rootdir/examples/nvme/fio_plugin/fio_plugin"
LD_PRELOAD="$nvme_plugin" "$fio_dir"/fio "$@"
}
function get_lvs_free_mb()
{
local lvs_uuid=$1

View File

@ -4,7 +4,6 @@ set -e
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
plugindir=$rootdir/examples/bdev/fio_plugin
source $rootdir/test/common/autotest_common.sh
@ -37,7 +36,7 @@ fi
for test in ${tests[@]}; do
timing_enter $test
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio $testdir/config/fio/$test.fio
fio_bdev $testdir/config/fio/$test.fio
timing_exit $test
done

View File

@ -167,7 +167,7 @@ if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
timing_enter fio_plugin
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
for bdf in $(iter_pci_class_code 01 08 02); do
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
fio_nvme $PLUGIN_DIR/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
report_test_completion "bdev_fio"
done
timing_exit fio_plugin

View File

@ -37,11 +37,11 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
# 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=$TEST_TRANSPORT adrfam=IPv4 \
fio_nvme $PLUGIN_DIR/example_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
# second test mocking multiple SGL elements
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/mock_sgl_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
fio_nvme $PLUGIN_DIR/mock_sgl_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
@ -55,7 +55,7 @@ if [ $RUN_NIGHTLY -eq 1 ]; then
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode2 -a -s SPDK00000000000001
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode2 lvs_0/lbd_0
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode2 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
fio_nvme $PLUGIN_DIR/example_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode2
@ -66,7 +66,7 @@ if [ $RUN_NIGHTLY -eq 1 ]; then
$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode3 -a -s SPDK00000000000001
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode3 lvs_n_0/lbd_nest_0
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode3 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
fio_nvme $PLUGIN_DIR/example_config.fio --filename="trtype=$TEST_TRANSPORT adrfam=IPv4 \
traddr=$NVMF_FIRST_TARGET_IP trsvcid=$NVMF_PORT ns=1"
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode3

View File

@ -7,7 +7,7 @@ plugindir=$rootdir/examples/bdev/fio_plugin
source $rootdir/test/common/autotest_common.sh
function fio_verify(){
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio $curdir/test.fio --aux-path=/tmp/ --ioengine=spdk_bdev $@
fio_bdev $curdir/test.fio --aux-path=/tmp/ --ioengine=spdk_bdev $@
}
function cleanup(){

View File

@ -78,8 +78,7 @@ function remove_kernel_vhost()
trap 'rm -f *.state $rootdir/spdk.tar.gz $rootdir/fio.tar.gz $(get_vhost_dir)/Virtio0;\
remove_kernel_vhost; error_exit "${FUNCNAME}""${LINENO}"' ERR SIGTERM SIGABRT
function run_spdk_fio() {
LD_PRELOAD=$PLUGIN_DIR/fio_plugin $FIO_PATH/fio --ioengine=spdk_bdev\
"$@" --spdk_mem=1024 --spdk_single_seg=1
fio_bdev --ioengine=spdk_bdev "$@" --spdk_mem=1024 --spdk_single_seg=1
}
function create_bdev_config()

View File

@ -7,12 +7,10 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/vhost/common.sh
PLUGIN_DIR=$rootdir/examples/bdev/fio_plugin
FIO_PATH="/usr/src/fio"
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
function run_spdk_fio() {
LD_PRELOAD=$PLUGIN_DIR/fio_plugin $FIO_PATH/fio --ioengine=spdk_bdev \
fio_bdev --ioengine=spdk_bdev \
"$rootdir/test/vhost/common/fio_jobs/default_initiator.job" --runtime=10 --rw=randrw \
--spdk_mem=1024 --spdk_single_seg=1 --spdk_conf=$testdir/bdev.conf "$@"
}