test/lvol: rewrite construct_lvs_nonexistent_bdev to bash
Change-Id: I5e362ec53544f57a11584f449222827bd9be4369 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/+/459677 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
parent
b9d8382154
commit
c3cc245401
@ -7,8 +7,10 @@ source $rootdir/test/lvol/common.sh
|
|||||||
|
|
||||||
# create empty lvol store and verify its parameters
|
# create empty lvol store and verify its parameters
|
||||||
function test_construct_lvs() {
|
function test_construct_lvs() {
|
||||||
# create an lvol store
|
# create a malloc bdev
|
||||||
malloc_name=$(rpc_cmd bdev_malloc_create $MALLOC_SIZE_MB $MALLOC_BS)
|
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_uuid=$(rpc_cmd bdev_lvol_create_lvstore "$malloc_name" lvs_test)
|
||||||
lvs=$(rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid")
|
lvs=$(rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid")
|
||||||
|
|
||||||
@ -31,6 +33,14 @@ function test_construct_lvs() {
|
|||||||
check_leftover_devices
|
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
|
# create lvs + lvol on top, verify lvol's parameters
|
||||||
function test_construct_lvol() {
|
function test_construct_lvol() {
|
||||||
# create an lvol store
|
# create an lvol store
|
||||||
@ -247,6 +257,7 @@ trap 'killprocess "$spdk_pid"; exit 1' SIGINT SIGTERM EXIT
|
|||||||
waitforlisten $spdk_pid
|
waitforlisten $spdk_pid
|
||||||
|
|
||||||
run_test "test_construct_lvs" test_construct_lvs
|
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_lvol" test_construct_lvol
|
||||||
run_test "test_construct_multi_lvols" test_construct_multi_lvols
|
run_test "test_construct_multi_lvols" test_construct_multi_lvols
|
||||||
run_test "test_construct_lvols_conflict_alias" test_construct_lvols_conflict_alias
|
run_test "test_construct_lvols_conflict_alias" test_construct_lvols_conflict_alias
|
||||||
|
@ -34,7 +34,6 @@ function usage() {
|
|||||||
301: 'delete_lvol_store_underlying_bdev',
|
301: 'delete_lvol_store_underlying_bdev',
|
||||||
350: 'nested_destroy_logical_volume_negative',
|
350: 'nested_destroy_logical_volume_negative',
|
||||||
400: 'nested_construct_logical_volume_positive',
|
400: 'nested_construct_logical_volume_positive',
|
||||||
450: 'construct_lvs_nonexistent_bdev',
|
|
||||||
451: 'construct_lvs_on_bdev_twice',
|
451: 'construct_lvs_on_bdev_twice',
|
||||||
452: 'construct_lvs_name_twice',
|
452: 'construct_lvs_name_twice',
|
||||||
500: 'nested_bdev_lvol_create_on_full_lvol_store',
|
500: 'nested_bdev_lvol_create_on_full_lvol_store',
|
||||||
|
@ -127,7 +127,6 @@ def case_message(func):
|
|||||||
300: 'bdev_lvol_delete_lvstore_nonexistent_lvs_uuid',
|
300: 'bdev_lvol_delete_lvstore_nonexistent_lvs_uuid',
|
||||||
301: 'delete_lvol_store_underlying_bdev',
|
301: 'delete_lvol_store_underlying_bdev',
|
||||||
# bdev_lvol_create_lvstore - negative tests
|
# bdev_lvol_create_lvstore - negative tests
|
||||||
450: 'construct_lvs_nonexistent_bdev',
|
|
||||||
451: 'construct_lvs_on_bdev_twice',
|
451: 'construct_lvs_on_bdev_twice',
|
||||||
452: 'construct_lvs_name_twice',
|
452: 'construct_lvs_name_twice',
|
||||||
# nested bdev_lvol_create - test negative
|
# nested bdev_lvol_create - test negative
|
||||||
@ -727,24 +726,6 @@ class TestCases(object):
|
|||||||
return fail_count
|
return fail_count
|
||||||
|
|
||||||
# negative tests
|
# 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
|
@case_message
|
||||||
def test_case451(self):
|
def test_case451(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user