[Tempest] Fix negative replication test

Test "test_try_add_replica_to_share_with_no_replication_share_type"
located in "manila_tempest_tests/tests/api/test_replication_negative.py"
tries to verify that replica cannot be created on share that was created
using share type without replication suppport. But it uses default
share type that can have anything configured in it. Therefore,
make this test create share type for its needs.

Change-Id: I8d27e2522a973350b287fc53d052726044465168
Closes-Bug: #1592874
This commit is contained in:
Valeriy Ponomaryov 2016-06-15 18:53:44 +03:00
parent 66976ed508
commit e49d39cde0

View File

@ -78,7 +78,11 @@ class ReplicationNegativeTest(base.BaseSharesMixedTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_add_replica_to_share_with_no_replication_share_type(self):
# Create share without replication type
share = self.create_share()
share_type = self.create_share_type(
data_utils.rand_name(constants.TEMPEST_MANILA_PREFIX),
extra_specs=self.add_required_extra_specs_to_dict(),
client=self.admin_client)["share_type"]
share = self.create_share(share_type_id=share_type["id"])
self.assertRaises(lib_exc.BadRequest,
self.create_share_replica,
share['id'],