test/lvol: rewrite construct_lvs_on_bdev_twice to bash
Change-Id: Idd0b6e5f54111e22a3f9b5ea1e347d457069829c 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/+/459678 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
c3cc245401
commit
580b19f9df
@ -26,7 +26,7 @@ function test_construct_lvs() {
|
||||
[ "$(jq -r '.[0].free_clusters' <<< "$lvs")" = "$total_clusters" ]
|
||||
[ "$(( total_clusters * cluster_size ))" = "$LVS_DEFAULT_CAPACITY" ]
|
||||
|
||||
# remove it and verify it's gone
|
||||
# remove the lvs and verify it's gone
|
||||
rpc_cmd bdev_lvol_delete_lvstore -u "$lvs_uuid"
|
||||
rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid" && false
|
||||
rpc_cmd bdev_malloc_delete "$malloc_name"
|
||||
@ -41,6 +41,24 @@ function test_construct_lvs_nonexistent_bdev() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# try to create two lvol stores on the same bdev
|
||||
function test_construct_two_lvs_on_the_same_bdev() {
|
||||
# create an lvol store
|
||||
malloc_name=$(rpc_cmd bdev_malloc_create $MALLOC_SIZE_MB $MALLOC_BS)
|
||||
lvs_uuid=$(rpc_cmd bdev_lvol_create_lvstore "$malloc_name" lvs_test)
|
||||
|
||||
# try to create another lvs on the same malloc bdev
|
||||
rpc_cmd bdev_lvol_create_lvstore "$malloc_name" lvs_test2 && false
|
||||
|
||||
# clean up
|
||||
rpc_cmd bdev_lvol_delete_lvstore -u "$lvs_uuid"
|
||||
rpc_cmd bdev_lvol_get_lvstores -u "$lvs_uuid" && false
|
||||
rpc_cmd bdev_malloc_delete "$malloc_name"
|
||||
rpc_cmd bdev_get_bdevs -b "$malloc_name" && false
|
||||
check_leftover_devices
|
||||
}
|
||||
|
||||
|
||||
# create lvs + lvol on top, verify lvol's parameters
|
||||
function test_construct_lvol() {
|
||||
# create an lvol store
|
||||
@ -258,6 +276,7 @@ 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_two_lvs_on_the_same_bdev" test_construct_two_lvs_on_the_same_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
|
||||
|
@ -34,7 +34,6 @@ function usage() {
|
||||
301: 'delete_lvol_store_underlying_bdev',
|
||||
350: 'nested_destroy_logical_volume_negative',
|
||||
400: 'nested_construct_logical_volume_positive',
|
||||
451: 'construct_lvs_on_bdev_twice',
|
||||
452: 'construct_lvs_name_twice',
|
||||
500: 'nested_bdev_lvol_create_on_full_lvol_store',
|
||||
550: 'delete_bdev_positive',
|
||||
|
@ -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
|
||||
451: 'construct_lvs_on_bdev_twice',
|
||||
452: 'construct_lvs_name_twice',
|
||||
# nested bdev_lvol_create - test negative
|
||||
500: 'nested_bdev_lvol_create_on_full_lvol_store',
|
||||
@ -726,32 +725,6 @@ class TestCases(object):
|
||||
return fail_count
|
||||
|
||||
# negative tests
|
||||
@case_message
|
||||
def test_case451(self):
|
||||
"""
|
||||
construct_lvs_on_bdev_twice
|
||||
|
||||
Negative test for constructing a new lvol store.
|
||||
Call bdev_lvol_create_lvstore with base bdev name twice.
|
||||
"""
|
||||
# Create malloc bdev
|
||||
base_name = self.c.bdev_malloc_create(self.total_size,
|
||||
self.block_size)
|
||||
# Construct lvol store on created malloc bdev
|
||||
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)
|
||||
# Try bdev_lvol_create_lvstore on the same bdev as in last step
|
||||
# This call should fail as base bdev is already claimed by lvol store
|
||||
if self.c.bdev_lvol_create_lvstore(base_name,
|
||||
self.lvs_name) == 0:
|
||||
fail_count += 1
|
||||
self.c.bdev_lvol_delete_lvstore(uuid_store)
|
||||
self.c.bdev_malloc_delete(base_name)
|
||||
return fail_count
|
||||
|
||||
@case_message
|
||||
def test_case452(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user