diff --git a/test/nvmf/target/nvmf_vhost.sh b/test/nvmf/target/nvmf_vhost.sh index edbc64d0f..5ed416b74 100755 --- a/test/nvmf/target/nvmf_vhost.sh +++ b/test/nvmf/target/nvmf_vhost.sh @@ -5,6 +5,12 @@ testdir=$(readlink -f $(dirname $0)) rootdir=$testdir/../../.. source $rootdir/test/common/autotest_common.sh source $rootdir/test/nvmf/common.sh + +if [ ! -d "/usr/local/qemu/spdk-3.0.0" ]; then + echo "Qemu not installed on this machine. It may be a VM. Skipping nvmf_vhost test." + exit 0 +fi + source $rootdir/test/vhost/common.sh MALLOC_BDEV_SIZE=128 @@ -17,11 +23,6 @@ VHOST_APP="$rootdir/app/vhost/vhost -p 0 -r $VHOST_SOCK -u" VHOST_RPC="$rootdir/scripts/rpc.py -s $VHOST_SOCK" vm_image="/home/sys_sgsw/vhost_vm_image.qcow2" -if [ ! -d $QEMU_PREFIX ]; then - echo "qemu not installed on this machine. It may be a VM. Skipping nvmf_vhost test." - exit 0 -fi - timing_enter nvmf_vhost nvmftestinit diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 2ac495f64..f35371fab 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -5,6 +5,13 @@ set -e TEST_DIR=$(readlink -f $rootdir/..) +#Check if qemu exists +if [ ! -d $QEMU_PREFIX ]; then + error "Qemu not installed on this machine." + exit 1 +fi +echo "Using qemu folder $QEMU_PREFIX" + # SSH key file : ${SPDK_VHOST_SSH_KEY_FILE="$(readlink -e $HOME/.ssh/spdk_vhost_id_rsa)"} if [[ ! -r "$SPDK_VHOST_SSH_KEY_FILE" ]]; then