Commit 3a6f8dc8 authored by Lukasz Galka's avatar Lukasz Galka Committed by Daniel Verkamp
Browse files

test/lvol: Add lvol tasting test



Add lvol tasting positive test case.
Adding new autotest config option for better control
where test is executed

Change-Id: Ic08b2395bd14e15072711b97c77b7e1ce26dd2b7
Signed-off-by: default avatarLukasz Galka <lukaszx.galka@intel.com>
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/383432


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f9189449
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -144,11 +144,13 @@ if [ $SPDK_TEST_VHOST -eq 1 ]; then
	run_test ./test/vhost/spdk_vhost.sh --integrity-lvol-blk
	timing_exit integrity_lvol_blk

	timing_exit vhost
fi

if [ $SPDK_TEST_LVOL -eq 1 ]; then
	timing_enter lvol
	run_test ./test/lvol/lvol.sh --test-cases=1,2,3,5,6,7,10,11,12,13,16,17,21,22,23
	run_test ./test/lvol/lvol.sh --test-cases=1,2,3,5,6,7,10,11,12,13,16,17,21,22,23,24
	timing_exit lvol

	timing_exit vhost
fi

if [ $SPDK_TEST_VHOST_INIT -eq 1 ]; then
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ fi
: ${SPDK_TEST_EVENT=1}; export SPDK_TEST_EVENT
: ${SPDK_TEST_BLOBFS=1}; export SPDK_TEST_BLOBFS
: ${SPDK_TEST_NVML=1}; export SPDK_TEST_NVML
: ${SPDK_TEST_LVOL=1}; export SPDK_TEST_LVOL
: ${SPDK_RUN_ASAN=1}; export SPDK_RUN_ASAN
: ${SPDK_RUN_UBSAN=1}; export SPDK_RUN_UBSAN

+8 −5
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ function usage() {
                                    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: 'SIGTERM'
                                    23: 'tasting_positive',
                                    24: 'SIGTERM'
                                    or
                                    all: This parameter runs all tests
                                    Ex: \"1,2,19,20\", default: all"
@@ -78,7 +79,9 @@ source $TEST_DIR/scripts/autotest_common.sh
###  Function starts vhost app
function vhost_start()
{
    $TEST_DIR/app/vhost/vhost -c $BASE_DIR/vhost.conf.in &
    touch $BASE_DIR/vhost.conf
    $TEST_DIR/scripts/gen_nvme.sh >> $BASE_DIR/vhost.conf
    $TEST_DIR/app/vhost/vhost -c $BASE_DIR/vhost.conf &
    vhost_pid=$!
    echo $vhost_pid > $BASE_DIR/vhost.pid
    waitforlisten $vhost_pid
@@ -92,13 +95,13 @@ function vhost_kill()
        sleep 1
    fi
    rm $BASE_DIR/vhost.pid || true
    rm $BASE_DIR/vhost.conf || true
}

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 $cluster_sz $BASE_DIR "${test_cases[@]}"

trap - SIGINT SIGTERM EXIT
vhost_kill
trap - SIGINT SIGTERM EXIT
+4 −3
Original line number Diff line number Diff line
@@ -19,17 +19,18 @@ if __name__ == "__main__":
    tc_failed = []
    tc_list = []

    if len(sys.argv) >= 5 and len(sys.argv) <= test_counter():
    if len(sys.argv) == 8 and len(sys.argv[7].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]
        tc_list = sys.argv[6].split(',')
        app_path = sys.argv[6]
        tc_list = sys.argv[7].split(',')
    else:
        print("Invalid argument")
    try:
        tc = TestCases(rpc_py, total_size, block_size, cluster_size, base_dir_path)
        tc = TestCases(rpc_py, total_size, block_size, cluster_size, base_dir_path, app_path)

        if "all" in tc_list:
            for num_test in range(1, test_counter() + 1):
+12 −4
Original line number Diff line number Diff line
@@ -54,8 +54,7 @@ class Commands_Rpc(object):

    def check_get_lvol_stores(self, base_name, uuid, cluster_size):
        print("INFO: RPC COMMAND get_lvol_stores")
        output = self.rpc.get_lvol_stores()[0]
        json_value = json.loads(output)
        json_value = self.get_lvol_stores()
        if json_value:
            for i in range(len(json_value)):
                uuid_json_response = json_value[i]['uuid']
@@ -128,5 +127,14 @@ class Commands_Rpc(object):

    def get_lvol_stores(self):
        print("INFO: RPC COMMAND get_lvol_stores")
        output = self.rpc.get_lvol_stores()[0]
        return output.rstrip('\n')
        output = json.loads(self.rpc.get_lvol_stores()[0])
        return output

    def get_lvol_bdevs(self):
        print("INFO: RPC COMMAND get_bdevs; lvol bdevs only")
        output = []
        rpc_output = json.loads(self.rpc.get_bdevs()[0])
        for bdev in rpc_output:
            if bdev["product_name"] == "Logical Volume":
                output.append(bdev)
        return output
Loading