Skip to content
Closed
Changes from all commits
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
17 changes: 17 additions & 0 deletions test/integration/testpaths/testpath_vmlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ def setUpClass(cls):
cls.zone = get_zone(cls.apiclient)
cls._cleanup = []

cls.skiptest = False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test require any special storage pool? or with any tags? If not, there is no reason to add this check as it is expected that storage pool is present in setup.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test does not require any special storage pool or with any tags. This check was put since it did not find any storage pool in UP state.i.e storage pool was present but was not in UP state.
So should I remove the check for skipTest?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for these checks. Instead the tests which leave the storage pool in disabled state should be looked at. Hold it for now.

cls.skiptest_reason = ""

cls.pools = StoragePool.list(cls.apiclient, zoneid=cls.zone.id)
if not cls.pools:
cls.skiptest = True
cls.skiptest_reason = "No Storage Pools available in setup."
else:
for storagePool in cls.pools:
if storagePool.state.lower() != UP:
cls.skiptest = True
cls.skiptest_reason = "No Storage Pools available in UP State in setup."

try:
# Create an account
cls.account = Account.create(
Expand Down Expand Up @@ -299,6 +312,10 @@ def tearDownClass(cls):
raise Exception("Warning: Exception during cleanup : %s" % e)

def setUp(self):
if self.skiptest:
self.skipTest(
"Skipping Test : %s" % self.skiptest_reason)

self.apiclient = self.testClient.getApiClient()
self.cleanup = []

Expand Down