test/vmd: add setup.sh routines to test script

Detect available VMD subsystems and disks to bind
to userspace for tests.
Re-run the default setup.sh configuration once
tests are done.

Additionally add verify_state_save option to
fio config, otherwise this will not pass 'git porcelain'
in autotest.sh.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I5d5bded7ee214f39b96bb6ae1e82d59592629aff
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1959
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Karol Latecki 2020-04-21 16:31:47 +02:00 committed by Tomasz Zawadzki
parent ae7300425b
commit 7066e3c9c7
2 changed files with 26 additions and 7 deletions

View File

@ -12,6 +12,7 @@ iodepth=128
rw=randrw
bs=4k
enable_vmd=1
verify_state_save=0
[test]
numjobs=1

View File

@ -6,13 +6,7 @@ source $rootdir/scripts/common.sh
source $rootdir/test/common/autotest_common.sh
rpc_py=$rootdir/scripts/rpc.py
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
VMD_WHITELIST=()
function vmd_identify {
for bdf in $pci_devs; do
@ -51,6 +45,26 @@ function vmd_bdev_svc {
killprocess $svcpid
}
# Re-run setup.sh script and only attach VMD devices to uio/vfio.
$rootdir/scripts/setup.sh reset
vmd_id=$(grep "PCI_DEVICE_ID_INTEL_VMD" $rootdir/include/spdk/pci_ids.h | awk -F"x" '{print $2}')
for bdf in $(iter_pci_dev_id 8086 $vmd_id); do
if pci_can_use $bdf; then
VMD_WHITELIST+=("$bdf")
fi
done
PCI_WHITELIST="${VMD_WHITELIST[*]}" $rootdir/scripts/setup.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
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
@ -59,3 +73,7 @@ if [[ $CONFIG_FIO_PLUGIN == y ]]; then
fi
run_test "vmd_bdev_svc" vmd_bdev_svc
# Re-run setup.sh again so that other tests may continue
$rootdir/scripts/setup.sh reset
$rootdir/scripts/setup.sh