diff --git a/test/vmd/vmd.sh b/test/vmd/vmd.sh index c700b4921..6e395b83b 100755 --- a/test/vmd/vmd.sh +++ b/test/vmd/vmd.sh @@ -5,6 +5,8 @@ rootdir=$(readlink -f $testdir/../..) 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 @@ -40,4 +42,16 @@ if [ -d /usr/src/fio ]; then timing_exit fio_plugin fi +$rootdir/test/app/bdev_svc/bdev_svc --wait-for-rpc & svcpid=$! +trap "killprocess $svcpid; exit 1" SIGINT SIGTERM EXIT +# Wait until bdev_svc starts +waitforlisten $svcpid + +$rpc_py enable_vmd +$rpc_py start_subsystem_init + +for bdf in $pci_devs; do + $rpc_py construct_nvme_bdev -b NVMe_$bdf -t PCIe -a $bdf +done + timing_exit vmd