本文整理汇总了Python中marvin.lib.base.Domain类的典型用法代码示例。如果您正苦于以下问题:Python Domain类的具体用法?Python Domain怎么用?Python Domain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Domain类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setupAccounts
def setupAccounts(self):
self.debug("Creating a domain under: %s" % self.domain.name)
self.child_domain_1 = Domain.create(self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.child_do_admin_1 = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.child_domain_1.id
)
# Cleanup the resources created at end of test
self.cleanup.append(self.child_do_admin_1)
self.cleanup.append(self.child_domain_1)
self.debug("Creating a domain under: %s" % self.domain.name)
self.child_domain_2 = Domain.create(self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.child_do_admin_2 = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.child_domain_2.id)
# Cleanup the resources created at end of test
self.cleanup.append(self.child_do_admin_2)
self.cleanup.append(self.child_domain_2)
return
开发者ID:MANIKANDANVEN,项目名称:cloudstack,代码行数:33,代码来源:test_memory_limits.py
示例2: setupAccounts
def setupAccounts(self):
self.debug("Creating a sub-domain under: %s" % self.domain.name)
self.child_domain = Domain.create(
self.apiclient, services=self.services["domain"], parentdomainid=self.domain.id
)
self.child_do_admin = Account.create(
self.apiclient, self.services["account"], admin=True, domainid=self.child_domain.id
)
# Cleanup the resources created at end of test
self.cleanup.append(self.child_do_admin)
self.cleanup.append(self.child_domain)
Resources.updateLimit(
self.apiclient,
resourcetype=8,
max=16,
account=self.child_do_admin.name,
domainid=self.child_do_admin.domainid,
)
self.domain = Domain.create(self.apiclient, services=self.services["domain"], parentdomainid=self.domain.id)
self.admin = Account.create(self.apiclient, self.services["account"], admin=True, domainid=self.domain.id)
# Cleanup the resources created at end of test
self.cleanup.append(self.admin)
self.cleanup.append(self.domain)
Resources.updateLimit(
self.apiclient, resourcetype=8, max=16, account=self.admin.name, domainid=self.admin.domainid
)
return
开发者ID:tianshangjun,项目名称:cloudstack,代码行数:34,代码来源:test_cpu_domain_limits.py
示例3: setUpClass
def setUpClass(cls):
testClient = super(TestlistTemplatesDomainAdmin, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.testdata = testClient.getParsedTestDataConfig()
cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
cls.hypervisor = cls.testClient.getHypervisorInfo()
builtin_info = get_builtin_template_info(cls.apiclient, cls.zone.id)
cls.testdata["privatetemplate"]["url"] = builtin_info[0]
cls.testdata["privatetemplate"]["hypervisor"] = builtin_info[1]
cls.testdata["privatetemplate"]["format"] = builtin_info[2]
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)
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.account2)
cls.cleanup.append(cls.domain1)
cls.cleanup.append(cls.domain2)
开发者ID:ikarin,项目名称:cloudstack,代码行数:30,代码来源:test_escalation_listTemplateDomainAdmin.py
示例4: setupAccounts
def setupAccounts(self):
self.debug("Creating a domain under: %s" % self.domain.name)
self.parent_domain = Domain.create(
self.apiclient, services=self.services["domain"], parentdomainid=self.domain.id
)
self.parentd_admin = Account.create(
self.apiclient, self.services["account"], admin=True, domainid=self.domain.id
)
self.debug("Updating the Memory resource count for domain: %s" % self.domain.name)
Resources.updateLimit(
self.apiclient,
resourcetype=9,
max=4096,
account=self.parentd_admin.name,
domainid=self.parentd_admin.domainid,
)
self.debug("Creating a sub-domain under: %s" % self.parent_domain.name)
self.cdomain_1 = Domain.create(
self.apiclient, services=self.services["domain"], parentdomainid=self.parent_domain.id
)
self.debug("Creating a sub-domain under: %s" % self.parent_domain.name)
self.cdomain_2 = Domain.create(
self.apiclient, services=self.services["domain"], parentdomainid=self.parent_domain.id
)
self.cadmin_1 = Account.create(self.apiclient, self.services["account"], admin=True, domainid=self.cdomain_1.id)
self.debug("Updating the Memory resource count for domain: %s" % self.cdomain_1.name)
Resources.updateLimit(self.apiclient, resourcetype=9, max=2048, domainid=self.cadmin_1.domainid)
self.debug("Updating the Memory resource count for account: %s" % self.cadmin_1.name)
Resources.updateLimit(
self.apiclient, resourcetype=9, max=2048, account=self.cadmin_1.name, domainid=self.cadmin_1.domainid
)
self.cadmin_2 = Account.create(self.apiclient, self.services["account"], admin=True, domainid=self.cdomain_2.id)
self.debug("Updating the Memory resource count for domain: %s" % self.cdomain_2.name)
Resources.updateLimit(self.apiclient, resourcetype=9, max=2048, domainid=self.cadmin_2.domainid)
self.debug("Updating the Memory resource count for domain: %s" % self.cadmin_2.name)
Resources.updateLimit(
self.apiclient, resourcetype=9, max=2048, account=self.cadmin_2.name, domainid=self.cadmin_2.domainid
)
# Cleanup the resources created at end of test
self.cleanup.append(self.cadmin_1)
self.cleanup.append(self.cadmin_2)
self.cleanup.append(self.cdomain_1)
self.cleanup.append(self.cdomain_2)
self.cleanup.append(self.parentd_admin)
self.cleanup.append(self.parent_domain)
users = {self.parent_domain: self.parentd_admin, self.cdomain_1: self.cadmin_1, self.cdomain_2: self.cadmin_2}
return users
开发者ID:tianshangjun,项目名称:cloudstack,代码行数:58,代码来源:test_mm_domain_limits.py
示例5: setupAccounts
def setupAccounts(self):
try:
self.parent_domain = Domain.create(
self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.parentd_admin = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.parent_domain.id)
# Create sub-domains and their admin accounts
self.cdomain_1 = Domain.create(
self.apiclient,
services=self.services["domain"],
parentdomainid=self.parent_domain.id)
self.cdomain_2 = Domain.create(
self.apiclient,
services=self.services["domain"],
parentdomainid=self.parent_domain.id)
self.cadmin_1 = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.cdomain_1.id)
self.cadmin_2 = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.cdomain_2.id)
# Cleanup the resources created at end of test
self.cleanup.append(self.cadmin_1)
self.cleanup.append(self.cadmin_2)
self.cleanup.append(self.cdomain_1)
self.cleanup.append(self.cdomain_2)
self.cleanup.append(self.parentd_admin)
self.cleanup.append(self.parent_domain)
users = {
self.cdomain_1: self.cadmin_1,
self.cdomain_2: self.cadmin_2
}
except Exception as e:
return [FAIL, e, None]
return [PASS, None, users]
开发者ID:EdwardBetts,项目名称:blackhole,代码行数:49,代码来源:test_ps_domain_limits.py
示例6: test_01_ldap
def test_01_ldap(self):
"""Check the linkDomainToLdap functionality"""
self.domain1 = Domain.create(
self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.ldaplink4 = linkDomainToLdap.linkDomainToLdapCmd()
self.ldaplink4.domainid = self.domain1.id
self.ldaplink4.accounttype = self.services[
"configurableData"]["link_ldap_details"]["accounttype"]
self.ldaplink4.name = self.services[
"configurableData"]["link_ldap_details"]["name"]
self.ldaplink4.type = self.services[
"configurableData"]["link_ldap_details"]["type"]
if self.services["configurableData"][
"link_ldap_details"]["admin"] is not None:
self.ldaplink4.admin = self.services[
"configurableData"]["link_ldap_details"]["admin"]
try:
self.ldaplinkRes4 = self.apiClient.linkDomainToLdap(self.ldaplink4)
except Exception as e:
raise Exception(
"Linking LDAP failed,please check the configuration")
try:
self.domain1.delete(self.apiclient)
except Exception as e:
raise Exception(
"Warning: Exception during deletion of domain : %s" % e)
开发者ID:Accelerite,项目名称:cloudstack,代码行数:32,代码来源:test_ldap_auto_import.py
示例7: setUpClass
def setUpClass(cls):
cls.testClient = super(TestResourceLimitsProject, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.services = Services().services
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
cls.services["mode"] = cls.zone.networktype
cls.template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])
cls.services["server"]["zoneid"] = cls.zone.id
# Create Domains, Account etc
cls.domain = Domain.create(cls.api_client, cls.services["domain"])
cls.account = Account.create(cls.api_client, cls.services["account"], domainid=cls.domain.id)
cls.userapiclient = cls.testClient.getUserApiClient(UserName=cls.account.name, DomainName=cls.account.domain)
# Create project as a domain admin
cls.project = Project.create(
cls.api_client, cls.services["project"], account=cls.account.name, domainid=cls.account.domainid
)
cls.services["account"] = cls.account.name
# Create Service offering and disk offerings etc
cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"])
cls.disk_offering = DiskOffering.create(cls.api_client, cls.services["disk_offering"])
cls._cleanup = [cls.project, cls.service_offering, cls.disk_offering, cls.account, cls.domain]
return
开发者ID:vaddanak,项目名称:challenges,代码行数:29,代码来源:test_project_limits.py
示例8: test_es_1863_register_template_s3_domain_admin_user
def test_es_1863_register_template_s3_domain_admin_user(self):
"""
@Desc: Test whether cloudstack allows Domain admin or user
to register a template using S3/Swift object store.
@Steps:
Step1: create a Domain and users in it.
Step2: Register a template as Domain admin.
Step3: Register a template as Domain user.
Step4: Template should be registered successfully.
"""
# Step1: create a Domain and users in it.
self.newdomain = Domain.create(self.apiClient,
self.services["domain"])
# create account in the domain
self.account_domain = Account.create(
self.apiClient,
self.services["account"],
domainid=self.newdomain.id
)
self.cleanup.append(self.account_domain)
self.cleanup.append(self.newdomain)
# Getting authentication for user in newly created Account in domain
self.domain_user = self.account_domain.user[0]
self.domain_userapiclient = self.testClient.getUserApiClient(
self.domain_user.username, self.newdomain.name
)
# Step2: Register a template as Domain admin.
self.services["templateregister"]["ostype"] = self.services["ostype"]
self.domain_template = Template.register(
self.apiClient,
self.services["templateregister"],
zoneid=self.zone.id,
account=self.account_domain.name,
domainid=self.newdomain.id,
hypervisor=self.hypervisor
)
# Wait for template to download
self.domain_template.download(self.api_client)
# Wait for template status to be changed across
time.sleep(60)
# Step3: Register a template as Domain user.
self.domain_user_template = Template.register(
self.domain_userapiclient,
self.services["templateregister"],
zoneid=self.zone.id,
account=self.account_domain.name,
domainid=self.newdomain.id,
hypervisor=self.hypervisor
)
# Wait for template to download
self.domain_user_template.download(self.api_client)
# Wait for template status to be changed across
time.sleep(60)
# TODO: Step4: Template should be registered successfully.
return
开发者ID:Accelerite,项目名称:cloudstack,代码行数:60,代码来源:test_bugs.py
示例9: setUpClass
def setUpClass(cls):
cls.testClient = super(TestPublicIpAddress, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.services = Services().services
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
cls.services["mode"] = cls.zone.networktype
cls.template = get_template(cls.api_client, cls.zone.id, cls.services["ostype"])
cls.services["server"]["zoneid"] = cls.zone.id
# Create Domains, Account etc
cls.domain = Domain.create(cls.api_client, cls.services["domain"])
cls.account = Account.create(cls.api_client, cls.services["account"], domainid=cls.domain.id)
# Create project as a domain admin
cls.project = Project.create(
cls.api_client, cls.services["project"], account=cls.account.name, domainid=cls.account.domainid
)
cls.services["account"] = cls.account.name
# Create Service offering and disk offerings etc
cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"])
cls.virtual_machine = VirtualMachine.create(
cls.api_client,
cls.services["server"],
templateid=cls.template.id,
serviceofferingid=cls.service_offering.id,
projectid=cls.project.id,
)
cls._cleanup = [cls.project, cls.service_offering, cls.account, cls.domain]
return
开发者ID:maksimov,项目名称:cloudstack,代码行数:33,代码来源:test_project_resources.py
示例10: setUpClass
def setUpClass(cls):
cls._cleanup = []
cls.testClient = super(TestEgressFWRules, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.services = Services().services
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
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:MANIKANDANVEN,项目名称:cloudstack,代码行数:31,代码来源:test_egress_fw_rules.py
示例11: setupAccounts
def setupAccounts(self, account_limit=2, domain_limit=2, project_limit=2):
self.debug("Creating a domain under: %s" % self.domain.name)
self.child_domain = Domain.create(self.apiclient,
services=self.testdata["domain"],
parentdomainid=self.domain.id)
self.debug("domain crated with domain id %s" % self.child_domain.id)
self.child_do_admin = Account.create(self.apiclient,
self.testdata["account"],
admin=True,
domainid=self.child_domain.id)
self.debug("domain admin created for domain id %s" %
self.child_do_admin.domainid)
# Create project as a domain admin
self.project = Project.create(self.apiclient,
self.testdata["project"],
account=self.child_do_admin.name,
domainid=self.child_do_admin.domainid)
# Cleanup created project at end of test
self.cleanup.append(self.project)
# Cleanup accounts created
self.cleanup.append(self.child_do_admin)
self.cleanup.append(self.child_domain)
self.debug("Updating the CPU resource count for domain: %s" %
self.child_domain.name)
# Update resource limits for account 1
responses = Resources.updateLimit(self.apiclient,
resourcetype=8,
max=account_limit,
account=self.child_do_admin.name,
domainid=self.child_do_admin.domainid)
self.debug("CPU Resource count for child domain admin account is now: %s" %
responses.max)
self.debug("Updating the CPU limit for project")
responses = Resources.updateLimit(self.apiclient,
resourcetype=8,
max=project_limit,
projectid=self.project.id)
self.debug("CPU Resource count for project is now")
self.debug(responses.max)
self.debug("Updating the CPU limit for domain only")
responses = Resources.updateLimit(self.apiclient,
resourcetype=8,
max=domain_limit,
domainid=self.child_domain.id)
self.debug("CPU Resource count for domain %s with id %s is now %s" %
(responses.domain, responses.domainid, responses.max))
return
开发者ID:PCextreme,项目名称:cloudstack,代码行数:60,代码来源:test_cpu_max_limits.py
示例12: setupAccounts
def setupAccounts(self):
try:
self.child_domain = Domain.create(self.apiclient,services=self.services["domain"],
parentdomainid=self.domain.id)
self.child_do_admin = Account.create(self.apiclient, self.services["account"], admin=True,
domainid=self.child_domain.id)
self.userapiclient = self.testClient.getUserApiClient(
UserName=self.child_do_admin.name,
DomainName=self.child_do_admin.domain)
# Create project as a domain admin
self.project = Project.create(self.apiclient, self.services["project"],
account=self.child_do_admin.name,
domainid=self.child_do_admin.domainid)
# Cleanup created project at end of test
self.cleanup.append(self.project)
# Cleanup accounts created
self.cleanup.append(self.child_do_admin)
self.cleanup.append(self.child_domain)
except Exception as e:
return [FAIL, e]
return [PASS, None]
开发者ID:m8cool,项目名称:cloudstack,代码行数:27,代码来源:test_ss_max_limits.py
示例13: setupAccount
def setupAccount(self, accountType):
"""Setup the account required for the test"""
try:
if accountType == CHILD_DOMAIN_ADMIN:
self.domain = Domain.create(self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.account = Account.create(self.apiclient, self.services["account"],
domainid=self.domain.id, admin=True)
self.cleanup.append(self.account)
if accountType == CHILD_DOMAIN_ADMIN:
self.cleanup.append(self.domain)
self.virtualMachine = VirtualMachine.create(self.api_client, self.services["virtual_machine"],
accountid=self.account.name, domainid=self.account.domainid,
diskofferingid=self.disk_offering.id,
serviceofferingid=self.service_offering.id)
accounts = Account.list(self.apiclient, id=self.account.id)
self.assertEqual(validateList(accounts)[0], PASS,
"accounts list validation failed")
self.initialResourceCount = int(accounts[0].primarystoragetotal)
except Exception as e:
return [FAIL, e]
return [PASS, None]
开发者ID:Accelerite,项目名称:cloudstack,代码行数:29,代码来源:test_ps_limits.py
示例14: create_domain_account_user
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}
开发者ID:PCextreme,项目名称:cloudstack,代码行数:29,代码来源:test_assign_vm.py
示例15: setUp
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
self.services = Services().services
# Get Zone, Domain and templates
self.domain = get_domain(self.apiclient)
self.account = Account.create(
self.apiclient,
self.services["account"],
domainid=self.domain.id
)
self.newdomain = Domain.create(
self.apiclient,
self.services["testdomain"],
parentdomainid=self.domain.id
)
self.newdomain_account = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.newdomain.id
)
self.cleanup = [
self.account,
self.newdomain_account,
self.newdomain,
]
开发者ID:HitherTech,项目名称:cloudstack,代码行数:30,代码来源:test_templates.py
示例16: setupProjectAccounts
def setupProjectAccounts(self):
self.debug("Creating a domain under: %s" % self.domain.name)
self.domain = Domain.create(self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.admin = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.domain.id
)
# Create project as a domain admin
self.project = Project.create(self.apiclient,
self.services["project"],
account=self.admin.name,
domainid=self.admin.domainid)
# Cleanup created project at end of test
self.cleanup.append(self.project)
self.cleanup.append(self.admin)
self.cleanup.append(self.domain)
self.debug("Created project with domain admin with name: %s" %
self.project.name)
projects = Project.list(self.apiclient, id=self.project.id,
listall=True)
self.assertEqual(isinstance(projects, list), True,
"Check for a valid list projects response")
project = projects[0]
self.assertEqual(project.name, self.project.name,
"Check project name from list response")
return
开发者ID:EdwardBetts,项目名称:blackhole,代码行数:34,代码来源:test_cpu_project_limits.py
示例17: setUp
def setUp(self):
self.user = self.services["configurableData"]["link_ldap_details"]["linkLdapUsername"]
self.password = self.services["configurableData"]["link_ldap_details"]["linkLdapPassword"]
self.delflag1 = 0
self.delflag2 = 0
self.delflag3 = 0
self.delflag4 = 0
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
self.parent_domain = Domain.create(
self.apiclient,
services=self.services["domain"],
parentdomainid=self.domain.id)
self.ldaplink = linkDomainToLdap.linkDomainToLdapCmd()
self.ldaplink.domainid = self.parent_domain.id
self.ldaplink.accounttype = self.services[
"configurableData"]["link_ldap_details"]["accounttype"]
self.ldaplink.name = self.services[
"configurableData"]["link_ldap_details"]["name"]
self.ldaplink.type = self.services[
"configurableData"]["link_ldap_details"]["type"]
if self.services["configurableData"][
"link_ldap_details"]["admin"] is not None:
self.ldaplink.admin = self.services[
"configurableData"]["link_ldap_details"]["admin"]
if self.ldaplink.domainid == "" or self.ldaplink.accounttype == "" \
or self.ldaplink.name == "" \
or self.ldaplink.type == "":
self.debug(
"Please rerun the test by providing "
"values in link_ldap configuration user details")
self.skipTest(
"Please rerun the test by providing "
"proper values in configuration file(link ldap)")
else:
self.delflag1 = 1
self.ldaplinkRes = self.apiClient.linkDomainToLdap(self.ldaplink)
self.assertEquals(
self.delflag1,
1,
"Linking LDAP failed,please check the configuration")
loginRes = checklogin(self,
self.user, self.password,
self.parent_domain.name,
method="POST")
self.debug(loginRes)
self.assertEquals(loginRes, 1, self.reason)
lsap_user = Account.list(self.api_client,
domainid=self.parent_domain.id,
name=self.user
)
self.ldapacctID = lsap_user[0].id
开发者ID:Accelerite,项目名称:cloudstack,代码行数:58,代码来源:test_ldap_auto_import.py
示例18: deploy_domain
def deploy_domain(self, domain_data):
if domain_data['name'] == 'ROOT':
domain_list = Domain.list(
api_client=self.api_client,
name=domain_data['name']
)
domain = domain_list[0]
else:
self.logger.debug('>>> DOMAIN => Creating "%s"...', domain_data['name'])
domain = Domain.create(
api_client=self.api_client,
name=domain_data['name'] + ('-' + random_gen() if self.randomizeNames else '')
)
self.logger.debug('>>> DOMAIN => ID: %s => Name: %s => Path: %s => State: %s', domain.id, domain.name,
domain.path, domain.state)
self.deploy_accounts(domain_data['accounts'], domain)
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:18,代码来源:testScenarioManager.py
示例19: setUp
def setUp(self):
self.apiclient = self.api_client
self.dbclient = self.testClient.getDbConnection()
self.egressruleid = None
self.cleanup = []
self.domain = Domain.create(self.apiclient, self.services["domain"])
# Create an Account associated with domain
self.account = Account.create(self.apiclient, self.services["account"], domainid=self.domain.id)
self.cleanup.append(self.account)
self.cleanup.append(self.domain)
return
开发者ID:tianshangjun,项目名称:cloudstack,代码行数:11,代码来源:test_egress_fw_rules.py
示例20: setUpClass
def setUpClass(cls):
testClient = super(
TestlistTemplates, cls).getClsTestClient()
cls.apiclient = testClient.getApiClient()
cls.testdata = testClient.getParsedTestDataConfig()
cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
cls.template = get_template(
cls.apiclient,
cls.zone.id,
cls.testdata["ostype"]
)
cls.hypervisor = cls.testClient.getHypervisorInfo()
builtin_info = get_builtin_template_info(cls.apiclient, cls.zone.id)
cls.testdata["templates"]["url"] = builtin_info[0]
cls.testdata["templates"]["hypervisor"] = builtin_info[1]
cls.testdata["templates"]["format"] = builtin_info[2]
if cls.zone.localstorageenabled:
cls.storagetype = 'local'
cls.testdata["service_offerings"]["tiny"]["storagetype"] = 'local'
cls.testdata["disk_offering"]["storagetype"] = 'local'
else:
cls.storagetype = 'shared'
cls.testdata["service_offerings"]["tiny"]["storagetype"] = 'shared'
cls.testdata["disk_offering"]["storagetype"] = 'shared'
cls.testdata["virtual_machine"]["hypervisor"] = cls.hypervisor
cls.testdata["virtual_machine"]["zoneid"] = cls.zone.id
cls.testdata["virtual_machine"]["template"] = cls.template.id
cls.testdata["custom_volume"]["zoneid"] = cls.zone.id
cls.service_offering = ServiceOffering.create(
cls.apiclient,
cls.testdata["service_offerings"]["tiny"]
)
cls.mgtSvrDetails = cls.config.__dict__["mgtSvr"][0].__dict__
cls.cleanup = []
# Create 1 domain admin account
cls.domain = Domain.create(
cls.apiclient,
cls.testdata["domain"])
cls.account = Account.create(
cls.apiclient,
cls.testdata["account"],
admin=True,
domainid=cls.domain.id)
cls.debug("Created account %s in domain %s" %
(cls.account.name, cls.domain.id))
cls.cleanup.append(cls.account)
cls.cleanup.append(cls.domain)
开发者ID:EdwardBetts,项目名称:blackhole,代码行数:53,代码来源:test_escalation_templates.py
注:本文中的marvin.lib.base.Domain类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论