From 36ac0c43400047462e05b41d6675f5cfd55f1510 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Fri, 6 Dec 2019 09:26:12 -0700 Subject: [PATCH] test/lvol: use the run_test framework directly Change-Id: Iabec093a7cd632cf35fb163cfcc0048ed66fc856 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477077 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Karol Latecki Reviewed-by: Tomasz Zawadzki --- test/lvol/basic.sh | 9 ++++++--- test/lvol/common.sh | 4 +--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/lvol/basic.sh b/test/lvol/basic.sh index 2b5ee4502..b3511e273 100755 --- a/test/lvol/basic.sh +++ b/test/lvol/basic.sh @@ -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 diff --git a/test/lvol/common.sh b/test/lvol/common.sh index 247134057..642acacdd 100644 --- a/test/lvol/common.sh +++ b/test/lvol/common.sh @@ -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)