From 1d717c7cd95ddd8fed83bfe59e86ef77e0ef1c24 Mon Sep 17 00:00:00 2001 From: Wojciech Malikowski Date: Thu, 27 Jun 2019 10:49:26 -0400 Subject: [PATCH] test/vmd: Basic VMD tests Added basic tests for NVMe disks behind VMD. Change-Id: I9613ca4aa813bab16f4085ac809dbdc8028f1cfc Signed-off-by: Wojciech Malikowski Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459639 Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- autotest.sh | 4 ++++ test/common/autotest_common.sh | 1 + test/vmd/config/config.fio | 16 +++++++++++++ test/vmd/vmd.sh | 43 ++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 test/vmd/config/config.fio create mode 100755 test/vmd/vmd.sh diff --git a/autotest.sh b/autotest.sh index 0a6fd13aa..038591368 100755 --- a/autotest.sh +++ b/autotest.sh @@ -252,6 +252,10 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then if [ $SPDK_TEST_BDEV_FTL -eq 1 ]; then run_test suite ./test/ftl/ftl.sh fi + + if [ $SPDK_TEST_VMD -eq 1 ]; then + run_test suite ./test/vmd/vmd.sh + fi fi timing_enter cleanup diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index af099badd..03e536845 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -61,6 +61,7 @@ export RUN_NIGHTLY_FAILING : ${SPDK_TEST_BDEV_FTL=0}; export SPDK_TEST_BDEV_FTL : ${SPDK_TEST_OCF=0}; export SPDK_TEST_OCF : ${SPDK_TEST_FTL_EXTENDED=0}; export SPDK_TEST_FTL_EXTENDED +: ${SPDK_TEST_VMD=0}; export SPDK_TEST_VMD : ${SPDK_AUTOTEST_X=true}; export SPDK_AUTOTEST_X # Export PYTHONPATH with addition of RPC framework. New scripts can be created diff --git a/test/vmd/config/config.fio b/test/vmd/config/config.fio new file mode 100644 index 000000000..9a76b4db2 --- /dev/null +++ b/test/vmd/config/config.fio @@ -0,0 +1,16 @@ +[global] +ioengine=spdk +thread=1 +group_reporting=1 +direct=1 +verify=1 +time_based=1 +ramp_time=0 +runtime=2 +iodepth=128 +rw=randrw +bs=4k +enable_vmd=1 + +[test] +numjobs=1 diff --git a/test/vmd/vmd.sh b/test/vmd/vmd.sh new file mode 100755 index 000000000..c700b4921 --- /dev/null +++ b/test/vmd/vmd.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +testdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $testdir/../..) +source $rootdir/scripts/common.sh +source $rootdir/test/common/autotest_common.sh + +pci_devs=$($rootdir/app/spdk_lspci/spdk_lspci | grep "NVMe disk behind VMD" | awk '{print $1}') + +if [ -z $pci_devs]; then + echo "Couldn't find any NVMe device behind a VMD." + exit 1 +fi + +timing_enter vmd + +timing_enter identify +for bdf in $pci_devs; do + $rootdir/examples/nvme/identify/identify -i 0 -V -r "trtype:PCIe traddr:$bdf" +done +timing_exit identify + +timing_enter hello_world +$rootdir/examples/nvme/hello_world/hello_world -V +timing_exit + +timing_enter perf +for bdf in $pci_devs; do + $rootdir/examples/nvme/perf/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 -V -r "trtype:PCIe traddr:$bdf" +done +timing_exit perf + +if [ -d /usr/src/fio ]; then + timing_enter fio_plugin + PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin + for bdf in $pci_devs; do + fio_nvme $testdir/config/config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1" + report_test_completion "bdev_fio" + done + timing_exit fio_plugin +fi + +timing_exit vmd