Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test_project cleanup
  • Loading branch information
DaanHoogland committed Oct 30, 2019
commit 897759b7296262992d8510058146bdc0cfea5cfc
25 changes: 13 additions & 12 deletions test/integration/smoke/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def setUpClass(cls):
def tearDownClass(cls):
try:
# Cleanup resources used
cleanup_resources(cls.api_client, cls._cleanup)
cleanup_resources(cls.api_client, reversed(cls._cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand All @@ -170,7 +170,7 @@ def setUp(self):
def tearDown(self):
try:
# Clean up, terminate the created accounts, domains etc
cleanup_resources(self.apiclient, self.cleanup)
cleanup_resources(self.apiclient, reversed(self.cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand Down Expand Up @@ -365,6 +365,7 @@ def setUpClass(cls):
cls.api_client,
cls.services["domain"]
)
cls._cleanup.append(cls.new_domain)

cls.account = Account.create(
cls.api_client,
Expand All @@ -387,7 +388,7 @@ def setUpClass(cls):
def tearDownClass(cls):
try:
# Cleanup resources used
cleanup_resources(cls.api_client, cls._cleanup)
cleanup_resources(cls.api_client, reversed(cls._cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand All @@ -404,7 +405,7 @@ def setUp(self):
def tearDown(self):
try:
# Clean up, terminate the created accounts, domains etc
cleanup_resources(self.apiclient, self.cleanup)
cleanup_resources(self.apiclient, reversed(self.cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand Down Expand Up @@ -518,7 +519,7 @@ def setUpClass(cls):
def tearDownClass(cls):
try:
# Cleanup resources used
cleanup_resources(cls.api_client, cls._cleanup)
cleanup_resources(cls.api_client, reversed(cls._cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand All @@ -535,7 +536,7 @@ def setUp(self):
def tearDown(self):
try:
# Clean up, terminate the created accounts, domains etc
cleanup_resources(self.apiclient, self.cleanup)
cleanup_resources(self.apiclient, reversed(self.cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand Down Expand Up @@ -1249,7 +1250,7 @@ def setUpClass(cls):
def tearDownClass(cls):
try:
# Cleanup resources used
cleanup_resources(cls.api_client, cls._cleanup)
cleanup_resources(cls.api_client, reversed(cls._cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand All @@ -1266,7 +1267,7 @@ def setUp(self):
def tearDown(self):
try:
# Clean up, terminate the created accounts, domains etc
cleanup_resources(self.apiclient, self.cleanup)
cleanup_resources(self.apiclient, reversed(self.cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand Down Expand Up @@ -1569,12 +1570,14 @@ def setUpClass(cls):
admin=True,
domainid=cls.domain.id
)
cls._cleanup.append(cls.account)
cls.user = Account.create(
cls.api_client,
cls.services["account"],
admin=True,
domainid=cls.domain.id
)
cls._cleanup.append(cls.user)

# Create project as a domain admin
cls.project = Project.create(
Expand All @@ -1584,16 +1587,14 @@ def setUpClass(cls):
domainid=cls.account.domainid
)
cls._cleanup.append(cls.project)
cls._cleanup.append(cls.account)
cls._cleanup.append(cls.user)
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
return

@classmethod
def tearDownClass(cls):
try:
# Cleanup resources used
cleanup_resources(cls.api_client, cls._cleanup)
cleanup_resources(cls.api_client, reversed(cls._cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand All @@ -1610,7 +1611,7 @@ def setUp(self):
def tearDown(self):
try:
# Clean up, terminate the created accounts, domains etc
cleanup_resources(self.apiclient, self.cleanup)
cleanup_resources(self.apiclient, reversed(self.cleanup))
except Exception as e:
raise Exception("Warning: Exception during cleanup : %s" % e)
return
Expand Down