You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by sanju1010 <gi...@git.apache.org> on 2015/07/08 08:28:50 UTC

[GitHub] cloudstack pull request: Automation for issue, Private template no...

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

    https://github.com/apache/cloudstack/pull/241#discussion_r34118957
  
    --- Diff: test/integration/component/test_project_template.py ---
    @@ -0,0 +1,155 @@
    +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
    +
    +    @classmethod
    +    def tearDownClass(cls):
    +        try:
    +            cleanup_resources(cls.apiclient, cls.cleanup)
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +    def test_project_private_template(self):
    --- End diff --
    
    Please add tags attribute to the test


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