diff --git a/test/lvol/lvol.sh b/test/lvol/lvol.sh index 4906c57e92..b1a4a24af3 100755 --- a/test/lvol/lvol.sh +++ b/test/lvol/lvol.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -xe +set -e BASE_DIR=$(readlink -f $(dirname $0)) [[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../ && pwd)" @@ -23,53 +23,59 @@ function usage() { echo "-x set -x for script debug" echo " --test-cases= List test cases which will be run: 1: 'construct_lvs_positive', - 2: 'construct_logical_volume_positive', - 3: 'construct_multi_logical_volumes_positive', - 4: 'resize_lvol_bdev_positive', - 5: 'destroy_lvol_store_positive', - 6: 'destroy_lvol_store_with_lvol_bdev_positive', - 7: 'destroy_multi_logical_volumes_positive', - 8: 'nested construct_logical_volume_positive', - 9: 'destroy_after_resize_lvol_bdev_positive', - 10: 'construct_lvs_nonexistent_bdev', - 11: 'construct_lvs_on_bdev_twice_negative', - 12: 'construct_logical_volume_nonexistent_lvs_uuid', - 13: 'construct_logical_volumes_on_busy_bdev', - 14: 'resize_logical_volume_nonexistent_logical_volume', - 15: 'resize_logical_volume_with_size_out_of_range', - 16: 'destroy_lvol_store_nonexistent_lvs_uuid', - 17: 'destroy_lvol_store_nonexistent_bdev', - 18: 'nested construct_logical_volume_on_busy_bdev', - 19: 'nested destroy_logical_volume_positive', - 20: 'delete_bdev_positive', - 21: 'construct_lvs_with_cluster_sz_out_of_range_max', - 22: 'construct_lvs_with_cluster_sz_out_of_range_min', - 23: 'tasting_positive', - 24: 'SIGTERM' + 50: 'construct_logical_volume_positive', + 51: 'construct_multi_logical_volumes_positive', + 52: 'construct_lvol_bdev_using_name_positive', + 53: 'construct_lvol_bdev_duplicate_names_positive', + 100: 'construct_logical_volume_nonexistent_lvs_uuid', + 101: 'construct_lvol_bdev_on_full_lvol_store', + 102: 'construct_lvol_bdev_name_twice', + 150: 'resize_lvol_bdev_positive', + 200: 'resize_logical_volume_nonexistent_logical_volume', + 201: 'resize_logical_volume_with_size_out_of_range', + 250: 'destroy_lvol_store_positive', + 251: 'destroy_lvol_store_use_name_positive', + 252: 'destroy_lvol_store_with_lvol_bdev_positive', + 253: 'destroy_multi_logical_volumes_positive', + 254: 'destroy_after_resize_lvol_bdev_positive', + 255: 'delete_lvol_store_persistent_positive', + 300: 'destroy_lvol_store_nonexistent_lvs_uuid', + 301: 'delete_lvol_store_underlying_bdev', + 350: 'nested_destroy_logical_volume_negative', + 400: 'nested_construct_logical_volume_positive', + 450: 'construct_lvs_nonexistent_bdev', + 451: 'construct_lvs_on_bdev_twice', + 452: 'construct_lvs_name_twice', + 500: 'nested_construct_lvol_bdev_on_full_lvol_store', + 550: 'delete_bdev_positive', + 600: 'construct_lvol_store_with_cluster_size_max', + 601 'construct_lvol_store_with_cluster_size_min', + 650: 'tasting_positive', + 651: 'tasting_lvol_store_positive', + 700: 'SIGTERM' or all: This parameter runs all tests Ex: \"1,2,19,20\", default: all" echo echo - exit 0 } while getopts 'xh-:' optchar; do case "$optchar" in -) case "$OPTARG" in - help) usage $0 ;; + help) usage $0 && exit 0;; total-size=*) total_size="${OPTARG#*=}" ;; block-size=*) block_size="${OPTARG#*=}" ;; cluster-sz=*) cluster_sz="${OPTARG#*=}" ;; test-cases=*) test_cases="${OPTARG#*=}" ;; - *) usage $0 "Invalid argument '$OPTARG'" ;; + *) usage $0 "Invalid argument '$OPTARG'" && exit 1 ;; esac ;; - h) usage $0 ;; + h) usage $0 && exit 0 ;; x) set -x x="-x" ;; - *) usage $0 "Invalid argument '$OPTARG'" + *) usage $0 "Invalid argument '$OPTARG'" && exit 1 ;; esac done shift $(( OPTIND - 1 ))