nvmf_vhost: Check qemu before and in vhost/common.sh.

Normal return for qemu checking , this should check before vhost/common.sh.
For qemu not installed on this machine. It may be a VM. Skipping nvmf_vhost test.
Otherwise, code will exit 1 before this normal return.
And in vhost/common.sh should with qemu checking.

Change-Id: I2285fffa6fc4384b4b172e5c443019e9ab391fa0
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456123
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
yidong0635 2019-06-06 10:25:52 -04:00 committed by Ben Walker
parent 2ec93bc316
commit fdb03395db
2 changed files with 13 additions and 5 deletions

View File

@ -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

View File

@ -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