@@ -110,8 +110,6 @@ def setUpClass(cls):
110110 domainid = cls .domain .id )
111111 cls ._cleanup .append (cls .account )
112112
113- cls .helper = StorPoolHelper ()
114-
115113 compute_offering_service = cls .services ["service_offerings" ]["tiny" ].copy ()
116114 td = TestData ()
117115 cls .testdata = td .testdata
@@ -164,9 +162,9 @@ def test_01_take_snapshot_multi_zone(self):
164162 """
165163
166164 snapshot = Snapshot .create (self .userapiclient , volume_id = self .volume .id , zoneids = [str (self .additional_zone .id )], usestoragereplication = True )
165+ self ._cleanup .append (snapshot )
167166 self .snapshot_id = snapshot .id
168167 self .helper .verify_snapshot_copies (self .userapiclient , self .snapshot_id , [self .zone .id , self .additional_zone .id ])
169- self ._cleanup .append (snapshot )
170168 return
171169
172170 @skipTestIf ("testsNotSupported" )
@@ -176,11 +174,11 @@ def test_02_copy_snapshot_multi_pools(self):
176174 """
177175
178176 snapshot = Snapshot .create (self .userapiclient , volume_id = self .volume .id )
177+ self ._cleanup .append (snapshot )
179178 self .snapshot_id = snapshot .id
180179 Snapshot .copy (self .userapiclient , self .snapshot_id , zone_ids = [str (self .additional_zone .id )], source_zone_id = self .zone .id , usestoragereplication = True )
181180 self .helper .verify_snapshot_copies (self .userapiclient , self .snapshot_id , [self .zone .id , self .additional_zone .id ])
182181
183- self ._cleanup .append (snapshot )
184182 return
185183
186184 @skipTestIf ("testsNotSupported" )
@@ -222,6 +220,7 @@ def test_05_take_snapshot_multi_zone_create_volume_additional_zone(self):
222220 """
223221
224222 snapshot = Snapshot .create (self .userapiclient ,volume_id = self .volume .id , zoneids = [str (self .additional_zone .id )], usestoragereplication = True )
223+ self ._cleanup .append (snapshot )
225224 self .snapshot_id = snapshot .id
226225 self .helper .verify_snapshot_copies (self .userapiclient , self .snapshot_id , [self .zone .id , self .additional_zone .id ])
227226 disk_offering_id = None
@@ -236,8 +235,7 @@ def test_05_take_snapshot_multi_zone_create_volume_additional_zone(self):
236235 disk_offering_id = self .disk_offering .id
237236
238237 self .volume = Volume .create (self .userapiclient , {"diskname" :"StorPoolDisk-1" }, snapshotid = self .snapshot_id , zoneid = self .zone .id , diskofferingid = disk_offering_id )
239- self ._cleanup .append (self .volume )
240- self ._cleanup .append (snapshot )
238+ self .cleanup .append (self .volume )
241239 if self .zone .id != self .volume .zoneid :
242240 self .fail ("Volume from snapshot not created in the additional zone" )
243241 return
@@ -248,13 +246,13 @@ def test_06_take_snapshot_multi_zone_create_template_additional_zone(self):
248246 """Test to take volume snapshot in multiple StorPool primary storages in diff zones and create a volume in one of the additional zones
249247 """
250248 snapshot = Snapshot .create (self .userapiclient , volume_id = self .volume .id , zoneids = [str (self .additional_zone .id )], usestoragereplication = True )
249+ self ._cleanup .append (snapshot )
251250 self .snapshot_id = snapshot .id
252251 self .helper .verify_snapshot_copies (self .userapiclient , self .snapshot_id , [self .zone .id , self .additional_zone .id ])
253252 self .template = self .helper .create_snapshot_template (self .userapiclient , self .services , self .snapshot_id , self .additional_zone .id )
253+ self .cleanup .append (self .template )
254254 if self .additional_zone .id != self .template .zoneid :
255255 self .fail ("Template from snapshot not created in the additional zone" )
256- self ._cleanup .append (snapshot )
257- self ._cleanup .append (self .template )
258256 return
259257
260258 @skipTestIf ("testsNotSupported" )
@@ -280,7 +278,7 @@ def test_08_take_snapshot_multi_zone_create_volume_additional_zone_deploy_vm(sel
280278 and deploy a VM from the volume in one of the additional zones
281279 """
282280 snapshot = Snapshot .create (self .userapiclient , volume_id = self .volume .id , zoneids = [str (self .additional_zone .id )], usestoragereplication = True )
283- self ._cleanup .append (snapshot )
281+ self .cleanup .append (snapshot )
284282 self .snapshot_id = snapshot .id
285283 self .helper .verify_snapshot_copies (self .userapiclient , self .snapshot_id , [self .zone .id , self .additional_zone .id ])
286284 vm = self .create_volume_from_snapshot_deploy_vm (snapshotid = self .snapshot_id , zoneid = self .additional_zone .id )
0 commit comments