Commit 7066e3c9 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

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: default avatarKarol Latecki <karol.latecki@intel.com>
Change-Id: I5d5bded7ee214f39b96bb6ae1e82d59592629aff
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1959


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent ae730042
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ iodepth=128
rw=randrw
bs=4k
enable_vmd=1
verify_state_save=0

[test]
numjobs=1
+25 −7
Original line number Diff line number Diff line
@@ -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