Commit c3cc2454 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

test/lvol: rewrite construct_lvs_nonexistent_bdev to bash

parent b9d83821
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -7,8 +7,10 @@ source $rootdir/test/lvol/common.sh

# create empty lvol store and verify its parameters
function test_construct_lvs() {
	# create an lvol store
	# create a malloc bdev
	malloc_name=$(rpc_cmd bdev_malloc_create $MALLOC_SIZE_MB $MALLOC_BS)

	# create a valid lvs
	lvs_uuid=$(rpc_cmd bdev_lvol_create_lvstore "$malloc_name" lvs_test)
	lvs=$(rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid")

@@ -31,6 +33,14 @@ function test_construct_lvs() {
	check_leftover_devices
}

# call bdev_lvol_create_lvstore with base bdev name which does not
# exist in configuration
function test_construct_lvs_nonexistent_bdev() {
	# make sure we can't create lvol store on nonexistent bdev
	rpc_cmd bdev_lvol_create_lvstore NotMalloc lvs_test && false
	return 0
}

# create lvs + lvol on top, verify lvol's parameters
function test_construct_lvol() {
	# create an lvol store
@@ -247,6 +257,7 @@ trap 'killprocess "$spdk_pid"; exit 1' SIGINT SIGTERM EXIT
waitforlisten $spdk_pid

run_test "test_construct_lvs" test_construct_lvs
run_test "test_construct_lvs_nonexistent_bdev" test_construct_lvs_nonexistent_bdev
run_test "test_construct_lvol" test_construct_lvol
run_test "test_construct_multi_lvols" test_construct_multi_lvols
run_test "test_construct_lvols_conflict_alias" test_construct_lvols_conflict_alias
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ function usage() {
                                    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_bdev_lvol_create_on_full_lvol_store',
+0 −19
Original line number Diff line number Diff line
@@ -127,7 +127,6 @@ def case_message(func):
            300: 'bdev_lvol_delete_lvstore_nonexistent_lvs_uuid',
            301: 'delete_lvol_store_underlying_bdev',
            # bdev_lvol_create_lvstore - negative tests
            450: 'construct_lvs_nonexistent_bdev',
            451: 'construct_lvs_on_bdev_twice',
            452: 'construct_lvs_name_twice',
            # nested bdev_lvol_create - test negative
@@ -727,24 +726,6 @@ class TestCases(object):
        return fail_count

    # negative tests
    @case_message
    def test_case450(self):
        """
        construct_lvs_nonexistent_bdev

        Negative test for constructing a new lvol store.
        Call bdev_lvol_create_lvstore with base bdev name which does not
        exist in configuration.
        """
        fail_count = 0
        bad_bdev_id = random.randrange(999999999)
        # Try bdev_lvol_create_lvstore on bdev which does not exist
        if self.c.bdev_lvol_create_lvstore(bad_bdev_id,
                                           self.lvs_name,
                                           self.cluster_size) == 0:
            fail_count += 1
        return fail_count

    @case_message
    def test_case451(self):
        """