To Verify that list templates by domain admin is not listing the templates of 
other Domains.....Made changes as per comments

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/23f4c022
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/23f4c022
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/23f4c022

Branch: refs/heads/master
Commit: 23f4c022c20308d0cda923bfce9f1d27178fb209
Parents: 293b985
Author: manasaVeloori <manasa1...@gmail.com>
Authored: Fri Apr 24 14:01:10 2015 +0530
Committer: sanjeev <sanj...@apache.org>
Committed: Fri Apr 24 15:10:24 2015 +0530

----------------------------------------------------------------------
 .../test_escalation_listTemplateDomainAdmin.py  | 32 +++++---------------
 1 file changed, 7 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/23f4c022/test/integration/component/test_escalation_listTemplateDomainAdmin.py
----------------------------------------------------------------------
diff --git 
a/test/integration/component/test_escalation_listTemplateDomainAdmin.py 
b/test/integration/component/test_escalation_listTemplateDomainAdmin.py
index 6b43651..58e1c3b 100644
--- a/test/integration/component/test_escalation_listTemplateDomainAdmin.py
+++ b/test/integration/component/test_escalation_listTemplateDomainAdmin.py
@@ -20,9 +20,10 @@ from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.lib.base import (Account,
                              Domain, Template
                              )
-from marvin.lib.utils import (cleanup_resources)
+from marvin.lib.utils import (cleanup_resources, validateList)
 from marvin.lib.common import (get_zone, get_builtin_template_info)
 from nose.plugins.attrib import attr
+from marvin.codes import PASS
 import time
 
 
@@ -114,30 +115,11 @@ class TestlistTemplatesDomainAdmin(cloudstackTestCase):
                 account=self.account1.name,
                 domainid=self.domain1.id
             )
-            if isinstance(listTemplateResponse, list):
-                break
-            elif timeout == 0:
-                raise Exception("list template failed")
-
-            time.sleep(10)
-            timeout = timeout - 1
-
-            self.assertEqual(
-                isinstance(listTemplateResponse, list),
-                True,
-                "Check for list template response return valid data")
-
-            self.assertNotEqual(
-                len(listTemplateResponse),
-                0,
-                "Check template available in List Templates")
-
-            template_response = listTemplateResponse[0]
-            self.assertEqual(
-                template_response.isready,
-                True,
-                "Template state is not ready, it is %s" % 
template_response.isready
-            )
+            status = validateList(listTemplateResponse)
+            self.assertEquals(
+                PASS,
+                status[0],
+                "Template creation failed")
 
         listtemplate = Template.list(
             self.apiclient,

Reply via email to