From b3dab6031adbcb5f08b75e2ccb44874cf0ee688b Mon Sep 17 00:00:00 2001 From: pritisarap12 Date: Thu, 18 Jun 2015 14:10:40 +0530 Subject: [PATCH] CLOUDSTACK-8572:Unable to deploy VM as no storage pool found in UP state --- test/integration/testpaths/testpath_vmlc.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/integration/testpaths/testpath_vmlc.py b/test/integration/testpaths/testpath_vmlc.py index f63762775527..4ea21e476b46 100755 --- a/test/integration/testpaths/testpath_vmlc.py +++ b/test/integration/testpaths/testpath_vmlc.py @@ -176,6 +176,19 @@ def setUpClass(cls): cls.zone = get_zone(cls.apiclient) cls._cleanup = [] + cls.skiptest = False + 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( @@ -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 = []