Merge "[Share Groups] Fix creation of share group types with wrong specs values"

This commit is contained in:
Jenkins 2017-06-08 15:17:45 +00:00 committed by Gerrit Code Review
commit b8c05eb956
2 changed files with 11 additions and 1 deletions

View File

@ -69,6 +69,15 @@ class ShareGroupTypesAdminNegativeTest(base.BaseSharesMixedTest):
self.create_share_group_type,
"x" * 256, client=self.admin_shares_v2_client)
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_create_share_group_type_with_wrong_value_for_group_specs(self):
self.assertRaises(
lib_exc.BadRequest,
self.admin_shares_v2_client.create_share_group_type,
name=data_utils.rand_name("tempest_manila"),
share_types=[self.share_type['share_type']['id']],
group_specs="expecting_error_code_400")
@tc.attr(base.TAG_NEGATIVE, base.TAG_API)
def test_get_share_group_type_using_nonexistent_id(self):
self.assertRaises(

View File

@ -595,7 +595,8 @@ class BaseSharesTest(test.BaseTestCase):
group_specs=None, client=None,
cleanup_in_class=True, **kwargs):
client = client or cls.shares_v2_client
if group_specs is None:
if (group_specs is None and
CONF.share.capability_sg_consistent_snapshot_support):
group_specs = {
'consistent_snapshot_support': (
CONF.share.capability_sg_consistent_snapshot_support),