test/common: single fio exec function for both bdev/nvme

The two functions running fio with different plugins (bdev, nvme) are
identical except for loading different plugins, so it makes sense to
extract the common code to a separate function.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I151668bbefe18f3cacc82ae98b081e662a5fe231
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11661
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
This commit is contained in:
Konrad Sztyber 2022-02-10 16:22:48 +01:00 committed by Tomasz Zawadzki
parent ecdbaa2310
commit 24d34ac75c

View File

@ -1170,27 +1170,25 @@ EOL
fi
}
function fio_bdev() {
function fio_plugin() {
# Setup fio binary cmd line
local fio_dir=$CONFIG_FIO_SOURCE_DIR
local bdev_plugin="$rootdir/build/fio/spdk_bdev"
local plugin=$1
shift
# Preload AddressSanitizer library to fio if fio_plugin was compiled with it
local asan_lib
asan_lib=$(ldd $bdev_plugin | grep libasan | awk '{print $3}')
asan_lib=$(ldd $plugin | grep libasan | awk '{print $3}')
LD_PRELOAD="$asan_lib $bdev_plugin" "$fio_dir"/fio "$@"
LD_PRELOAD="$asan_lib $plugin" "$fio_dir"/fio "$@"
}
function fio_bdev() {
fio_plugin "$rootdir/build/fio/spdk_bdev" "$@"
}
function fio_nvme() {
# Setup fio binary cmd line
local fio_dir=$CONFIG_FIO_SOURCE_DIR
local nvme_plugin="$rootdir/build/fio/spdk_nvme"
# Preload AddressSanitizer library to fio if fio_plugin was compiled with it
asan_lib=$(ldd $nvme_plugin | grep libasan | awk '{print $3}')
LD_PRELOAD="$asan_lib $nvme_plugin" "$fio_dir"/fio "$@"
fio_plugin "$rootdir/build/fio/spdk_nvme" "$@"
}
function get_lvs_free_mb() {