Commit 4716d5aa authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398097


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent fc7e8475
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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"