• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python common.get_domain函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中marvin.integration.lib.common.get_domain函数的典型用法代码示例。如果您正苦于以下问题:Python get_domain函数的具体用法?Python get_domain怎么用?Python get_domain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_domain函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUp

    def setUp(self):
        self.testdata = TestData().testdata
        self.apiclient = self.testClient.getApiClient()

        # Get Zone, Domain and Default Built-in template
        self.domain = get_domain(self.apiclient, self.testdata)
        self.zone = get_zone(self.apiclient, self.testdata)
        self.testdata["mode"] = self.zone.networktype
        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])

        #create a user account
        self.account = Account.create(
            self.apiclient,
            self.testdata["account"],
            domainid=self.domain.id
        )
        #create a service offering
        self.service_offering = ServiceOffering.create(
            self.apiclient,
            self.testdata["service_offering"]["small"]
        )
        #build cleanup list
        self.cleanup = [
            self.service_offering,
            self.account
        ]
开发者ID:dbac,项目名称:cloudstack,代码行数:26,代码来源:test_deploy_vm.py


示例2: setUp

    def setUp(self):
        self.pp = pprint.PrettyPrinter(indent=4, depth=6)

        self.apiclient = super(TestScenario, self).getClsTestClient().getApiClient()
        self.services = Services().services
        # Get Zone, Domain and templates
        self.domain = get_domain(self.apiclient, self.services)
        self.zone = get_zone(self.apiclient, self.services)
        self.pod = get_pod(self.apiclient, self.zone.id)
        self.template = get_template(
            self.apiclient,
            self.zone.id,
            self.services["ostype"]
        )

        self.accounts = []
        for account in self.services["scenario"]["accounts"]:
            self.accounts.append(self.CreateAccount(account))

        self.service_offerings = []
        for service_offering in self.services["scenario"]["service_offerings"]:
            self.service_offerings.append(self.CreateServiceOffering(service_offering))

        self.cleanup = [
        #    self.account
        ]

        self.file_to_write = open('/home/sg-user/cloudstack-sim-gen/test_scenario.out', 'w')
        self.file_to_write.truncate()

        self.datapoints = []
开发者ID:chipchilders,项目名称:cloudstack-sim-gen,代码行数:31,代码来源:test_scenario.py


示例3: setUpClass

 def setUpClass(cls):
     cls._cleanup = []
     cls.api_client = super(TestEgressFWRules,
                            cls).getClsTestClient().getApiClient()
     cls.services  = Services().services
     # Get Zone  Domain and create Domains and sub Domains.
     cls.domain           = get_domain(cls.api_client, cls.services)
     cls.zone             = get_zone(cls.api_client, cls.services)
     cls.services['mode'] = cls.zone.networktype
     # Get and set template id for VM creation.
     cls.template = get_template(cls.api_client,
                                 cls.zone.id,
                                 cls.services["ostype"])
     cls.services["virtual_machine"]["zoneid"] = cls.zone.id
     cls.services["virtual_machine"]["template"] = cls.template.id
     parentDomain = None
     cls.domain  =  Domain.create(cls.api_client,
                                  cls.services["domain"],
                                  parentdomainid=parentDomain.id if parentDomain else None)
     cls._cleanup.append(cls.domain)
     # Create an Account associated with domain
     cls.account = Account.create(cls.api_client,
                                  cls.services["account"],
                                  domainid=cls.domain.id)
     cls._cleanup.append(cls.account)
     # Create service offerings.
     cls.service_offering = ServiceOffering.create(cls.api_client,
                                                   cls.services["service_offering"])
     # Cleanup
     cls._cleanup.append(cls.service_offering)
开发者ID:Bhathiya90,项目名称:cloudstack,代码行数:30,代码来源:test_egress_fw_rules.py


示例4: setUpClass

    def setUpClass(cls):
        cls.api_client = super(TestSnapshotOnRootVolume,
                               cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.template = get_template(
                                    cls.api_client,
                                    cls.zone.id,
                                    cls.services["ostype"])
        cls.account = Account.create(cls.api_client,
                                     cls.services["account"],
                                     domainid=cls.domain.id)
        # pdb.set_trace()
        cls.service_offering = ServiceOffering.create(
                                            cls.api_client,
                                            cls.services["service_offering"])
        cls.disk_offering = DiskOffering.create(
                                    cls.api_client,
                                    cls.services["disk_offering"],
                                    domainid=cls.domain.id)
        cls.service_offering2 = ServiceOffering.create(
                                            cls.api_client,
                                            cls.services["service_offering2"])
        cls.disk_offering2 = DiskOffering.create(
                                    cls.api_client,
                                    cls.services["disk_offering2"],
                                    domainid=cls.domain.id)

        cls._cleanup = [cls.account,
                        cls.service_offering,
                        cls.disk_offering,
                        cls.service_offering2,
                        cls.disk_offering2]
开发者ID:Bhathiya90,项目名称:cloudstack,代码行数:34,代码来源:test_snapshots_improvement.py


示例5: setUp

    def setUp(self):
        self.testdata = TestData().testdata
        self.apiclient = self.testClient.getApiClient()

        # Get Zone, Domain and Default Built-in template
        self.domain = get_domain(self.apiclient, self.testdata)
        self.zone = get_zone(self.apiclient, self.testdata)
        self.testdata["mode"] = self.zone.networktype
        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])
#       for testing with specific template
#        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"], templatetype='USER', services = {"template":'31f52a4d-5681-43f7-8651-ad4aaf823618'})
        

        #create a user account
        self.account = Account.create(
            self.apiclient,
            self.testdata["account"],
            domainid=self.domain.id
        )
        #create a service offering
        self.service_offering = ServiceOffering.create(
            self.apiclient,
            self.testdata["service_offering"]["small"]
        )
        #build cleanup list
        self.cleanup = [
            self.service_offering,
            self.account
        ]
开发者ID:baishuo,项目名称:cloudstack,代码行数:29,代码来源:test_deploy_vm_root_resize.py


示例6: setUpClass

    def setUpClass(cls):
        cls.api_client = super(TestMemoryLimits,
                               cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)

        cls.services["mode"] = cls.zone.networktype

        cls.template = get_template(
                            cls.api_client,
                            cls.zone.id,
                            cls.services["ostype"]
                            )

        cls.services["virtual_machine"]["zoneid"] = cls.zone.id

        cls.service_offering = ServiceOffering.create(
                                            cls.api_client,
                                            cls.services["service_offering"]
                                            )

        cls._cleanup = [cls.service_offering, ]
        return
开发者ID:dbac,项目名称:cloudstack,代码行数:25,代码来源:test_memory_limits.py


示例7: setUpClass

    def setUpClass(cls):
        # We want to fail quicker if it's failure
        socket.setdefaulttimeout(60)

        cls.api_client = super(
                                        TestVPCNetworkPFRules,
                                        cls
                                        ).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.template = get_template(
                                    cls.api_client,
                                    cls.zone.id,
                                    cls.services["ostype"]
                                    )
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id

        cls.service_offering = ServiceOffering.create(
                                                        cls.api_client,
                                                        cls.services["service_offering"]
                                                        )
        cls._cleanup = [cls.service_offering]
        return
开发者ID:baishuo,项目名称:cloudstack,代码行数:26,代码来源:test_vpc_network_pfrules.py


示例8: setUpClass

    def setUpClass(cls):
        cls.apiclient = super(TestDeployVmWithVariedPlanners, cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.apiclient, cls.services)
        cls.zone = get_zone(cls.apiclient, cls.services)
        cls.template = get_template(
            cls.apiclient,
            cls.zone.id,
            cls.services["ostype"]
        )
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["template"] = cls.template.id
        cls.services["zoneid"] = cls.zone.id

        cls.account = Account.create(
            cls.apiclient,
            cls.services["account"],
            domainid=cls.domain.id
        )
        cls.services["account"] = cls.account.name
        cls.hosts = Host.list(cls.apiclient, type='Routing')
        cls.clusters = Cluster.list(cls.apiclient)
        cls.cleanup = [
            cls.account
        ]
开发者ID:baishuo,项目名称:cloudstack,代码行数:26,代码来源:test_deploy_vms_with_varied_deploymentplanners.py


示例9: setUpClass

    def setUpClass(cls):
        cls.api_client = super(TestNonContiguousVLANRanges, cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, pod, domain
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.pod = get_pod(cls.api_client, cls.zone.id, cls.services)
        cls.domain = get_domain(cls.api_client, cls.services)

        cls.service_offering = ServiceOffering.create(
                                    cls.api_client,
                                    cls.services["service_offering"]
                                    )

        cls.template = get_template(
                            cls.api_client,
                            cls.zone.id,
                            cls.services["ostype"]
                            )

        cls.services["virtual_machine"]["template"] = cls.template.id
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id

        cls._cleanup = [cls.service_offering]

        return
开发者ID:Bhathiya90,项目名称:cloudstack,代码行数:25,代码来源:test_non_contiguous_vlan.py


示例10: setUp

    def setUp(self):
        self.services = Services().services
        self.apiclient = self.testClient.getApiClient()

        # Get Zone, Domain and Default Built-in template
        self.domain = get_domain(self.apiclient, self.services)
        self.zone = get_zone(self.apiclient, self.services)
        self.services["mode"] = self.zone.networktype
        # Before running this test, register a windows template with ostype as 'Windows 7 (32-bit)'
        self.template = get_template(self.apiclient, self.zone.id, self.services["ostype"], templatetype='USER')

        #create a user account
        self.account = Account.create(
            self.apiclient,
            self.services["account"],
            domainid=self.domain.id
        )

        self.services["vgpu260q"]["zoneid"] = self.zone.id
        self.services["vgpu260q"]["template"] = self.template.id

        self.services["vgpu140q"]["zoneid"] = self.zone.id
        self.services["vgpu140q"]["template"] = self.template.id
        #create a service offering
        self.service_offering = ServiceOffering.create(
                self.apiclient,
                self.services["service_offerings"]["vgpu260qwin"],
                serviceofferingdetails={'pciDevice': 'VGPU'}
        )
        #build cleanup list
        self.cleanup = [
            self.service_offering,
            self.account
        ]
开发者ID:dbac,项目名称:cloudstack,代码行数:34,代码来源:test_deploy_vgpu_enabled_vm.py


示例11: setUpClass

    def setUpClass(cls):
        cls.api_client = super(TestServiceOfferings, cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.services['mode'] = cls.zone.networktype

        cls.service_offering_1 = ServiceOffering.create(
            cls.api_client,
            cls.services["off"]
        )
        cls.service_offering_2 = ServiceOffering.create(
            cls.api_client,
            cls.services["off"]
        )
        template = get_template(
                            cls.api_client,
                            cls.zone.id,
                            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

        # Create VMs, NAT Rules etc
        cls.account = Account.create(
                            cls.api_client,
                            cls.services["account"],
                            domainid=domain.id
                            )

        cls.small_offering = ServiceOffering.create(
                                    cls.api_client,
                                    cls.services["service_offerings"]["small"]
                                    )

        cls.medium_offering = ServiceOffering.create(
                                    cls.api_client,
                                    cls.services["service_offerings"]["medium"]
                                    )
        cls.medium_virtual_machine = VirtualMachine.create(
                                       cls.api_client,
                                       cls.services["medium"],
                                       accountid=cls.account.name,
                                       domainid=cls.account.domainid,
                                       serviceofferingid=cls.medium_offering.id,
                                       mode=cls.services["mode"]
                                    )
        cls._cleanup = [
                        cls.small_offering,
                        cls.medium_offering,
                        cls.account
                        ]
        return
开发者ID:Bhathiya90,项目名称:cloudstack,代码行数:57,代码来源:test_service_offerings.py


示例12: setUpClass

    def setUpClass(cls):
        cls.services = Services().services
        cls.apiclient = super(TestDeployVM, cls).getClsTestClient().getApiClient()
        # Get Zone, Domain and templates
        domain = get_domain(cls.apiclient, cls.services)
        cls.zone = get_zone(cls.apiclient, cls.services)
        cls.services['mode'] = cls.zone.networktype

        #If local storage is enabled, alter the offerings to use localstorage
        #this step is needed for devcloud
        if cls.zone.localstorageenabled == True:
            cls.services["service_offerings"]["tiny"]["storagetype"] = 'local'
            cls.services["service_offerings"]["small"]["storagetype"] = 'local'
            cls.services["service_offerings"]["medium"]["storagetype"] = 'local'

        template = get_template(
            cls.apiclient,
            cls.zone.id,
            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["iso"]["zoneid"] = cls.zone.id

        cls.account = Account.create(
            cls.apiclient,
            cls.services["account"],
            domainid=domain.id
        )
        cls.debug(cls.account.id)

        cls.service_offering = ServiceOffering.create(
            cls.apiclient,
            cls.services["service_offerings"]["tiny"]
        )

        cls.virtual_machine = VirtualMachine.create(
            cls.apiclient,
            cls.services["small"],
            accountid=cls.account.name,
            domainid=cls.account.domainid,
            serviceofferingid=cls.service_offering.id,
            mode=cls.services['mode']
        )

        cls.cleanup = [
            cls.service_offering,
            cls.account
        ]
开发者ID:baishuo,项目名称:cloudstack,代码行数:53,代码来源:test_vm_life_cycle.py


示例13: setUpClass

    def setUpClass(cls):
        cls.api_client = super(TestMultipleChildDomainsMemory, cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.services["mode"] = cls.zone.networktype

        cls.template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])

        cls.services["virtual_machine"]["zoneid"] = cls.zone.id

        cls._cleanup = []
        return
开发者ID:Bhathiya90,项目名称:cloudstack,代码行数:14,代码来源:test_mm_domain_limits.py


示例14: setUpClass

    def setUpClass(cls):

        cls.api_client = super(TestVMPlacement, cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.pod = get_pod(cls.api_client, zoneid=cls.zone.id, services=cls.services)
        cls.template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id

        cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"], offerha=True)
        cls._cleanup = [cls.service_offering]
        return
开发者ID:j0rg1,项目名称:cloudstack,代码行数:15,代码来源:test_vmware_drs.py


示例15: setUpClass

    def setUpClass(cls):
        cls.api_client = super(TestBaseImageUpdate, cls).getClsTestClient().getApiClient()
        cls.services = Services().services
        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id

        cls.service_offering_with_reset = ServiceOffering.create(
            cls.api_client, cls.services["service_offering_with_reset"]
        )

        cls.service_offering_without_reset = ServiceOffering.create(
            cls.api_client, cls.services["service_offering_without_reset"]
        )

        cls.account = Account.create(cls.api_client, cls.services["account"], admin=True, domainid=cls.domain.id)

        cls.vm_with_reset = VirtualMachine.create(
            cls.api_client,
            cls.services["virtual_machine"],
            accountid=cls.account.name,
            domainid=cls.account.domainid,
            serviceofferingid=cls.service_offering_with_reset.id,
        )
        cls.vm_with_reset_root_disk_id = cls.get_root_device_uuid_for_vm(
            cls.vm_with_reset.id, cls.vm_with_reset.rootdeviceid
        )

        cls.vm_without_reset = VirtualMachine.create(
            cls.api_client,
            cls.services["virtual_machine"],
            accountid=cls.account.name,
            domainid=cls.account.domainid,
            serviceofferingid=cls.service_offering_without_reset.id,
        )
        cls.vm_without_reset_root_disk_id = cls.get_root_device_uuid_for_vm(
            cls.vm_without_reset.id, cls.vm_without_reset.rootdeviceid
        )

        cls._cleanup = [cls.account, cls.service_offering_with_reset, cls.service_offering_without_reset]
        return
开发者ID:Bhathiya90,项目名称:cloudstack,代码行数:44,代码来源:test_base_image_updation.py


示例16: setUpClass

    def setUpClass(cls):
        cloudstackTestClient = super(TestDynamicServiceOffering,cls).getClsTestClient()
        cls.api_client = cloudstackTestClient.getApiClient()

        # Fill services from the external config file
        cls.services = cloudstackTestClient.getConfigParser().parsedDict

        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.mode = str(cls.zone.networktype).lower()
        cls.template = get_template(
                            cls.api_client,
                            cls.zone.id,
                            cls.services["ostype"]
                            )
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id
        cls._cleanup = []
        return
开发者ID:dbac,项目名称:cloudstack,代码行数:20,代码来源:test_dynamic_compute_offering.py


示例17: setUpClass

    def setUpClass(cls):
        cloudstackTestClient = super(TestBasicOperations,cls).getClsTestClient()
        cls.api_client = cloudstackTestClient.getApiClient()

        # Fill services from the external config file
        cls.services = cloudstackTestClient.getConfigParser().parsedDict

        # Get Zone, Domain and templates
        cls.domain = get_domain(cls.api_client, cls.services)
        cls.zone = get_zone(cls.api_client, cls.services)
        cls.mode = str(cls.zone.networktype).lower()
        cls.template = get_template(
                            cls.api_client,
                            cls.zone.id,
                            cls.services["ostype"]
                            )
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id
        cls.service_offering = ServiceOffering.create(
                                            cls.api_client,
                                            cls.services["service_offering"]
                                            )
        cls._cleanup = [cls.service_offering]
        cls.services["shared_network_offering"]["specifyVlan"] = "True"
        cls.services["shared_network_offering"]["specifyIpRanges"] = "True"

        cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client,
                                                                      cls.services["shared_network_offering"])
        cls._cleanup.append(cls.shared_network_offering)

        if cls.mode == "advanced":
            cls.isolated_network_offering = CreateEnabledNetworkOffering(cls.api_client,
                                                                      cls.services["isolated_network_offering"])
            cls._cleanup.append(cls.isolated_network_offering)
            cls.isolated_network_offering_vpc = CreateEnabledNetworkOffering(cls.api_client,
                                                    cls.services["nw_offering_isolated_vpc"])
            cls._cleanup.append(cls.isolated_network_offering_vpc)
            cls.vpc_off = VpcOffering.create(cls.api_client, cls.services["vpc_offering"])
            cls.vpc_off.update(cls.api_client, state='Enabled')
            cls._cleanup.append(cls.vpc_off)
        return
开发者ID:Blufe,项目名称:cloudstack,代码行数:41,代码来源:test_multiple_ips_per_nic.py


示例18: setUpClass

    def setUpClass(cls):
        cls._cleanup = []
        cls.api_client = super(TestVMOwnership,
                               cls).getClsTestClient().getApiClient()
        cls.services  = Services().services
        # Get Zone  Domain and create Domains and sub Domains.
        cls.domain           = get_domain(cls.api_client, cls.services)
        cls.zone             = get_zone(cls.api_client, cls.services)
        cls.services['mode'] = cls.zone.networktype
        # Get and set template id for VM creation.
        cls.template = get_template(cls.api_client,
                                    cls.zone.id,
                                    cls.services["ostype"])
        cls.services["virtual_machine"]["zoneid"] = cls.zone.id
        cls.services["virtual_machine"]["template"] = cls.template.id

        def create_domain_account_user(parentDomain=None):
            domain  =  Domain.create(cls.api_client,
                                     cls.services["domain"],
                                     parentdomainid=parentDomain.id if parentDomain else None)
            cls._cleanup.append(domain)
            # Create an Account associated with domain
            account = Account.create(cls.api_client,
                                     cls.services["account"],
                                     domainid=domain.id)
            cls._cleanup.append(account)
            # Create an User, Project, Volume associated with account
            user    = User.create(cls.api_client,
                                  cls.services["user"],
                                  account=account.name,
                                  domainid=account.domainid)
            cls._cleanup.append(user)
            project = Project.create(cls.api_client,
                                     cls.services["project"],
                                     account=account.name,
                                     domainid=account.domainid)
            cls._cleanup.append(project)
            volume  = Volume.create(cls.api_client,
                                    cls.services["volume"],
                                    zoneid=cls.zone.id,
                                    account=account.name,
                                    domainid=account.domainid,
                                    diskofferingid=cls.disk_offering.id)
            cls._cleanup.append(volume)
            return {'domain':domain, 'account':account, 'user':user, 'project':project, 'volume':volume}

        # Create disk offerings.
        try:
            cls.disk_offering = DiskOffering.create(cls.api_client,
                                                    cls.services["disk_offering"])
            # Create service offerings.
            cls.service_offering = ServiceOffering.create(cls.api_client,
                                                          cls.services["service_offering"])
            # Cleanup
            cls._cleanup = [cls.service_offering]
            # Create domain, account, user, project and volumes.
            cls.domain_account_user1   = create_domain_account_user()
            cls.domain_account_user2   = create_domain_account_user()
            cls.sdomain_account_user1  = create_domain_account_user(cls.domain_account_user1['domain'])
            cls.sdomain_account_user2  = create_domain_account_user(cls.domain_account_user2['domain'])
            cls.ssdomain_account_user2 = create_domain_account_user(cls.sdomain_account_user2['domain'])
        except Exception as e:
          raise e
        return
开发者ID:JincheolKim,项目名称:cloudstack,代码行数:64,代码来源:test_assign_vm.py


示例19: setUp

    def setUp(self):
        self.testdata = TestData().testdata
        self.apiclient = self.testClient.getApiClient()

        # Get Zone, Domain and Default Built-in template
        self.domain = get_domain(self.apiclient, self.testdata)
        self.zone = get_zone(self.apiclient, self.testdata)
        self.testdata["mode"] = self.zone.networktype
        self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"])

        #create a user account
        self.account = Account.create(
            self.apiclient,
            self.testdata["account"],
            domainid=self.domain.id
        )
        #create a service offering
        self.service_offering = ServiceOffering.create(
            self.apiclient,
            self.testdata["service_offering"]["small"]
        )
        #build cleanup list
        self.cleanup = [
            self.service_offering,
            self.account
        ]

        # Validate the following:
        # 1. Virtual Machine is accessible via SSH
        # 2. listVirtualMachines returns accurate information

        self.virtual_machine = VirtualMachine.create(
            self.apiclient,
            self.testdata["virtual_machine"],
            accountid=self.account.name,
            zoneid=self.zone.id,
            domainid=self.account.domainid,
            serviceofferingid=self.service_offering.id,
            templateid=self.template.id
        )

        list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id)

        self.debug(
            "Verify listVirtualMachines response for virtual machine: %s"\
            % self.virtual_machine.id
        )

        self.assertEqual(
            isinstance(list_vms, list),
            True,
            "List VM response was not a valid list"
        )
        self.assertNotEqual(
            len(list_vms),
            0,
            "List VM response was empty"
        )

        vm = list_vms[0]
        self.assertEqual(
            vm.id,
            self.virtual_machine.id,
            "Virtual Machine ids do not match"
        )
        self.assertEqual(
            vm.name,
            self.virtual_machine.name,
            "Virtual Machine names do not match"
        )
        self.assertEqual(
            vm.state,
            "Running",
            msg="VM is not in Running state"
        )
开发者ID:Aparna31,项目名称:cloudstack,代码行数:75,代码来源:test_multipleips_per_nic.py



注:本文中的marvin.integration.lib.common.get_domain函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python common.get_template函数代码示例发布时间:2022-05-27
下一篇:
Python common.cleanup_resources函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap