@@ -60,28 +60,22 @@ def setUp(self):
60
60
return
61
61
62
62
def tearDown (self ):
63
- try :
64
- # Clean up, terminate the created templates
65
- cleanup_resources (self .apiclient , self .cleanup )
66
-
67
- except Exception as e :
68
- raise Exception ("Warning: Exception during cleanup : %s" % e )
69
- return
63
+ super (TestPrimaryStorageServices , self ).tearDown ()
70
64
71
65
@attr (tags = ["advanced" , "advancedns" , "smoke" , "basic" , "sg" ], required_hardware = "false" )
72
66
def test_01_primary_storage_nfs (self ):
73
67
"""Test primary storage pools - XEN, KVM, VMWare. Not Supported for hyperv
68
+
69
+ Validate the following:
70
+ 1. List Clusters
71
+ 2. verify that the cluster is in 'Enabled' allocation state
72
+ 3. verify that the host is added successfully and
73
+ in Up state with listHosts api response
74
74
"""
75
75
76
76
if self .hypervisor .lower () in ["hyperv" ]:
77
77
raise self .skipTest ("NFS primary storage not supported for Hyper-V" )
78
78
79
- # Validate the following:
80
- # 1. List Clusters
81
- # 2. verify that the cluster is in 'Enabled' allocation state
82
- # 3. verify that the host is added successfully and
83
- # in Up state with listHosts api response
84
-
85
79
# Create NFS storage pools with on XEN/KVM/VMWare clusters
86
80
87
81
clusters = list_clusters (
@@ -156,14 +150,17 @@ def test_01_primary_storage_nfs(self):
156
150
storage_response .type ,
157
151
"Check storage pool type "
158
152
)
159
- # Call cleanup for reusing primary storage
160
- cleanup_resources (self .apiclient , self .cleanup )
161
- self .cleanup = []
162
153
return
163
154
164
155
@attr (tags = ["advanced" , "advancedns" , "smoke" , "basic" , "sg" ], required_hardware = "true" )
165
156
def test_01_primary_storage_iscsi (self ):
166
157
"""Test primary storage pools - XEN. Not Supported for kvm,hyperv,vmware
158
+
159
+ Validate the following:
160
+ 1. List Clusters
161
+ 2. verify that the cluster is in 'Enabled' allocation state
162
+ 3. verify that the host is added successfully and
163
+ in Up state with listHosts api response
167
164
"""
168
165
169
166
if self .hypervisor .lower () in ["kvm" , "hyperv" , "vmware" , "lxc" ]:
@@ -172,12 +169,6 @@ def test_01_primary_storage_iscsi(self):
172
169
if not self .services ["configurableData" ]["iscsi" ]["url" ]:
173
170
raise self .skipTest ("iscsi test storage url not setup, skipping" )
174
171
175
- # Validate the following:
176
- # 1. List Clusters
177
- # 2. verify that the cluster is in 'Enabled' allocation state
178
- # 3. verify that the host is added successfully and
179
- # in Up state with listHosts api response
180
-
181
172
# Create iSCSI storage pools with on XEN/KVM clusters
182
173
clusters = list_clusters (
183
174
self .apiclient ,
@@ -251,10 +242,6 @@ def test_01_primary_storage_iscsi(self):
251
242
storage_response .type ,
252
243
"Check storage pool type "
253
244
)
254
- # Call cleanup for reusing primary storage
255
- cleanup_resources (self .apiclient , self .cleanup )
256
- self .cleanup = []
257
-
258
245
return
259
246
260
247
@attr (tags = ["advanced" , "advancedns" , "smoke" , "basic" , "sg" ], required_hardware = "false" )
@@ -293,7 +280,7 @@ def test_01_add_primary_storage_disabled_host(self):
293
280
zoneid = self .zone .id ,
294
281
podid = self .pod .id
295
282
)
296
- # self.cleanup.append(storage_pool_2)
283
+ self .cleanup .append (storage_pool_2 )
297
284
298
285
# Enable host and disable others
299
286
Host .update (self .apiclient , id = selected_host .id , allocationstate = "Enable" )
@@ -319,6 +306,7 @@ def test_01_add_primary_storage_disabled_host(self):
319
306
self .services ["account" ],
320
307
domainid = self .domain .id
321
308
)
309
+ self .cleanup .append (account )
322
310
323
311
service_offering = ServiceOffering .create (
324
312
self .apiclient ,
@@ -336,7 +324,6 @@ def test_01_add_primary_storage_disabled_host(self):
336
324
serviceofferingid = service_offering .id
337
325
)
338
326
self .cleanup .append (self .virtual_machine )
339
- self .cleanup .append (account )
340
327
finally :
341
328
# cancel maintenance
342
329
for pool in storage_pool_list :
@@ -351,14 +338,13 @@ def test_01_add_primary_storage_disabled_host(self):
351
338
continue
352
339
Host .update (self .apiclient , id = host .id , allocationstate = "Enable" )
353
340
354
- cleanup_resources (self .apiclient , self .cleanup )
355
- self .cleanup = []
356
341
StoragePool .enableMaintenance (self .apiclient , storage_pool_2 .id )
357
342
time .sleep (30 );
358
343
cmd = deleteStoragePool .deleteStoragePoolCmd ()
359
344
cmd .id = storage_pool_2 .id
360
345
cmd .forced = True
361
346
self .apiclient .deleteStoragePool (cmd )
347
+ self .cleanup .remove (storage_pool_2 )
362
348
363
349
return
364
350
0 commit comments