Commit 50656e7a authored by Jim Harris's avatar Jim Harris
Browse files

test: modprobe nbd at the start of autotest



This helps avoid issues with nbd not being ready when
we need it.

Still keep various "modprobe nbd" in different test
files - this ensures these test files can still be
run in isolation.  But remove the various "rmmod nbd"
to ensure that nbd always stays loaded.  There is no
harm in just keeping nbd loaded all the time.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I3597ff1f7ac53162c33a0384a33f33776cf6f182

Reviewed-on: https://review.gerrithub.io/434838


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 2f5feaf5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ fi
if [ $(uname -s) = Linux ]; then
	# set core_pattern to a known value to avoid ABRT, systemd-coredump, etc.
	echo "core" > /proc/sys/kernel/core_pattern

	# make sure nbd (network block device) driver is loaded if it is available
	# this ensures that when tests need to use nbd, it will be fully initialized
	modprobe nbd || true
fi

trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT
+0 −1
Original line number Diff line number Diff line
@@ -25,6 +25,5 @@ timing_exit nbd_json_config_test

$clear_config_py clear_config
kill_targets
rmmod nbd
timing_exit nbd_json_config
report_test_completion nbd_json_config
+0 −1
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ function vhost_kill()
        sleep 1
    fi
    rm $BASE_DIR/vhost.pid || true
    rmmod nbd || true
}

trap "vhost_kill; rm -f $BASE_DIR/aio_bdev_0 $BASE_DIR/aio_bdev_1; exit 1" SIGINT SIGTERM EXIT
+1 −2
Original line number Diff line number Diff line
@@ -68,13 +68,12 @@ timing_exit create_lvol

timing_enter convert_vm_image
modprobe nbd
trap 'nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0; rmmod nbd; err_clean "${FUNCNAME}" "${LINENO}"' ERR
trap 'nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0; err_clean "${FUNCNAME}" "${LINENO}"' ERR
nbd_start_disks "$(get_vhost_dir)/rpc.sock" $lvb_u /dev/nbd0
$QEMU_PREFIX/bin/qemu-img convert $os_image -O raw /dev/nbd0
sync
nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0
sleep 1
rmmod nbd
timing_exit convert_vm_image

trap 'err_clean "${FUNCNAME}" "${LINENO}"' ERR