1919# Import Local Modules
2020from marvin .cloudstackTestCase import cloudstackTestCase , unittest
2121from marvin .cloudstackAPI import listZones , updateIso , extractIso , updateIsoPermissions , copyIso , deleteIso
22- from marvin .lib .utils import cleanup_resources , random_gen
22+ from marvin .lib .utils import cleanup_resources , random_gen , get_hypervisor_type
2323from marvin .lib .base import Account , Iso
2424from marvin .lib .common import (get_domain ,
2525 get_zone ,
@@ -147,6 +147,12 @@ def setUpClass(cls):
147147 testClient = super (TestISO , cls ).getClsTestClient ()
148148 cls .apiclient = testClient .getApiClient ()
149149 cls .services = testClient .getParsedTestDataConfig ()
150+ cls ._cleanup = []
151+ cls .unsupportedHypervisor = False
152+ cls .hypervisor = get_hypervisor_type (cls .apiclient )
153+ if cls .hypervisor == "simulator" :
154+ cls .unsupportedHypervisor = True
155+ return
150156
151157 # Get Zone, Domain and templates
152158 cls .domain = get_domain (cls .apiclient )
@@ -168,6 +174,7 @@ def setUpClass(cls):
168174 cls .services ["account" ],
169175 domainid = cls .domain .id
170176 )
177+ cls ._cleanup .append (cls .account )
171178 # Finding the OsTypeId from Ostype
172179 ostypes = list_os_types (
173180 cls .apiclient ,
@@ -203,8 +210,6 @@ def setUpClass(cls):
203210 except Exception as e :
204211 raise Exception ("Exception while downloading ISO %s: %s"
205212 % (cls .iso_2 .id , e ))
206-
207- cls ._cleanup = [cls .account ]
208213 return
209214
210215 @classmethod
@@ -226,6 +231,10 @@ def setUp(self):
226231 self .dbclient = self .testClient .getDbConnection ()
227232 self .cleanup = []
228233
234+ if self .unsupportedHypervisor :
235+ self .skipTest ("Skipping test because unsupported hypervisor\
236+ %s" % self .hypervisor )
237+
229238 def tearDown (self ):
230239 try :
231240 # Clean up, terminate the created ISOs, VMs
0 commit comments