From 053c15b32b4ffe5e47ccc82f3126c198377754b2 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 2 Mar 2020 20:55:44 +0100 Subject: [PATCH] fio: Remove hardcoded path to fio repo The hardcoded path is replaced with $CONFIG_FIO_SOURCE_DIR as defined during the compile time. Additionally, all checks which determine if fio is available are now based on $CONFIG_FIO_PLUGIN=y knob instead of the presence of the fio repo. Change-Id: Ie469747f3863c9561f53d32e8c3f29778afaaf74 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1108 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Darek Stojaczyk --- test/bdev/blockdev.sh | 2 +- test/common/autotest_common.sh | 18 +++++++++--------- test/ftl/fio.sh | 2 +- test/iscsi_tgt/perf/iscsi_target.sh | 2 +- test/nvme/nvme.sh | 2 +- test/nvme/perf/common.sh | 2 +- test/nvmf/host/fio.sh | 2 +- test/vhost/initiator/blockdev.sh | 2 +- test/vhost/perf_bench/vhost_perf.sh | 4 ++-- test/vmd/vmd.sh | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/bdev/blockdev.sh b/test/bdev/blockdev.sh index 80b54303c..88ca3ff13 100755 --- a/test/bdev/blockdev.sh +++ b/test/bdev/blockdev.sh @@ -299,7 +299,7 @@ hello_world_bdev=${bdev_list[0]} run_test "bdev_hello_world" $rootdir/examples/bdev/hello_world/hello_bdev -c $conf_file -b $hello_world_bdev run_test "bdev_bounds" bdev_bounds run_test "bdev_nbd" nbd_function_test $conf_file "$bdevs_name" -if [ -d /usr/src/fio ]; then +if [[ $CONFIG_FIO_PLUGIN == y ]]; then if [ "$test_type" = "nvme" ] || [ "$test_type" = "gpt" ]; then # TODO: once we get real multi-ns drives, re-enable this test for NVMe. echo "skipping fio tests on NVMe due to multi-ns failures." diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 5c748cfaa..cad88edfb 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -122,10 +122,10 @@ cat << EOL >> "$asan_suppression_file" leak:spdk_fs_alloc_thread_ctx # Suppress known leaks in fio project -leak:/usr/src/fio/parse.c -leak:/usr/src/fio/iolog.c -leak:/usr/src/fio/init.c -leak:/usr/src/fio/filesetup.c +leak:$CONFIG_FIO_SOURCE_DIR/parse.c +leak:$CONFIG_FIO_SOURCE_DIR/iolog.c +leak:$CONFIG_FIO_SOURCE_DIR/init.c +leak:$CONFIG_FIO_SOURCE_DIR/filesetup.c leak:fio_memalign leak:spdk_fio_io_u_init @@ -186,8 +186,8 @@ if [ -f /usr/include/infiniband/verbs.h ]; then config_params+=' --with-rdma' fi -if [ -d /usr/src/fio ]; then - config_params+=' --with-fio=/usr/src/fio' +if [[ -d $CONFIG_FIO_SOURCE_DIR ]]; then + config_params+=" --with-fio=$CONFIG_FIO_SOURCE_DIR" fi if [ -d ${DEPENDENCY_DIR}/vtune_codes ]; then @@ -941,7 +941,7 @@ function fio_config_gen() local config_file=$1 local workload=$2 local bdev_type=$3 - local fio_dir="/usr/src/fio" + local fio_dir=$CONFIG_FIO_SOURCE_DIR if [ -e "$config_file" ]; then echo "Configuration File Already Exists!: $config_file" @@ -1009,7 +1009,7 @@ function fio_config_add_job() function fio_bdev() { # Setup fio binary cmd line - local fio_dir="/usr/src/fio" + local fio_dir=$CONFIG_FIO_SOURCE_DIR local bdev_plugin="$rootdir/examples/bdev/fio_plugin/fio_plugin" # Preload AddressSanitizer library to fio if fio_plugin was compiled with it @@ -1022,7 +1022,7 @@ function fio_bdev() function fio_nvme() { # Setup fio binary cmd line - local fio_dir="/usr/src/fio" + local fio_dir=$CONFIG_FIO_SOURCE_DIR local nvme_plugin="$rootdir/examples/nvme/fio_plugin/fio_plugin" # Preload AddressSanitizer library to fio if fio_plugin was compiled with it diff --git a/test/ftl/fio.sh b/test/ftl/fio.sh index 2b19470c7..75d190db9 100755 --- a/test/ftl/fio.sh +++ b/test/ftl/fio.sh @@ -23,7 +23,7 @@ device=$1 tests=${suite[$2]} uuid=$3 -if [ ! -d /usr/src/fio ]; then +if [[ $CONFIG_FIO_PLUGIN != y ]]; then echo "FIO not available" exit 1 fi diff --git a/test/iscsi_tgt/perf/iscsi_target.sh b/test/iscsi_tgt/perf/iscsi_target.sh index d1e5e5a9d..94bafc8f9 100755 --- a/test/iscsi_tgt/perf/iscsi_target.sh +++ b/test/iscsi_tgt/perf/iscsi_target.sh @@ -13,7 +13,7 @@ MIX=100 IODEPTH=128 RUNTIME=60 RAMP_TIME=10 -FIO_PATH="/usr/src/fio" +FIO_PATH=$CONFIG_FIO_SOURCE_DIR DISKNO="ALL" CPUMASK=0x02 NUM_JOBS=1 diff --git a/test/nvme/nvme.sh b/test/nvme/nvme.sh index 5f603ca8c..7ea981b61 100755 --- a/test/nvme/nvme.sh +++ b/test/nvme/nvme.sh @@ -125,6 +125,6 @@ if [ $(uname) != "FreeBSD" ]; then kill_stub fi -if [ -d /usr/src/fio ]; then +if [[ $CONFIG_FIO_PLUGIN == y ]]; then run_test "nvme_fio" nvme_fio_test fi diff --git a/test/nvme/perf/common.sh b/test/nvme/perf/common.sh index 5cb9de787..6ab62a252 100755 --- a/test/nvme/perf/common.sh +++ b/test/nvme/perf/common.sh @@ -26,7 +26,7 @@ RUNTIME=600 RAMP_TIME=30 NUMJOBS=1 REPEAT_NO=3 -FIO_BIN="/usr/src/fio/fio" +FIO_BIN=$CONFIG_FIO_SOURCE_DIR/fio PLUGIN="nvme" DISKNO=1 CPUS_ALLOWED=1 diff --git a/test/nvmf/host/fio.sh b/test/nvmf/host/fio.sh index 8121382df..3925d646a 100755 --- a/test/nvmf/host/fio.sh +++ b/test/nvmf/host/fio.sh @@ -10,7 +10,7 @@ rpc_py="$rootdir/scripts/rpc.py" nvmftestinit -if [ ! -d /usr/src/fio ]; then +if [[ $CONFIG_FIO_PLUGIN != y ]]; then echo "FIO not available" exit 1 fi diff --git a/test/vhost/initiator/blockdev.sh b/test/vhost/initiator/blockdev.sh index 156158caa..5ed02f502 100755 --- a/test/vhost/initiator/blockdev.sh +++ b/test/vhost/initiator/blockdev.sh @@ -6,7 +6,7 @@ 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" +FIO_PATH=$CONFIG_FIO_SOURCE_DIR virtio_bdevs="" virtio_with_unmap="" diff --git a/test/vhost/perf_bench/vhost_perf.sh b/test/vhost/perf_bench/vhost_perf.sh index e69e0bf89..b25821089 100755 --- a/test/vhost/perf_bench/vhost_perf.sh +++ b/test/vhost/perf_bench/vhost_perf.sh @@ -25,7 +25,7 @@ wwpn_prefix="naa.5001405bc6498" fio_bin="--fio-bin=/home/sys_sgsw/fio_ubuntu" fio_iterations=1 -precond_fio_bin="/usr/src/fio/fio" +precond_fio_bin=$CONFIG_FIO_SOURCE_DIR/fio disk_map="" disk_cfg_bdfs=() @@ -64,7 +64,7 @@ function usage() echo " --use-split Use split vbdevs instead of Logical Volumes" echo " --limit-kernel-vhost=INT Limit kernel vhost to run only on a number of CPU cores." echo " --run-precondition Precondition lvols after creating. Default: true." - echo " --precond-fio-bin FIO binary used for SPDK fio plugin precondition. Default: /usr/src/fio/fio." + echo " --precond-fio-bin FIO binary used for SPDK fio plugin precondition. Default: $CONFIG_FIO_SOURCE_DIR/fio." echo " --custom-cpu-cfg=PATH Custom CPU config for test." echo " Default: spdk/test/vhost/common/autotest.config" echo " --disk-map Disk map for given test. Specify which disks to use, their SPDK name," diff --git a/test/vmd/vmd.sh b/test/vmd/vmd.sh index dc51f173e..3c526b95d 100755 --- a/test/vmd/vmd.sh +++ b/test/vmd/vmd.sh @@ -54,7 +54,7 @@ function vmd_bdev_svc { run_test "vmd_identify" vmd_identify run_test "vmd_hello_world" $rootdir/examples/nvme/hello_world/hello_world -V run_test "vmd_perf" vmd_perf -if [ -d /usr/src/fio ]; then +if [[ $CONFIG_FIO_PLUGIN == y ]]; then run_test "vmd_fio" vmd_fio fi