From 724c8dc7c98574dcdf669c0c2d7549981667ab77 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Thu, 24 Jul 2014 15:21:28 +0530 Subject: [PATCH] CLOUDSTACK-7125: Fixed test_blocker_bugs.py, added code to wait for snapshots to be in 'BackedU' state (cherry picked from commit 4395308bd8b469fb02fc71d1e22f25c7d89b6dff) --- .../component/test_blocker_bugs.py | 45 +++---------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 98bed9235a7..282803275db 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -841,26 +841,9 @@ class TestTemplates(cloudstackTestCase): account=self.account.name, domainid=self.account.domainid ) - self.debug("Created snapshot with ID: %s" % snapshot.id) - snapshots = Snapshot.list( - self.apiclient, - id=snapshot.id - ) - self.assertEqual( - isinstance(snapshots, list), - True, - "Check list response returns a valid list" - ) - self.assertNotEqual( - snapshots, - None, - "Check if result exists in list snapshots call" - ) - self.assertEqual( - snapshots[0].id, - snapshot.id, - "Check snapshot id in list resources call" - ) + + response = snapshot.validateState(self.apiclient, Snapshot.BACKED_UP) + self.assertEqual(response[0], PASS, response[1]) # Generate template from the snapshot template = Template.create_from_snapshot( @@ -923,26 +906,8 @@ class TestTemplates(cloudstackTestCase): account=self.account.name, domainid=self.account.domainid ) - self.debug("Created snapshot with ID: %s" % snapshot.id) - snapshots = Snapshot.list( - self.apiclient, - id=snapshot.id - ) - self.assertEqual( - isinstance(snapshots, list), - True, - "Check list response returns a valid list" - ) - self.assertNotEqual( - snapshots, - None, - "Check if result exists in list snapshots call" - ) - self.assertEqual( - snapshots[0].id, - snapshot.id, - "Check snapshot id in list resources call" - ) + response = snapshot.validateState(self.apiclient, Snapshot.BACKED_UP) + self.assertEqual(response[0], PASS, response[1]) # Generate template from the snapshot template = Template.create_from_snapshot(