cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pavanb018 <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Automation for issue, Private template no...
Date Mon, 11 May 2015 12:14:26 GMT
Github user pavanb018 commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/241#discussion_r30032670
  
    --- 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 --
    
    We need to create a network within the project specifying the project id. Else the network
will not be associated with the project.


---
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.
---

Mime
View raw message