marvin: Fix intermittent failure observed in test_02_list_snapshots_with_removed_data_store (#5483)

* marvin: Fix intermittent failure observed in test_02_list_snapshots_with_removed_data_store

* refactor test
This commit is contained in:
Pearl Dsilva 2021-09-23 00:37:25 +05:30 committed by GitHub
parent 50a0e80de6
commit 6ba656b664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -245,23 +245,30 @@ class TestSnapshotRootDisk(cloudstackTestCase):
PASS,
"Invalid response returned for list volumes")
vol_uuid = vol_res[0].id
# Create new Primary Storage
clusters = list_clusters(
self.apiclient,
zoneid=self.zone.id
)
assert isinstance(clusters,list) and len(clusters)>0
self.cleanup.append(self.virtual_machine_with_disk)
# Attach created volume to vm, then detach it to be able to migrate it
self.virtual_machine_with_disk.stop(self.apiclient)
self.virtual_machine_with_disk.attach_volume(
self.apiclient,
vol
)
# Create new Primary Storage
storage = StoragePool.create(self.apiclient,
self.services["nfs2"],
clusterid=clusters[0].id,
zoneid=self.zone.id,
podid=self.pod.id
)
self.cleanup.append(self.virtual_machine_with_disk)
self.cleanup.append(storage)
self.cleanup.append(storage)
self.assertEqual(
storage.state,
'Up',
@ -296,12 +303,6 @@ class TestSnapshotRootDisk(cloudstackTestCase):
"Check storage pool type "
)
# Attach created volume to vm, then detach it to be able to migrate it
self.virtual_machine_with_disk.stop(self.apiclient)
self.virtual_machine_with_disk.attach_volume(
self.apiclient,
vol
)
self.virtual_machine_with_disk.detach_volume(
self.apiclient,
vol