Github user shwetaag commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/241#discussion_r30032273
  
    --- Diff: test/integration/component/test_project_template.py ---
    @@ -0,0 +1,162 @@
    +from marvin.codes import FAILED, PASS
    +from marvin.cloudstackTestCase import cloudstackTestCase
    +from marvin.lib.base import Account, VirtualMachine, 
ServiceOffering,Project,Network,NetworkOffering,Domain,Volume,Template
    +from marvin.lib.common import get_zone, get_domain, get_template
    +from marvin.lib.utils import cleanup_resources
    +from nose.plugins.attrib import attr
    +
    +
    +
    +class TestProjectPrivateTemplate(cloudstackTestCase):
    +
    +    @classmethod
    +    def setUpClass(cls):
    +        testClient = super(TestDeployVM, cls).getClsTestClient()
    +        cls.apiclient = testClient.getApiClient()
    +        cls.services = testClient.getParsedTestDataConfig()
    +        cls.cleanup = []
    +
    +        # Get Zone, Domain and templates
    +        cls.domain = get_domain(cls.apiclient)
    +        cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
    +        cls.services['mode'] = cls.zone.networktype
    +
    +        template = get_template(
    +            cls.apiclient,
    +            cls.zone.id,
    +            cls.services["ostype"]
    +        )
    +        if template == FAILED:
    +            assert False, "get_template() failed to return template with 
description %s" % cls.services["ostype"]
    +
    +        # Set Zones and disk offerings
    +        cls.services["small"]["zoneid"] = cls.zone.id
    +        cls.services["small"]["template"] = template.id
    +
    +        cls.services["medium"]["zoneid"] = cls.zone.id
    +        cls.services["medium"]["template"] = template.id
    +        cls.services["iso1"]["zoneid"] = cls.zone.id
    +
    +        cls.service_offering = ServiceOffering.create(
    +            cls.apiclient,
    +            cls.services["service_offerings"]["tiny"]
    +        )
    +
    +        cls.new_domain = Domain.create(
    +                                   cls.apiclient,
    +                                   cls.services["domain"],
    +                                   )
    +        cls.account = Account.create(
    +                            cls.apiclient,
    +                            cls.services["account"],
    +                            admin=True,
    +                            domainid=cls.new_domain.id
    +                            )
    +
    +        cls.debug(cls.account.id)
    +        #Fetch an api client with the user account created
    +
    +
    +    def test_project_private_template(self):
    +        self.api_client = 
self.testClient.getUserApiClient(UserName=self.account.name, 
DomainName=self.account.domain)
    +
    +        #Create a new project using the account created
    +        self.project = 
Project.create(self.api_client,self.services["project"],account=self.account.name,domainid=self.new_domain.id)
    +        self.debug("The project has been created")
    +
    +        self.network_offering = NetworkOffering.create(
    +            self.apiclient,
    +            self.services["network_offering"],
    +        )
    +        # Enable Network offering
    +        self.network_offering.update(self.apiclient, state='Enabled')
    +
    +        self.services["network"]["networkoffering"] = 
self.network_offering.id
    +
    +
    +
    +        #cls.api_client = 
testClient.getUserApiClient(UserName=cls.account.name, 
DomainName=cls.account.domain)
    +
    +        self.project_network = Network.create(
    --- End diff --
    
    no need to create this network explicitly .This can be created as a part of 
deploy virtual machine
     


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to