trusts API test, avoid creating duplicate user
We currently call create_trustor_and_roles twice, in the base
class and the test class, which is wrong and results in the test
leaving a user behind which is not cleaned up. So only call it
in the test class, because we need self._interface to be set.
Change-Id: I9b96ae4435714d17bfd2b0b2abe570d98e61bfa6
Closes-Bug: #1267704
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 1ecc90c..d316ae1 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -28,10 +28,7 @@
super(BaseTrustsV3Test, self).setUp()
# Use alt_username as the trustee
self.trustee_username = self.config.identity.alt_username
-
self.trust_id = None
- self.create_trustor_and_roles()
- self.addCleanup(self.cleanup_user_and_roles)
def tearDown(self):
if self.trust_id:
@@ -50,7 +47,7 @@
# Create a trustor User
self.trustor_username = rand_name('user-')
u_desc = self.trustor_username + 'description'
- u_email = self.trustor_username + '@testmail.tm'
+ u_email = self.trustor_username + '@testmail.xx'
self.trustor_password = rand_name('pass-')
resp, user = self.v3_client.create_user(
self.trustor_username,
@@ -193,6 +190,7 @@
def setUp(self):
super(TrustsV3TestJSON, self).setUp()
self.create_trustor_and_roles()
+ self.addCleanup(self.cleanup_user_and_roles)
@attr(type='smoke')
def test_trust_impersonate(self):