Commit 6642c9e9 authored by Pawel Niedzwiecki's avatar Pawel Niedzwiecki Committed by Jim Harris
Browse files

teest/lvol: Use lvol store default cluster size



Change-Id: I45b6b0abe989cecb7293a3fb8c5a9299f618af7e
Signed-off-by: default avatarPawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/420630


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 9ead0e50
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -3,9 +3,8 @@ set -e
BASE_DIR=$(readlink -f $(dirname $0))
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../ && pwd)"

total_size=64
total_size=256
block_size=512
cluster_sz=1048576 #1MiB
test_cases=all
x=""

@@ -19,7 +18,6 @@ function usage() {
    echo "-h, --help                print help and exit"
    echo "    --total-size          Size of malloc bdev in MB (int > 0)"
    echo "    --block-size          Block size for this bdev"
    echo "    --cluster-sz          size of cluster (in bytes)"
    echo "-x                        set -x for script debug"
    echo "    --test-cases=         List test cases which will be run:
                                    1: 'construct_lvs_positive',
@@ -91,7 +89,6 @@ while getopts 'xh-:' optchar; do
            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'" && exit 1 ;;
        esac
@@ -137,7 +134,7 @@ function vhost_kill()
trap "vhost_kill; exit 1" SIGINT SIGTERM EXIT

vhost_start
$BASE_DIR/lvol_test.py $rpc_py $total_size $block_size $cluster_sz $BASE_DIR $TEST_DIR/app/vhost "${test_cases[@]}"
$BASE_DIR/lvol_test.py $rpc_py $total_size $block_size $BASE_DIR $TEST_DIR/app/vhost "${test_cases[@]}"

vhost_kill
trap - SIGINT SIGTERM EXIT
+5 −8
Original line number Diff line number Diff line
@@ -14,25 +14,22 @@ if __name__ == "__main__":
    rpc_py = None
    total_size = None
    block_size = None
    cluster_size = None
    num_test = None
    fail_count = 0
    tc_failed = []
    tc_list = []

    if len(sys.argv) == 8 and len(sys.argv[7].split(',')) <= test_counter():
    if len(sys.argv) == 7 and len(sys.argv[6].split(',')) <= test_counter():
        rpc_py = sys.argv[1]
        total_size = int(sys.argv[2])
        block_size = int(sys.argv[3])
        cluster_size = int(sys.argv[4])
        base_dir_path = sys.argv[5]
        app_path = sys.argv[6]
        tc_list = sys.argv[7].split(',')
        base_dir_path = sys.argv[4]
        app_path = sys.argv[5]
        tc_list = sys.argv[6].split(',')
    else:
        print("Invalid argument")
    try:
        tc = TestCases(rpc_py, total_size, block_size, cluster_size, base_dir_path, app_path)

        tc = TestCases(rpc_py, total_size, block_size, base_dir_path, app_path)
        if "all" in tc_list:
            tc_list = sorted([i.split("test_case")[1] for i in dir(TestCases) if "test_case" in i], key=int)

+7 −5
Original line number Diff line number Diff line
@@ -111,12 +111,14 @@ class Commands_Rpc(object):
        output = self.rpc.construct_malloc_bdev(total_size, block_size)[0]
        return output.rstrip('\n')

    def construct_lvol_store(self, base_name, lvs_name, cluster_size):
    def construct_lvol_store(self, base_name, lvs_name, cluster_size=None):
        print("INFO: RPC COMMAND construct_lvol_store")
        output = self.rpc.construct_lvol_store(
            base_name,
        if cluster_size:
            output = self.rpc.construct_lvol_store(base_name,
                                                   lvs_name,
                                                   "-c {cluster_sz}".format(cluster_sz=cluster_size))[0]
        else:
            output = self.rpc.construct_lvol_store(base_name, lvs_name)[0]
        return output.rstrip('\n')

    def construct_lvol_bdev(self, uuid, lbd_name, size, thin=False):
+54 −95

File changed.

Preview size limit exceeded, changes collapsed.