Commit b3c1a38b authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Tomasz Zawadzki
Browse files

test/raid: don't skip test silently if nbd unavailable



Use run_test to mark tests that can be skipped. Also apply to other
tests in the file.

Change-Id: I7e590bc210535e78f595a436a814260866824be3
Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21118


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent aefa99f1
Loading
Loading
Loading
Loading
+38 −39
Original line number Diff line number Diff line
@@ -79,11 +79,9 @@ function configure_raid_bdev() {

function raid_function_test() {
	local raid_level=$1
	if [ $(uname -s) = Linux ] && modprobe -n nbd; then
	local nbd=/dev/nbd0
	local raid_bdev

		modprobe nbd
	$rootdir/test/app/bdev_svc/bdev_svc -r $rpc_server -i 0 -L bdev_raid &
	raid_pid=$!
	echo "Process raid pid: $raid_pid"
@@ -111,9 +109,6 @@ function raid_function_test() {
	fi

	killprocess $raid_pid
	else
		echo "skipping bdev raid tests."
	fi

	return 0
}
@@ -511,23 +506,27 @@ function raid_superblock_test() {

trap 'on_error_exit;' ERR

raid_function_test raid0
raid_function_test concat
raid0_resize_test
if [ $(uname -s) = Linux ] && modprobe -n nbd; then
	modprobe nbd
	run_test "raid_function_test_raid0" raid_function_test raid0
	run_test "raid_function_test_concat" raid_function_test concat
fi

run_test "raid0_resize_test" raid0_resize_test

for n in {2..4}; do
	for level in raid0 concat raid1; do
		raid_state_function_test $level $n false
		raid_state_function_test $level $n true
		raid_superblock_test $level $n
		run_test "raid_state_function_test" raid_state_function_test $level $n false
		run_test "raid_state_function_test_sb" raid_state_function_test $level $n true
		run_test "raid_superblock_test" raid_superblock_test $level $n
	done
done

if [ "$CONFIG_RAID5F" == y ]; then
	for n in {3..4}; do
		raid_state_function_test raid5f $n false
		raid_state_function_test raid5f $n true
		raid_superblock_test raid5f $n
		run_test "raid5f_state_function_test" raid_state_function_test raid5f $n false
		run_test "raid5f_state_function_test_sb" raid_state_function_test raid5f $n true
		run_test "raid5f_superblock_test" raid_superblock_test raid5f $n
	done
fi