test/lvol: rewrite construct_lvol_bdev_using_name_positive to bash
Make it a part of existing test_construct_lvol_basic test case. It's the same test, but the lvol is created using lvs alias rather than uuid. Change-Id: I909ded489eb441aa9fa212b11b2cbb91b5db5bbe Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459672 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
parent
da90d41a40
commit
4256981d5d
@ -45,6 +45,20 @@ function test_construct_lvol() {
|
||||
[ "$(jq -r '.[0].aliases[0]' <<< "$lvol")" = "lvs_test/lvol_test" ]
|
||||
[ "$(jq -r '.[0].block_size' <<< "$lvol")" = "$MALLOC_BS" ]
|
||||
[ "$(jq -r '.[0].num_blocks' <<< "$lvol")" = "$(( LVS_DEFAULT_CAPACITY / MALLOC_BS ))" ]
|
||||
[ "$(jq -r '.[0].driver_specific.lvol.lvol_store_uuid' <<< "$lvol")" = "$lvs_uuid" ]
|
||||
|
||||
# clean up and create another lvol, this time use lvs alias instead of uuid
|
||||
rpc_cmd bdev_lvol_delete "$lvol_uuid"
|
||||
! rpc_cmd bdev_get_bdevs -b "$lvol_uuid"
|
||||
lvol_uuid=$(rpc_cmd bdev_lvol_create -l lvs_test lvol_test "$LVS_DEFAULT_CAPACITY_MB")
|
||||
lvol=$(rpc_cmd bdev_get_bdevs -b "$lvol_uuid")
|
||||
|
||||
[ "$(jq -r '.[0].name' <<< "$lvol")" = "$lvol_uuid" ]
|
||||
[ "$(jq -r '.[0].uuid' <<< "$lvol")" = "$lvol_uuid" ]
|
||||
[ "$(jq -r '.[0].aliases[0]' <<< "$lvol")" = "lvs_test/lvol_test" ]
|
||||
[ "$(jq -r '.[0].block_size' <<< "$lvol")" = "$MALLOC_BS" ]
|
||||
[ "$(jq -r '.[0].num_blocks' <<< "$lvol")" = "$(( LVS_DEFAULT_CAPACITY / MALLOC_BS ))" ]
|
||||
[ "$(jq -r '.[0].driver_specific.lvol.lvol_store_uuid' <<< "$lvol")" = "$lvs_uuid" ]
|
||||
|
||||
# clean up
|
||||
rpc_cmd bdev_lvol_delete "$lvol_uuid"
|
||||
|
@ -21,7 +21,6 @@ function usage() {
|
||||
echo " --block-size Block size for this bdev"
|
||||
echo "-x set -x for script debug"
|
||||
echo " --test-cases= List test cases which will be run:
|
||||
52: 'bdev_lvol_create_using_name_positive',
|
||||
53: 'bdev_lvol_create_duplicate_names_positive',
|
||||
100: 'construct_logical_volume_nonexistent_lvs_uuid',
|
||||
101: 'bdev_lvol_create_on_full_lvol_store',
|
||||
|
@ -111,7 +111,6 @@ def case_message(func):
|
||||
def inner(*args, **kwargs):
|
||||
test_name = {
|
||||
# bdev_lvol_create - positive tests
|
||||
52: 'bdev_lvol_create_using_name_positive',
|
||||
53: 'bdev_lvol_create_duplicate_names_positive',
|
||||
# bdev_lvol_create - negative tests
|
||||
100: 'construct_logical_volume_nonexistent_lvs_uuid',
|
||||
@ -310,43 +309,6 @@ class TestCases(object):
|
||||
lvs = self.c.bdev_lvol_get_lvstores(lvs_name)[0]
|
||||
return int(int(lvs['cluster_size']) / MEGABYTE)
|
||||
|
||||
@case_message
|
||||
def test_case52(self):
|
||||
"""
|
||||
bdev_lvol_create_using_name_positive
|
||||
|
||||
Positive test for constructing a logical volume using friendly names.
|
||||
Verify that logical volumes can be created by using a friendly name
|
||||
instead of uuid when referencing to lvol store.
|
||||
"""
|
||||
# Create malloc bdev
|
||||
base_name = self.c.bdev_malloc_create(self.total_size,
|
||||
self.block_size)
|
||||
# Construct lvol store
|
||||
uuid_store = self.c.bdev_lvol_create_lvstore(base_name,
|
||||
self.lvs_name)
|
||||
# Check correct uuid values in response bdev_lvol_get_lvstores command
|
||||
fail_count = self.c.check_bdev_lvol_get_lvstores(base_name, uuid_store,
|
||||
self.cluster_size)
|
||||
lvs_size = self.get_lvs_size()
|
||||
# Create logical volume on lvol store by using a friendly name
|
||||
# as a reference
|
||||
uuid_bdev = self.c.bdev_lvol_create(self.lvs_name,
|
||||
self.lbd_name,
|
||||
lvs_size)
|
||||
# Verify logical volume was correctly created
|
||||
fail_count += self.c.check_bdev_get_bdevs_methods(uuid_bdev,
|
||||
lvs_size)
|
||||
|
||||
fail_count += self.c.bdev_lvol_delete(uuid_bdev)
|
||||
fail_count += self.c.bdev_lvol_delete_lvstore(uuid_store)
|
||||
fail_count += self.c.bdev_malloc_delete(base_name)
|
||||
|
||||
# Expected result:
|
||||
# - calls successful, return code = 0
|
||||
# - no other operation fails
|
||||
return fail_count
|
||||
|
||||
@case_message
|
||||
def test_case53(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user