add delete group type testcase

add delete group type api testcase for cinder module

Change-Id: I7e1e30a1832f292b6c405e4d23c0fe3818a07cdb
This commit is contained in:
wangzhiguang 2021-11-10 16:04:31 +08:00
parent ed89c77222
commit a27e6b41a8
1 changed files with 10 additions and 3 deletions

View File

@ -25,8 +25,8 @@ class GroupTypesTest(base.BaseVolumeAdminTest):
volume_max_microversion = 'latest'
@decorators.idempotent_id('dd71e5f9-393e-4d4f-90e9-fa1b8d278864')
def test_group_type_create_list_update_show(self):
"""Test create/list/update/show group type"""
def test_group_type_create_list_update_show_delete(self):
"""Test create/list/update/show/delete group type"""
name = data_utils.rand_name(self.__class__.__name__ + '-group-type')
description = data_utils.rand_name("group-type-description")
group_specs = {"consistent_group_snapshot_enabled": "<is> False"}
@ -34,7 +34,8 @@ class GroupTypesTest(base.BaseVolumeAdminTest):
'description': description,
'group_specs': group_specs,
'is_public': True}
body = self.create_group_type(**params)
body = self.admin_group_types_client.create_group_type(
**params)['group_type']
self.assertIn('name', body)
err_msg = ("The created group_type %(var)s is not equal to the "
"requested %(var)s")
@ -64,3 +65,9 @@ class GroupTypesTest(base.BaseVolumeAdminTest):
self.assertEqual(params[key], fetched_group_type[key],
'%s of the fetched group_type is different '
'from the created group_type' % key)
self.admin_group_types_client.delete_group_type(body['id'])
group_list = (
self.admin_group_types_client.list_group_types()['group_types'])
group_ids = [it['id'] for it in group_list]
self.assertNotIn(body['id'], group_ids)