From 4716d5aabb2b95533f70d63930064fe0fe420e0d Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 1 Feb 2018 11:36:49 -0700 Subject: [PATCH] autotest: detect if nbd module is available Some distributions may not ship the nbd module; detect whether it can be loaded rather than just failing if it is missing. Change-Id: Ib35ba26b211de4e8b85b689ab55fed47bd02a750 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/398097 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker --- scripts/autotest_common.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/autotest_common.sh b/scripts/autotest_common.sh index 8b390f83a..6900b0e31 100755 --- a/scripts/autotest_common.sh +++ b/scripts/autotest_common.sh @@ -366,7 +366,7 @@ function print_backtrace() { } function part_dev_by_gpt () { - if [ $(uname -s) = Linux ] && hash sgdisk; then + if [ $(uname -s) = Linux ] && hash sgdisk && modprobe nbd; then conf=$1 devname=$2 rootdir=$3 @@ -386,7 +386,6 @@ function part_dev_by_gpt () { echo "[Gpt]" >> ${conf}.gpt echo " Disable Yes" >> ${conf}.gpt - modprobe nbd $rootdir/test/app/bdev_svc/bdev_svc -r $rpc_server -i 0 -c ${conf}.gpt & nbd_pid=$! echo "Process nbd pid: $nbd_pid"