test/lvol: Reordering existing test cases.

It will allow to put another test cases
in specifig group.

Change-Id: Id352aa516676f78cdb102f8eac70144f115976a5
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/389098
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Pawel Kaminski 2017-11-27 17:42:39 +01:00 committed by Jim Harris
parent 415a1485cf
commit 23782bc43c
3 changed files with 405 additions and 403 deletions

View File

@ -154,7 +154,9 @@ fi
if [ $SPDK_TEST_LVOL -eq 1 ]; then if [ $SPDK_TEST_LVOL -eq 1 ]; then
timing_enter lvol timing_enter lvol
run_test ./test/lvol/lvol.sh --test-cases=1,2,3,4,5,7,8,9,10,13,14,15,16,17,18,21,22,25,26,27,28,29 test_cases="1,50,51,52,53,100,101,102,250,251,252,253,"
test_cases+="300,301,450,451,452,550,600,601,650,700"
run_test ./test/lvol/lvol.sh --test-cases=$test_cases
timing_exit lvol timing_exit lvol
fi fi

View File

@ -24,34 +24,34 @@ def test_counter():
def header(num): def header(num):
test_name = { test_name = {
1: 'construct_lvs_positive', 1: 'construct_lvs_positive',
2: 'construct_logical_volume_positive', 50: 'construct_logical_volume_positive',
3: 'construct_multi_logical_volumes_positive', 51: 'construct_multi_logical_volumes_positive',
4: 'construct_lvol_bdev_using_name_positive', 52: 'construct_lvol_bdev_using_name_positive',
5: 'construct_lvol_bdev_duplicate_names_positive', 53: 'construct_lvol_bdev_duplicate_names_positive',
6: 'resize_lvol_bdev_positive', 100: 'construct_logical_volume_nonexistent_lvs_uuid',
7: 'destroy_lvol_store_positive', 101: 'construct_lvol_bdev_on_full_lvol_store',
8: 'destroy_lvol_store_use_name_positive', 102: 'construct_lvol_bdev_name_twice',
9: 'destroy_lvol_store_with_lvol_bdev_positive', 150: 'resize_lvol_bdev_positive',
10: 'destroy_multi_logical_volumes_positive', 200: 'resize_logical_volume_nonexistent_logical_volume',
11: 'nested_construct_logical_volume_positive', 201: 'resize_logical_volume_with_size_out_of_range',
12: 'destroy_after_resize_lvol_bdev_positive', 250: 'destroy_lvol_store_positive',
13: 'construct_lvs_nonexistent_bdev', 251: 'destroy_lvol_store_use_name_positive',
14: 'construct_lvs_on_bdev_twice', 252: 'destroy_lvol_store_with_lvol_bdev_positive',
15: 'construct_lvs_name_twice', 253: 'destroy_multi_logical_volumes_positive',
16: 'construct_logical_volume_nonexistent_lvs_uuid', 254: 'destroy_after_resize_lvol_bdev_positive',
17: 'construct_lvol_bdev_on_full_lvol_store', 300: 'destroy_lvol_store_nonexistent_lvs_uuid',
18: 'construct_lvol_bdev_name_twice', 301: 'delete_lvol_store_underlying_bdev',
19: 'resize_logical_volume_nonexistent_logical_volume', 350: 'nested_destroy_logical_volume_negative',
20: 'resize_logical_volume_with_size_out_of_range', 400: 'nested_construct_logical_volume_positive',
21: 'destroy_lvol_store_nonexistent_lvs_uuid', 450: 'construct_lvs_nonexistent_bdev',
22: 'delete_lvol_store_underlying_bdev', 451: 'construct_lvs_on_bdev_twice',
23: 'nested_construct_lvol_bdev_on_full_lvol_store', 452: 'construct_lvs_name_twice',
24: 'nested_destroy_logical_volume_negative', 500: 'nested_construct_lvol_bdev_on_full_lvol_store',
25: 'delete_bdev_positive', 550: 'delete_bdev_positive',
26: 'construct_lvol_store_with_cluster_size_max', 600: 'construct_lvol_store_with_cluster_size_max',
27: 'construct_lvol_store_with_cluster_size_min', 601: 'construct_lvol_store_with_cluster_size_min',
28: 'tasting_positive', 650: 'tasting_positive',
29: 'SIGTERM', 700: 'SIGTERM',
} }
print("========================================================") print("========================================================")
print("Test Case {num}: Start".format(num=num)) print("Test Case {num}: Start".format(num=num))
@ -155,8 +155,8 @@ class TestCases(object):
footer(1) footer(1)
return fail_count return fail_count
def test_case2(self): def test_case50(self):
header(2) header(50)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -172,11 +172,11 @@ class TestCases(object):
self.c.delete_bdev(uuid_bdev) self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(2) footer(50)
return fail_count return fail_count
def test_case3(self): def test_case51(self):
header(3) header(51)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -199,11 +199,11 @@ class TestCases(object):
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(3) footer(51)
return fail_count return fail_count
def test_case4(self): def test_case52(self):
header(4) header(52)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
@ -223,11 +223,11 @@ class TestCases(object):
fail_count += self.c.delete_bdev(uuid_bdev) fail_count += self.c.delete_bdev(uuid_bdev)
fail_count += self.c.destroy_lvol_store(uuid_store) fail_count += self.c.destroy_lvol_store(uuid_store)
fail_count += self.c.delete_bdev(base_name) fail_count += self.c.delete_bdev(base_name)
footer(4) footer(52)
return fail_count return fail_count
def test_case5(self): def test_case53(self):
header(5) header(53)
base_name_1 = self.c.construct_malloc_bdev(self.total_size, base_name_1 = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
base_name_2 = self.c.construct_malloc_bdev(self.total_size, base_name_2 = self.c.construct_malloc_bdev(self.total_size,
@ -259,11 +259,72 @@ class TestCases(object):
fail_count += self.c.destroy_lvol_store(uuid_store_2) fail_count += self.c.destroy_lvol_store(uuid_store_2)
fail_count += self.c.delete_bdev(base_name_1) fail_count += self.c.delete_bdev(base_name_1)
fail_count += self.c.delete_bdev(base_name_2) fail_count += self.c.delete_bdev(base_name_2)
footer(5) footer(53)
return fail_count return fail_count
def test_case6(self): def test_case100(self):
header(6) header(100)
fail_count = 0
if self.c.construct_lvol_bdev(self._gen_lvs_uudi(),
self.lbd_name,
32) == 0:
fail_count += 1
footer(100)
return fail_count
def test_case101(self):
header(101)
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
uuid_bdev = self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
self.total_size - 1)
fail_count += self.c.check_get_bdevs_methods(uuid_bdev,
self.total_size - 1)
if self.c.construct_lvol_bdev(uuid_store,
self.lbd_name + "_1",
self.total_size - 1) == 0:
fail_count += 1
self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name)
footer(101)
return fail_count
def test_case102(self):
header(102)
size = (self.total_size / 2) - 1
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
uuid_bdev = self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
size)
fail_count += self.c.check_get_bdevs_methods(uuid_bdev,
size)
if self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
size) == 0:
fail_count += 1
self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name)
footer(102)
return fail_count
def test_case150(self):
header(150)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -292,11 +353,42 @@ class TestCases(object):
self.c.delete_bdev(uuid_bdev) self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(6) footer(150)
return fail_count return fail_count
def test_case7(self): def test_case200(self):
header(7) header(200)
fail_count = 0
if self.c.resize_lvol_bdev(self._gen_lvb_uudi(), 16) == 0:
fail_count += 1
footer(200)
return fail_count
def test_case201(self):
header(201)
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
uuid_bdev = self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
self.total_size - 1)
fail_count += self.c.check_get_bdevs_methods(uuid_bdev,
self.total_size - 1)
if self.c.resize_lvol_bdev(uuid_bdev, self.total_size + 1) == 0:
fail_count += 1
self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name)
footer(201)
return fail_count
def test_case250(self):
header(250)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -307,11 +399,11 @@ class TestCases(object):
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
fail_count += self.c.check_get_lvol_stores("", "", "") fail_count += self.c.check_get_lvol_stores("", "", "")
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(7) footer(250)
return fail_count return fail_count
def test_case8(self): def test_case251(self):
header(8) header(251)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -322,11 +414,11 @@ class TestCases(object):
fail_count += self.c.destroy_lvol_store(self.lvs_name) fail_count += self.c.destroy_lvol_store(self.lvs_name)
fail_count += self.c.check_get_lvol_stores("", "", "") fail_count += self.c.check_get_lvol_stores("", "", "")
fail_count += self.c.delete_bdev(base_name) fail_count += self.c.delete_bdev(base_name)
footer(8) footer(251)
return fail_count return fail_count
def test_case9(self): def test_case252(self):
header(9) header(252)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -344,11 +436,11 @@ class TestCases(object):
fail_count += self.c.check_get_lvol_stores("", "", "") fail_count += self.c.check_get_lvol_stores("", "", "")
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(9) footer(252)
return fail_count return fail_count
def test_case10(self): def test_case253(self):
header(10) header(253)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -367,16 +459,11 @@ class TestCases(object):
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
fail_count += self.c.check_get_lvol_stores("", "", "") fail_count += self.c.check_get_lvol_stores("", "", "")
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(10) footer(253)
return fail_count return fail_count
def test_case11(self): def test_case254(self):
print("Test of this feature not yet implemented.") header(254)
pass
return 0
def test_case12(self):
header(12)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -402,23 +489,60 @@ class TestCases(object):
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
fail_count += self.c.check_get_lvol_stores("", "", "") fail_count += self.c.check_get_lvol_stores("", "", "")
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(12) footer(254)
return fail_count return fail_count
def test_case300(self):
header(300)
fail_count = 0
if self.c.destroy_lvol_store(self._gen_lvs_uudi()) == 0:
fail_count += 1
footer(300)
return fail_count
def test_case301(self):
header(301)
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
if self.c.delete_bdev(base_name) != 0:
fail_count += 1
if self.c.destroy_lvol_store(uuid_store) == 0:
fail_count += 1
footer(301)
return fail_count
def test_case350(self):
print("Test of this feature not yet implemented.")
pass
return 0
def test_case400(self):
print("Test of this feature not yet implemented.")
pass
return 0
# negative tests # negative tests
def test_case13(self): def test_case450(self):
header(13) header(450)
fail_count = 0 fail_count = 0
bad_bdev_id = random.randrange(999999999) bad_bdev_id = random.randrange(999999999)
if self.c.construct_lvol_store(bad_bdev_id, if self.c.construct_lvol_store(bad_bdev_id,
self.lvs_name, self.lvs_name,
self.cluster_size) == 0: self.cluster_size) == 0:
fail_count += 1 fail_count += 1
footer(13) footer(450)
return fail_count return fail_count
def test_case14(self): def test_case451(self):
header(14) header(451)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -432,11 +556,11 @@ class TestCases(object):
fail_count += 1 fail_count += 1
self.c.destroy_lvol_store(uuid_store) self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
footer(14) footer(451)
return fail_count return fail_count
def test_case15(self): def test_case452(self):
header(15) header(452)
fail_count = 0 fail_count = 0
base_name_1 = self.c.construct_malloc_bdev(self.total_size, base_name_1 = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
@ -457,140 +581,16 @@ class TestCases(object):
fail_count += self.c.delete_bdev(base_name_1) fail_count += self.c.delete_bdev(base_name_1)
fail_count += self.c.delete_bdev(base_name_2) fail_count += self.c.delete_bdev(base_name_2)
footer(15) footer(452)
return fail_count return fail_count
def test_case16(self): def test_case500(self):
header(16)
fail_count = 0
if self.c.construct_lvol_bdev(self._gen_lvs_uudi(),
self.lbd_name,
32) == 0:
fail_count += 1
footer(16)
return fail_count
def test_case17(self):
header(17)
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
uuid_bdev = self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
self.total_size - 1)
fail_count += self.c.check_get_bdevs_methods(uuid_bdev,
self.total_size - 1)
if self.c.construct_lvol_bdev(uuid_store,
self.lbd_name + "_1",
self.total_size - 1) == 0:
fail_count += 1
self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name)
footer(17)
return fail_count
def test_case18(self):
header(18)
size = (self.total_size / 2) - 1
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
uuid_bdev = self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
size)
fail_count += self.c.check_get_bdevs_methods(uuid_bdev,
size)
if self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
size) == 0:
fail_count += 1
self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name)
footer(18)
return fail_count
def test_case19(self):
header(19)
fail_count = 0
if self.c.resize_lvol_bdev(self._gen_lvb_uudi(), 16) == 0:
fail_count += 1
footer(19)
return fail_count
def test_case20(self):
header(20)
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
uuid_bdev = self.c.construct_lvol_bdev(uuid_store,
self.lbd_name,
self.total_size - 1)
fail_count += self.c.check_get_bdevs_methods(uuid_bdev,
self.total_size - 1)
if self.c.resize_lvol_bdev(uuid_bdev, self.total_size + 1) == 0:
fail_count += 1
self.c.delete_bdev(uuid_bdev)
self.c.destroy_lvol_store(uuid_store)
self.c.delete_bdev(base_name)
footer(20)
return fail_count
def test_case21(self):
header(21)
fail_count = 0
if self.c.destroy_lvol_store(self._gen_lvs_uudi()) == 0:
fail_count += 1
footer(21)
return fail_count
def test_case22(self):
header(22)
base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size)
uuid_store = self.c.construct_lvol_store(base_name,
self.lvs_name,
self.cluster_size)
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size)
if self.c.delete_bdev(base_name) != 0:
fail_count += 1
if self.c.destroy_lvol_store(uuid_store) == 0:
fail_count += 1
footer(22)
return fail_count
def test_case23(self):
print("Test of this feature not yet implemented.") print("Test of this feature not yet implemented.")
pass pass
return 0 return 0
def test_case24(self): def test_case550(self):
print("Test of this feature not yet implemented.") header(550)
pass
return 0
def test_case25(self):
header(25)
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
uuid_store = self.c.construct_lvol_store(base_name, uuid_store = self.c.construct_lvol_store(base_name,
@ -599,12 +599,13 @@ class TestCases(object):
fail_count = self.c.check_get_lvol_stores(base_name, uuid_store, fail_count = self.c.check_get_lvol_stores(base_name, uuid_store,
self.cluster_size) self.cluster_size)
self.c.delete_bdev(base_name) self.c.delete_bdev(base_name)
fail_count += self.c.check_get_lvol_stores("", "", "") if self.c.check_get_lvol_stores("", "", "") == 1:
footer(25) fail_count += 1
footer(550)
return fail_count return fail_count
def test_case26(self): def test_case600(self):
header(26) header(600)
fail_count = 0 fail_count = 0
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
@ -612,22 +613,22 @@ class TestCases(object):
self.lvs_name, self.lvs_name,
(self.total_size * 1024 * 1024) + 1) == 0: (self.total_size * 1024 * 1024) + 1) == 0:
fail_count += 1 fail_count += 1
footer(26) footer(600)
return fail_count return fail_count
def test_case27(self): def test_case601(self):
header(27) header(601)
fail_count = 0 fail_count = 0
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
self.block_size) self.block_size)
if self.c.construct_lvol_store(base_name, if self.c.construct_lvol_store(base_name,
self.lvs_name, 0) == 0: self.lvs_name, 0) == 0:
fail_count += 1 fail_count += 1
footer(27) footer(601)
return fail_count return fail_count
def test_case28(self): def test_case650(self):
header(28) header(650)
fail_count = 0 fail_count = 0
uuid_bdevs = [] uuid_bdevs = []
base_name = "Nvme0n1" base_name = "Nvme0n1"
@ -666,7 +667,7 @@ class TestCases(object):
remove(pid_path) remove(pid_path)
if self._start_vhost(vhost_path, config_path, pid_path) != 0: if self._start_vhost(vhost_path, config_path, pid_path) != 0:
fail_count += 1 fail_count += 1
footer(28) footer(650)
return fail_count return fail_count
# Check if configuration was properly loaded after tasting # Check if configuration was properly loaded after tasting
@ -693,7 +694,7 @@ class TestCases(object):
pprint.pprint([o, n]) pprint.pprint([o, n])
if fail_count != 0: if fail_count != 0:
footer(28) footer(650)
return fail_count return fail_count
# Try modifying loaded configuration # Try modifying loaded configuration
@ -731,11 +732,11 @@ class TestCases(object):
if self.c.destroy_lvol_store(uuid_store) != 0: if self.c.destroy_lvol_store(uuid_store) != 0:
fail_count += 1 fail_count += 1
footer(28) footer(650)
return fail_count return fail_count
def test_case29(self): def test_case700(self):
header(29) header(700)
pid_path = path.join(self.path, 'vhost.pid') pid_path = path.join(self.path, 'vhost.pid')
base_name = self.c.construct_malloc_bdev(self.total_size, base_name = self.c.construct_malloc_bdev(self.total_size,
@ -747,5 +748,5 @@ class TestCases(object):
self.cluster_size) self.cluster_size)
fail_count += self._stop_vhost(pid_path) fail_count += self._stop_vhost(pid_path)
footer(29) footer(700)
return fail_count return fail_count

View File

@ -38,7 +38,7 @@ Expected result:
### construct_lvol_bdev - positive tests ### construct_lvol_bdev - positive tests
#### TEST CASE 2 - Name: construct_logical_volume_positive #### TEST CASE 50 - Name: construct_logical_volume_positive
Positive test for constructing a new logical volume. Positive test for constructing a new logical volume.
Call construct_lvol_bdev with correct lvol store UUID and size in MiB for this bdev. Call construct_lvol_bdev with correct lvol store UUID and size in MiB for this bdev.
Steps: Steps:
@ -56,7 +56,7 @@ Expected result:
field set with the same name as returned value from call RPC method: construct_lvol_bdev field set with the same name as returned value from call RPC method: construct_lvol_bdev
- no other operation fails - no other operation fails
#### TEST CASE 3 - Name: construct_multi_logical_volumes_positive #### TEST CASE 51 - Name: construct_multi_logical_volumes_positive
Positive test for constructing a multi logical volumes. Positive test for constructing a multi logical volumes.
Call construct_lvol_bdev with correct lvol store UUID and Call construct_lvol_bdev with correct lvol store UUID and
size is equal one quarter of the this bdev size. size is equal one quarter of the this bdev size.
@ -78,7 +78,7 @@ Expected result:
field set with the same name as returned from RPC call for all repeat field set with the same name as returned from RPC call for all repeat
- no other operation fails - no other operation fails
#### TEST CASE 4 - Name: construct_lvol_bdev_using_name_positive #### TEST CASE 52 - Name: construct_lvol_bdev_using_name_positive
Positive test for constructing a logical volume using friendly names. Positive test for constructing a logical volume using friendly names.
Verify that logical volumes can be created by using a friendly name Verify that logical volumes can be created by using a friendly name
instead of uuid when referencing to lvol store. instead of uuid when referencing to lvol store.
@ -97,7 +97,7 @@ Expected result:
- calls successful, return code = 0 - calls successful, return code = 0
- no other operation fails - no other operation fails
#### TEST CASE 5 - Name: construct_lvol_bdev_duplicate_names_positive #### TEST CASE 53 - Name: construct_lvol_bdev_duplicate_names_positive
Positive test for constructing a logical volumes using friendly names. Positive test for constructing a logical volumes using friendly names.
Verify that logical volumes can use the same argument for friendly names Verify that logical volumes can use the same argument for friendly names
if they are created on separate logical volume stores. if they are created on separate logical volume stores.
@ -118,9 +118,62 @@ Expected result:
- calls successful, return code = 0 - calls successful, return code = 0
- no other operation fails - no other operation fails
### construct_lvol_bdev - negative tests
#### TEST CASE 100 - Name: construct_logical_volume_nonexistent_lvs_uuid
Negative test for constructing a new logical_volume.
Call construct_lvol_bdev with lvs_uuid which does not
exist in configuration.
Steps:
- try to call construct_lvol_bdev with lvs_uuid which does not exist
Expected result:
- return code != 0
- ENODEV response printed to stdout
#### TEST CASE 101 - Name: construct_lvol_bdev_on_full_lvol_store
Negative test for constructing a new lvol bdev.
Call construct_lvol_bdev on a full lvol store.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response from get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and size is smaller by 1 MB
from the full size malloc bdev
- try construct_lvol_bdev on the same lvs_uuid as in last step;
this call should fail as lvol store space is taken by previously created bdev
- destroy_lvol_store
- delete malloc bdev
Expected result:
- first call successful
- second construct_lvol_bdev call return code != 0
- EEXIST response printed to stdout
- no other operation fails
#### TEST CASE 102 - Name: construct_lvol_bdev_name_twice
Negative test for constructing lvol bdev using the same
friendly name twice on the same logical volume store.
Steps:
- create malloc bdev
- create logical volume store on malloc bdev
- using get_lvol_stores verify that logical volume store was correctly created
and has arguments as provided in step earlier (cluster size, friendly name, base bdev)
- construct logical volume on lvol store and verify it was correctly created
- try to create another logical volume on the same lvol store using
the same friendly name as in previous step; this step should fail
- delete existing lvol bdev
- delete existing lvol store
- delete malloc bdevs
Expected results:
- creating two logical volumes with the same friendly name within the same
lvol store should not be possible
- no other operation fails
### resize_lvol_store - positive tests ### resize_lvol_store - positive tests
#### TEST CASE 6 - Name: resize_logical_volume_positive #### TEST CASE 150 - Name: resize_logical_volume_positive
Positive test for resizing a logical_volume. Positive test for resizing a logical_volume.
Call resize_lvol_bdev with correct logical_volumes name and new size. Call resize_lvol_bdev with correct logical_volumes name and new size.
Steps: Steps:
@ -147,9 +200,43 @@ Expected result:
- calls successful, return code = 0 - calls successful, return code = 0
- no other operation fails - no other operation fails
### resize lvol store - negative tests
#### TEST CASE 200 - Name: resize_logical_volume_nonexistent_logical_volume
Negative test for resizing a logical_volume.
Call resize_lvol_bdev with logical volume which does not
exist in configuration.
Steps:
- try resize_lvol_store on logical volume which does not exist
Expected result:
- return code != 0
- Error code: ENODEV ("No such device") response printed to stdout
#### TEST CASE 201 - Name: resize_logical_volume_with_size_out_of_range
Negative test for resizing a logical volume.
Call resize_lvol_store with size argument bigger than size of base bdev.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and
size is equal one quarter of size malloc bdev
- try resize_lvol_bdev on correct lvs_uuid and size is
equal to size malloc bdev + 1MiB; this call should fail
- delete lvol bdev
- destroy lvol store
- delete malloc bdev
Expected result:
- resize_lvol_bdev call return code != 0
- Error code: ENODEV ("Not enough free clusters left on lvol store")
response printed to stdout
- no other operation fails
### destroy_lvol_store - positive tests ### destroy_lvol_store - positive tests
#### TEST CASE 7 - Name: destroy_lvol_store_positive #### TEST CASE 250 - Name: destroy_lvol_store_positive
Positive test for destroying a logical volume store. Positive test for destroying a logical volume store.
Call destroy_lvol_store with correct logical_volumes name Call destroy_lvol_store with correct logical_volumes name
Steps: Steps:
@ -165,7 +252,7 @@ Expected result:
- get_lvol_stores: response should be of no value after destroyed lvol store - get_lvol_stores: response should be of no value after destroyed lvol store
- no other operation fails - no other operation fails
#### TEST CASE 8 - Name: destroy_lvol_store_use_name_positive #### TEST CASE 251 - Name: destroy_lvol_store_use_name_positive
Positive test for destroying a logical volume store using Positive test for destroying a logical volume store using
lvol store name instead of uuid for reference. lvol store name instead of uuid for reference.
Call destroy_lvol_store with correct logical volume name Call destroy_lvol_store with correct logical volume name
@ -182,7 +269,7 @@ Expected result:
- get_lvol_stores: response should be of no value after destroyed lvol store - get_lvol_stores: response should be of no value after destroyed lvol store
- no other operation fails - no other operation fails
#### TEST CASE 9 - Name: destroy_lvol_store_with_lvol_bdev_positive #### TEST CASE 252 - Name: destroy_lvol_store_with_lvol_bdev_positive
Positive test for destroying a logical volume store with lvol bdev Positive test for destroying a logical volume store with lvol bdev
created on top. created on top.
Call destroy_lvol_store with correct logical_volumes name Call destroy_lvol_store with correct logical_volumes name
@ -200,7 +287,7 @@ Expected result:
- get_lvol_stores: response should be of no value after destroyed lvol store - get_lvol_stores: response should be of no value after destroyed lvol store
- no other operation fails - no other operation fails
#### TEST CASE 10 - Name: destroy_multi_logical_volumes_positive #### TEST CASE 253 - Name: destroy_multi_logical_volumes_positive
Positive test for destroying a logical volume store with multiple lvol Positive test for destroying a logical volume store with multiple lvol
bdevs created on top. bdevs created on top.
Call construct_lvol_bdev with correct lvol store UUID and Call construct_lvol_bdev with correct lvol store UUID and
@ -222,38 +309,7 @@ Expected result:
field set with the same name as returned from RPC call for all repeat field set with the same name as returned from RPC call for all repeat
- no other operation fails - no other operation fails
### nested_construct_logical_volume - positive tests #### TEST CASE 254 - Name: destroy_resize_logical_volume_positive
#### TEST CASE 11 - Name: nested_construct_logical_volume_positive
Positive test for constructing a nested new lvol store.
Call construct_lvol_store with correct base bdev name.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and size is
equal to size malloc bdev
- construct first nested lvol store on created lvol_bdev
- check correct uuid values in response get_lvol_stores command
- construct first nested lvol bdev on correct lvs_uuid and size
- construct second nested lvol store on created first nested lvol bdev
- check correct uuid values in response get_lvol_stores command
- construct second nested lvol bdev on correct first nested lvs uuid and size
- delete nested lvol bdev and lvol store
- delete base lvol bdev and lvol store
- delete malloc bdev
Expected result:
- calls successful, return code = 0
- get_lvol_stores: backend used for construct_lvol_store has UUID
field set with the same UUID as returned from RPC call
backend used for construct_lvol_bdev has UUID
field set with the same UUID as returned from RPC call
- no other operation fails
### destroy_lvol_store - positive tests
#### TEST CASE 12 - Name: destroy_resize_logical_volume_positive
Positive test for destroying a logical_volume after resizing. Positive test for destroying a logical_volume after resizing.
Call destroy_lvol_store with correct logical_volumes name. Call destroy_lvol_store with correct logical_volumes name.
Steps: Steps:
@ -280,9 +336,88 @@ Expected result:
- no other operation fails - no other operation fails
- get_lvol_stores: response should be of no value after destroyed lvol store - get_lvol_stores: response should be of no value after destroyed lvol store
### destroy_lvol_store - negative tests
#### TEST CASE 300 - Name: destroy_lvol_store_nonexistent_lvs_uuid
Call destroy_lvol_store with nonexistent logical_volumes name
exist in configuration.
Steps:
- try to call destroy_lvol_store with lvs_uuid which does not exist
Expected result:
- return code != 0
- Error code response printed to stdout
#### TEST CASE 301 - Name: delete_lvol_store_underlying_bdev
Call destroy_lvol_store after deleting it's base bdev.
Lvol store should be automatically removed on deleting underlying bdev.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- delete malloc bdev
- try to destroy lvol store; this call should fail as lvol store
is no longer present
Expected result:
- destroy_lvol_store retudn code != 0
- Error code: ENODEV ("No such device") response printed to stdout
- no other operation fails
### nested destroy_lvol_bdev - negative tests
#### TEST CASE 350 - Name: nested_destroy_logical_volume_negative
Negative test for destroying a nested first lvol store.
Call destroy_lvol_store with correct base bdev name.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and size is
equal to size malloc bdev
- construct first nested lvol store on created lvol_bdev
- check correct uuid values in response get_lvol_stores command
- construct first nested lvol bdev on correct lvs_uuid and size
- check size of the lvol bdev by command RPC : get_bdevs
- destroy first lvol_store
- delete malloc bdev
Expected result:
- Error code: ENODEV ("the device is busy") response printed to stdout
- no other operation fails
### nested construct_logical_volume - positive tests
#### TEST CASE 400 - Name: nested_construct_logical_volume_positive
Positive test for constructing a nested new lvol store.
Call construct_lvol_store with correct base bdev name.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and size is
equal to size malloc bdev
- construct first nested lvol store on created lvol_bdev
- check correct uuid values in response get_lvol_stores command
- construct first nested lvol bdev on correct lvs_uuid and size
- construct second nested lvol store on created first nested lvol bdev
- check correct uuid values in response get_lvol_stores command
- construct second nested lvol bdev on correct first nested lvs uuid and size
- delete nested lvol bdev and lvol store
- delete base lvol bdev and lvol store
- delete malloc bdev
Expected result:
- calls successful, return code = 0
- get_lvol_stores: backend used for construct_lvol_store has UUID
field set with the same UUID as returned from RPC call
backend used for construct_lvol_bdev has UUID
field set with the same UUID as returned from RPC call
- no other operation fails
### construct_lvol_store - negative tests ### construct_lvol_store - negative tests
#### TEST CASE 13 - Name: construct_lvs_nonexistent_bdev #### TEST CASE 450 - Name: construct_lvs_nonexistent_bdev
Negative test for constructing a new lvol store. Negative test for constructing a new lvol store.
Call construct_lvol_store with base bdev name which does not Call construct_lvol_store with base bdev name which does not
exist in configuration. exist in configuration.
@ -293,7 +428,7 @@ Expected result:
- return code != 0 - return code != 0
- Error code: ENODEV ("No such device") response printed to stdout - Error code: ENODEV ("No such device") response printed to stdout
#### TEST CASE 14 - Name: construct_lvs_on_bdev_twice #### TEST CASE 451 - Name: construct_lvs_on_bdev_twice
Negative test for constructing a new lvol store. Negative test for constructing a new lvol store.
Call construct_lvol_store with base bdev name twice. Call construct_lvol_store with base bdev name twice.
Steps: Steps:
@ -311,7 +446,7 @@ Expected result:
- EEXIST response printed to stdout - EEXIST response printed to stdout
- no other operation fails - no other operation fails
#### TEST CASE 15 - Name: construct_lvs_name_twice #### TEST CASE 452 - Name: construct_lvs_name_twice
Negative test for constructing a new lvol store using the same Negative test for constructing a new lvol store using the same
friendly name twice. friendly name twice.
Steps: Steps:
@ -330,124 +465,9 @@ Expected results:
not be possible not be possible
- no other operation fails - no other operation fails
### construct_lvol_bdev - negative tests
#### TEST CASE 16 - Name: construct_logical_volume_nonexistent_lvs_uuid
Negative test for constructing a new logical_volume.
Call construct_lvol_bdev with lvs_uuid which does not
exist in configuration.
Steps:
- try to call construct_lvol_bdev with lvs_uuid which does not exist
Expected result:
- return code != 0
- ENODEV response printed to stdout
#### TEST CASE 17 - Name: construct_lvol_bdev_on_full_lvol_store
Negative test for constructing a new lvol bdev.
Call construct_lvol_bdev on a full lvol store.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response from get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and size is smaller by 1 MB
from the full size malloc bdev
- try construct_lvol_bdev on the same lvs_uuid as in last step;
this call should fail as lvol store space is taken by previously created bdev
- destroy_lvol_store
- delete malloc bdev
Expected result:
- first call successful
- second construct_lvol_bdev call return code != 0
- EEXIST response printed to stdout
- no other operation fails
#### TEST CASE 18 - Name: construct_lvol_bdev_name_twice
Negative test for constructing lvol bdev using the same
friendly name twice on the same logical volume store.
Steps:
- create malloc bdev
- create logical volume store on malloc bdev
- using get_lvol_stores verify that logical volume store was correctly created
and has arguments as provided in step earlier (cluster size, friendly name, base bdev)
- construct logical volume on lvol store and verify it was correctly created
- try to create another logical volume on the same lvol store using
the same friendly name as in previous step; this step should fail
- delete existing lvol bdev
- delete existing lvol store
- delete malloc bdevs
Expected results:
- creating two logical volumes with the same friendly name within the same
lvol store should not be possible
- no other operation fails
### resize_lvol_store - negative tests
#### TEST CASE 19 - Name: resize_logical_volume_nonexistent_logical_volume
Negative test for resizing a logical_volume.
Call resize_lvol_bdev with logical volume which does not
exist in configuration.
Steps:
- try resize_lvol_store on logical volume which does not exist
Expected result:
- return code != 0
- Error code: ENODEV ("No such device") response printed to stdout
#### TEST CASE 20 - Name: resize_logical_volume_with_size_out_of_range
Negative test for resizing a logical volume.
Call resize_lvol_store with size argument bigger than size of base bdev.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and
size is equal one quarter of size malloc bdev
- try resize_lvol_bdev on correct lvs_uuid and size is
equal to size malloc bdev + 1MiB; this call should fail
- delete lvol bdev
- destroy lvol store
- delete malloc bdev
Expected result:
- resize_lvol_bdev call return code != 0
- Error code: ENODEV ("Not enough free clusters left on lvol store")
response printed to stdout
- no other operation fails
### destroy_lvol_store - negative tests
#### TEST CASE 21 - Name: destroy_lvol_store_nonexistent_lvs_uuid
Call destroy_lvol_store with nonexistent logical_volumes name
exist in configuration.
Steps:
- try to call destroy_lvol_store with lvs_uuid which does not exist
Expected result:
- return code != 0
- Error code response printed to stdout
#### TEST CASE 22 - Name: delete_lvol_store_underlying_bdev
Call destroy_lvol_store after deleting it's base bdev.
Lvol store should be automatically removed on deleting underlying bdev.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- delete malloc bdev
- try to destroy lvol store; this call should fail as lvol store
is no longer present
Expected result:
- destroy_lvol_store retudn code != 0
- Error code: ENODEV ("No such device") response printed to stdout
- no other operation fails
### nested construct_lvol_bdev - test negative ### nested construct_lvol_bdev - test negative
#### TEST CASE 23 - Name: nested_construct_lvol_bdev_on_full_lvol_store #### TEST CASE 500 - Name: nested_construct_lvol_bdev_on_full_lvol_store
Negative test for constructing a new nested lvol bdev. Negative test for constructing a new nested lvol bdev.
Call construct_lvol_bdev on a full lvol store. Call construct_lvol_bdev on a full lvol store.
Steps: Steps:
@ -473,31 +493,9 @@ Expected result:
- EEXIST response printed to stdout - EEXIST response printed to stdout
- no other operation fails - no other operation fails
### destroy_lvol_store - negative tests
#### TEST CASE 24 - Name: nested_destroy_logical_volume_negative
Negative test for destroying a nested first lvol store.
Call destroy_lvol_store with correct base bdev name.
Steps:
- create a malloc bdev
- construct_lvol_store on created malloc bdev
- check correct uuid values in response get_lvol_stores command
- construct_lvol_bdev on correct lvs_uuid and size is
equal to size malloc bdev
- construct first nested lvol store on created lvol_bdev
- check correct uuid values in response get_lvol_stores command
- construct first nested lvol bdev on correct lvs_uuid and size
- check size of the lvol bdev by command RPC : get_bdevs
- destroy first lvol_store
- delete malloc bdev
Expected result:
- Error code: ENODEV ("the device is busy") response printed to stdout
- no other operation fails
### delete_bdev - positive tests ### delete_bdev - positive tests
#### TEST CASE 25 - Name: delete_bdev_positive #### TEST CASE 550 - Name: delete_bdev_positive
Positive test for deleting malloc bdev. Positive test for deleting malloc bdev.
Call construct_lvol_store with correct base bdev name. Call construct_lvol_store with correct base bdev name.
Steps: Steps:
@ -513,7 +511,7 @@ Expected result:
### construct_lvol_store_with_cluster_size - negative tests ### construct_lvol_store_with_cluster_size - negative tests
#### TEST CASE 26 - Name: construct_lvol_store_with_cluster_size_max #### TEST CASE 600 - Name: construct_lvol_store_with_cluster_size_max
Negative test for constructing a new lvol store. Negative test for constructing a new lvol store.
Call construct_lvol_store with cluster size is equal malloc bdev size + 1B. Call construct_lvol_store with cluster size is equal malloc bdev size + 1B.
Steps: Steps:
@ -525,7 +523,7 @@ Expected result:
- return code != 0 - return code != 0
- Error code response printed to stdout - Error code response printed to stdout
#### TEST CASE 27 - Name: construct_lvol_store_with_cluster_size_min #### TEST CASE 601 - Name: construct_lvol_store_with_cluster_size_min
Negative test for constructing a new lvol store. Negative test for constructing a new lvol store.
Call construct_lvol_store with cluster size = 0. Call construct_lvol_store with cluster size = 0.
Steps: Steps:
@ -538,7 +536,7 @@ Expected result:
### logical volume tasting tests ### logical volume tasting tests
#### TEST CASE 28 - Name: tasting_positive #### TEST CASE 650 - Name: tasting_positive
Positive test for tasting a multi lvol bdev configuration. Positive test for tasting a multi lvol bdev configuration.
Create a lvol store with some lvol bdevs on NVMe drive and restart vhost app. Create a lvol store with some lvol bdevs on NVMe drive and restart vhost app.
After restarting configuration should be automatically loaded and should be exactly After restarting configuration should be automatically loaded and should be exactly
@ -579,9 +577,10 @@ Expected results:
loading existing configuration loading existing configuration
- all RPC configuration calls successful, return code = 0 - all RPC configuration calls successful, return code = 0
- no other operation fails - no other operation fails
### SIGTERM ### SIGTERM
#### TEST CASE 29 - Name: SIGTERM #### TEST CASE 700 - Name: SIGTERM
Call CTRL+C (SIGTERM) occurs after creating lvol store Call CTRL+C (SIGTERM) occurs after creating lvol store
Steps: Steps:
- create a malloc bdev - create a malloc bdev