Commit 36ac0c43 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

test/lvol: use the run_test framework directly

parent 1fafd71b
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ function test_construct_lvs() {
	rpc_cmd bdev_lvol_delete_lvstore -u "$lvs_uuid"
	! rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid"
	rpc_cmd bdev_malloc_delete "$malloc_name"
	check_leftover_devices
}

# create lvs + lvol on top, verify lvol's parameters
@@ -66,6 +67,7 @@ function test_construct_lvol() {
	rpc_cmd bdev_lvol_delete_lvstore -u "$lvs_uuid"
	! rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid"
	rpc_cmd bdev_malloc_delete "$malloc_name"
	check_leftover_devices
}

# create lvs + multiple lvols, verify their params
@@ -127,6 +129,7 @@ function test_construct_multi_lvols() {
	rpc_cmd bdev_lvol_delete_lvstore -u "$lvs_uuid"
	! rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid"
	rpc_cmd bdev_malloc_delete "$malloc_name"
	check_leftover_devices
}

$rootdir/app/spdk_tgt/spdk_tgt &
@@ -134,9 +137,9 @@ spdk_pid=$!
trap 'killprocess "$spdk_pid"; exit 1' SIGINT SIGTERM EXIT
waitforlisten $spdk_pid

run_lvol_test test_construct_lvs
run_lvol_test test_construct_lvol
run_lvol_test test_construct_multi_lvols
run_test "case" "test_construct_lvs" test_construct_lvs
run_test "case" "test_construct_lvol" test_construct_lvol
run_test "case" "test_construct_multi_lvols" test_construct_multi_lvols

trap - SIGINT SIGTERM EXIT
killprocess $spdk_pid
+1 −3
Original line number Diff line number Diff line
@@ -10,9 +10,7 @@ function rpc_cmd() {
	$rootdir/scripts/rpc.py "$@"
}

function run_lvol_test() {
	run_test suite "$*" "$@"

function check_leftover_devices() {
	leftover_bdevs=$(rpc_cmd bdev_get_bdevs)
	[ "$(jq length <<< "$leftover_bdevs")" == "0" ]
	leftover_lvs=$(rpc_cmd bdev_lvol_get_lvstores)