Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D143517CC7 for ; Wed, 15 Apr 2015 06:18:37 +0000 (UTC) Received: (qmail 30144 invoked by uid 500); 15 Apr 2015 06:18:37 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 30093 invoked by uid 500); 15 Apr 2015 06:18:37 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 30082 invoked by uid 99); 15 Apr 2015 06:18:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2015 06:18:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EA457E00B4; Wed, 15 Apr 2015 06:18:36 +0000 (UTC) From: gauravaradhye To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: Issue:Domian admin can view templates in ... Content-Type: text/plain Message-Id: <20150415061836.EA457E00B4@git1-us-west.apache.org> Date: Wed, 15 Apr 2015 06:18:36 +0000 (UTC) Github user gauravaradhye commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/169#discussion_r28395840 --- Diff: test/integration/component/test_escalation_listTemplatesDomainAdmin1.py --- @@ -0,0 +1,94 @@ + +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.lib.base import (Account, + Domain, Template + ) +from marvin.lib.utils import * +from marvin.lib.common import (get_zone) + + +class Domain12(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + + testClient = super(Domain12, cls).getClsTestClient() + cls.apiclient = testClient.getApiClient() + cls.testdata = testClient.getParsedTestDataConfig() + cls.testdata["templateregister"]["ostype"] = "Windows 7 (64-bit)" + cls.testdata["templateregister"]["url"] = "http://10.147.28.7/templates/windows7.vhd" + cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests()) + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.cleanup = [] + +# Create 2 domain admin accounts + + cls.domain1 = Domain.create( + cls.apiclient, + cls.testdata["domain"]) + + cls.domain2 = Domain.create( + cls.apiclient, + cls.testdata["domain"]) + + cls.account1 = Account.create( + cls.apiclient, + cls.testdata["account"], + admin=True, + domainid=cls.domain1.id) + + cls.account2 = Account.create( + cls.apiclient, + cls.testdata["account2"], + admin=True, + domainid=cls.domain2.id) + +# Register template under one domain admin(root/domain1->account 1) + + cls.templateregister = Template.register( + cls.apiclient, + cls.testdata["templateregister"], + zoneid=cls.zone.id, + hypervisor=cls.hypervisor, + account=cls.account1.name, + domainid=cls.domain1.id) + + cls.debug("Created account %s in domain %s" % + (cls.account1.name, cls.domain1.id)) + cls.debug("Created account %s in domain %s" % + (cls.account2.name, cls.domain2.id)) + + cls.cleanup.append(cls.account1) + cls.cleanup.append(cls.domain1) + cls.cleanup.append(cls.account2) + cls.cleanup.append(cls.domain2) + + @classmethod + def tearDownClass(cls): + try: + # Cleanup resources used + cleanup_resources(cls.apiclient, cls.cleanup) + + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + +# test that the template register under root/domain1->account1 is not +# listed under root/domain2->account2 + + def test_listtemplate(self): + listtemplate = Template.list( --- End diff -- Please move the steps from setUpClass which are part of test case itself. Use setUpClass to create data which is used across all test cases. You can move the steps to test case itself. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---