本文整理汇总了Python中cfme.services.service_catalogs.ServiceCatalogs.order方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceCatalogs.order方法的具体用法?Python ServiceCatalogs.order怎么用?Python ServiceCatalogs.order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.services.service_catalogs.ServiceCatalogs
的用法示例。
在下文中一共展示了ServiceCatalogs.order方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pxe_servicecatalog
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_pxe_servicecatalog(appliance, setup_provider, provider, catalog_item, request):
"""Tests RHEV PXE service catalog
Metadata:
test_flag: pxe, provision
Polarion:
assignee: nansari
initialEstimate: 1/4h
"""
vm_name = catalog_item.prov_data['catalog']["vm_name"]
request.addfinalizer(
lambda: appliance.collections.infra_vms.instantiate(
"{}0001".format(vm_name), provider).cleanup_on_provider()
)
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
service_catalogs.order()
# nav to requests page happens on successful provision
logger.info('Waiting for cfme provision request for service %s', catalog_item.name)
request_description = catalog_item.name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request(num_sec=3600)
msg = "Provisioning failed with the message {}".format(provision_request.rest.message)
assert provision_request.is_succeeded(), msg
示例2: test_order_tower_catalog_item
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_order_tower_catalog_item(appliance, config_manager, catalog_item, request, job_type):
"""Tests ordering of catalog items for Ansible Template and Workflow jobs
Metadata:
test_flag: provision
Polarion:
assignee: nachandr
initialEstimate: 1/4h
casecomponent: Services
caseimportance: high
"""
if job_type == 'template_limit':
host = config_manager.yaml_data['provisioning_data']['inventory_host']
dialog_values = {'limit': host}
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name,
dialog_values=dialog_values)
else:
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service %s', catalog_item.name)
cells = {'Description': catalog_item.name}
order_request = appliance.collections.requests.instantiate(cells=cells, partial_check=True)
order_request.wait_for_request(method='ui')
msg = 'Request failed with the message {}'.format(order_request.row.last_message.text)
assert order_request.is_succeeded(method='ui'), msg
appliance.user.my_settings.default_views.set_default_view('Configuration Management Providers',
'List View')
示例3: test_service_rbac_service_catalog
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_service_rbac_service_catalog(appliance, role_user_group, catalog, catalog_item):
""" Test service rbac with service catalog
Polarion:
assignee: apagac
initialEstimate: 1/4h
casecomponent: Services
"""
role, user = role_user_group
product_features = [
(['Everything'], True), (['Everything'], False),
(['Everything', 'Services', 'Requests'], True),
(['Everything', 'Automation', 'Automate', 'Customization'], True)
]
product_features.extend([(['Everything', 'Services', 'Catalogs Explorer', k], True)
for k in ['Catalog Items', 'Service Catalogs', 'Catalogs']])
role.update({'product_features': product_features})
# Without below line, service_order only works here via admin, not via user
# TODO: Remove below line when this behavior gets fixed
with user:
appliance.server.login(user)
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
service_catalogs.order()
service_request = appliance.collections.requests.instantiate(catalog_item.name,
partial_check=True)
service_request.wait_for_request()
assert service_request.is_succeeded()
示例4: test_quota_tagging_infra_via_services
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_quota_tagging_infra_via_services(request, appliance, admin_email, context,
set_entity_quota_tag, custom_prov_data, prov_data,
catalog_item):
"""This test case verifies the quota tagging is working correctly for the infra providers.
Polarion:
assignee: ghubale
casecomponent: Quota
caseimportance: medium
initialEstimate: 1/6h
tags: quota
"""
prov_data.update(custom_prov_data)
with appliance.context.use(context):
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
if context is ViaSSUI:
service_catalogs.add_to_shopping_cart()
service_catalogs.order()
# nav to requests page to check quota validation
request_description = 'Provisioning Service [{0}] from [{0}]'.format(catalog_item.name)
provision_request = appliance.collections.requests.instantiate(request_description)
provision_request.wait_for_request(method='ui')
request.addfinalizer(provision_request.remove_request)
assert provision_request.row.reason.text == "Quota Exceeded"
示例5: test_order_catalog_item
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_order_catalog_item(appliance, provider, catalog_item, request,
register_event):
"""Tests order catalog item
Metadata:
test_flag: provision
Polarion:
assignee: nansari
casecomponent: Services
initialEstimate: 1/4h
tags: service
"""
vm_name = catalog_item.prov_data['catalog']["vm_name"]
request.addfinalizer(
lambda: appliance.collections.infra_vms.instantiate(
"{}0001".format(vm_name), provider).cleanup_on_provider()
)
register_event(target_type='Service', target_name=catalog_item.name,
event_type='service_provisioned')
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
service_catalogs.order()
logger.info("Waiting for cfme provision request for service {}".format(catalog_item.name))
request_description = catalog_item.name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
msg = "Provisioning failed with the message {}".format(provision_request.rest.message)
assert provision_request.is_succeeded(), msg
示例6: test_quota_cloud_via_services
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_quota_cloud_via_services(appliance, request, admin_email, entities, prov_data,
catalog_item, context):
"""This test case verifies the quota assigned by automation method for user and group
is working correctly for the cloud providers.
Polarion:
assignee: ghubale
initialEstimate: 1/4h
casecomponent: Cloud
tags: quota
testSteps:
1. Navigate to Automation > Automate > Explorer
2. Add quota automation methods to domain
3. Change 'quota_source_type' to 'user' or 'group'
4. Test quota by provisioning instances over quota limit via UI or
SSUI for user and group
5. Check whether quota is exceeded or not
"""
with appliance.context.use(context):
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
if context is ViaSSUI:
service_catalogs.add_to_shopping_cart()
service_catalogs.order()
# nav to requests page to check quota validation
request_description = ("Provisioning Service [{catalog_item_name}] from [{catalog_item_name}]"
.format(catalog_item_name=catalog_item.name))
provision_request = appliance.collections.requests.instantiate(request_description)
provision_request.wait_for_request(method='ui')
request.addfinalizer(provision_request.remove_request)
assert provision_request.row.reason.text == "Quota Exceeded"
示例7: test_reconfigure_service
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_reconfigure_service(appliance, provider, provisioning, catalog, catalog_item, request):
"""Tests stack provisioning
Metadata:
test_flag: provision
"""
catalog_item, template = catalog_item
stack_data = prepare_stack_data(provider, provisioning)
@request.addfinalizer
def _cleanup_vms():
clean_up(stack_data, provider)
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog,
catalog_item.name, stack_data)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service {}'.format(catalog_item.name))
request_description = catalog_item.name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
assert provision_request.is_succeeded()
myservice = MyService(appliance, catalog_item.name)
myservice.reconfigure_service()
示例8: test_bundles_in_bundle
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_bundles_in_bundle(appliance, catalog_item):
bundle_name = "first_" + fauxfactory.gen_alphanumeric()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog,
catalog_items=[catalog_item.name])
catalog_bundle.create()
sec_bundle_name = "sec_" + fauxfactory.gen_alphanumeric()
sec_catalog_bundle = CatalogBundle(name=sec_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog,
catalog_items=[bundle_name])
sec_catalog_bundle.create()
third_bundle_name = "third_" + fauxfactory.gen_alphanumeric()
third_catalog_bundle = CatalogBundle(name=third_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog,
catalog_items=[bundle_name, sec_bundle_name])
third_catalog_bundle.create()
service_catalogs = ServiceCatalogs(appliance, third_catalog_bundle.catalog, third_bundle_name)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service %s', bundle_name)
request_description = third_bundle_name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
msg = "Request failed with the message {}".format(provision_request.rest.message)
assert provision_request.is_succeeded(), msg
示例9: test_bundles_in_bundle
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_bundles_in_bundle(appliance, catalog_item):
"""
Polarion:
assignee: nansari
casecomponent: Services
caseimportance: low
initialEstimate: 1/8h
tags: service
"""
bundle_name = "first_" + fauxfactory.gen_alphanumeric()
appliance.collections.catalog_bundles.create(
bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog,
catalog_items=[catalog_item.name])
sec_bundle_name = "sec_" + fauxfactory.gen_alphanumeric()
appliance.collections.catalog_bundles.create(
sec_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog,
catalog_items=[bundle_name])
third_bundle_name = "third_" + fauxfactory.gen_alphanumeric()
third_catalog_bundle = appliance.collections.catalog_bundles.create(
third_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog,
catalog_items=[bundle_name, sec_bundle_name])
service_catalogs = ServiceCatalogs(appliance, third_catalog_bundle.catalog, third_bundle_name)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service %s', bundle_name)
request_description = third_bundle_name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
msg = "Request failed with the message {}".format(provision_request.rest.message)
assert provision_request.is_succeeded(), msg
示例10: test_retire_stack
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_retire_stack(appliance, provider, provisioning, catalog, catalog_item, request):
"""Tests stack provisioning
Metadata:
test_flag: provision
"""
catalog_item, template = catalog_item
DefaultView.set_default_view("Stacks", "Grid View")
stack_data = prepare_stack_data(provider, provisioning)
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog,
catalog_item.name, stack_data)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service {}'.format(catalog_item.name))
request_description = catalog_item.name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
assert provision_request.is_succeeded()
stack = StackCollection(appliance).instantiate(stack_data['stack_name'], provider=provider)
stack.wait_for_exists()
stack.retire_stack()
@request.addfinalizer
def _cleanup_vms():
clean_up(stack_data, provider)
示例11: test_quota_catalog_bundle_infra
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_quota_catalog_bundle_infra(request, appliance, admin_email, entities, custom_prov_data,
prov_data, catalog_bundle, context, vm_name, template_name):
"""This test case verifies the quota assigned by automation method for user and group
is working correctly for the infra providers by ordering catalog bundle.
Polarion:
assignee: ghubale
initialEstimate: 1/4h
casecomponent: Quota
caseimportance: high
tags: quota
testSteps:
1. Navigate to Automation > Automate > Explorer
2. Add quota automation methods to domain
3. Change 'quota_source_type' to 'user' or 'group'
4. Create one or more catalogs to test quota by provisioning VMs over quota limit via UI
or SSUI for user and group
5. Add more than one catalog to catalog bundle and order catalog bundle
6. Check whether quota is exceeded or not
"""
prov_data.update(custom_prov_data)
with appliance.context.use(context):
service_catalogs = ServiceCatalogs(appliance, catalog_bundle.catalog, catalog_bundle.name)
if context is ViaSSUI:
service_catalogs.add_to_shopping_cart()
service_catalogs.order()
# nav to requests page to check quota validation
request_description = 'Provisioning Service [{0}] from [{0}]'.format(catalog_bundle.name)
provision_request = appliance.collections.requests.instantiate(request_description)
provision_request.wait_for_request(method='ui')
request.addfinalizer(provision_request.remove_request)
assert provision_request.row.reason.text == "Quota Exceeded"
示例12: test_tenant_quota_enforce_via_service_cloud
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_tenant_quota_enforce_via_service_cloud(request, appliance, provider, setup_provider,
context, set_roottenant_quota, set_default,
custom_prov_data, extra_msg, template_name,
catalog_item):
"""Test Tenant Quota in UI and SSUI
Polarion:
assignee: ghubale
casecomponent: Cloud
initialEstimate: 1/10h
"""
with appliance.context.use(context):
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
if context is ViaSSUI:
service_catalogs.add_to_shopping_cart()
service_catalogs.order()
# nav to requests page to check quota validation
request_description = 'Provisioning Service [{0}] from [{0}]'.format(catalog_item.name)
provision_request = appliance.collections.requests.instantiate(request_description)
provision_request.wait_for_request(method='ui')
assert provision_request.row.reason.text == "Quota Exceeded"
@request.addfinalizer
def delete():
provision_request.remove_request()
catalog_item.delete()
示例13: test_order_catalog_bundle
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_order_catalog_bundle(appliance, provider, catalog_item, request):
"""Tests ordering a catalog bundle
Metadata:
test_flag: provision
"""
vm_name = catalog_item.prov_data['catalog']["vm_name"]
request.addfinalizer(
lambda: appliance.collections.infra_vms.instantiate(
"{}0001".format(vm_name), provider).cleanup_on_provider()
)
bundle_name = fauxfactory.gen_alphanumeric()
catalog_bundle = appliance.collections.catalog_bundles.create(
bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog,
dialog=catalog_item.dialog, catalog_items=[catalog_item.name])
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_bundle.name)
service_catalogs.order()
logger.info("Waiting for cfme provision request for service {}".format(bundle_name))
request_description = bundle_name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
msg = "Provisioning failed with the message {}".format(provision_request.rest.message)
assert provision_request.is_succeeded(), msg
示例14: test_tagdialog_catalog_item
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_tagdialog_catalog_item(appliance, provider, catalog_item, request):
"""Tests tag dialog catalog item
Metadata:
test_flag: provision
Polarion:
assignee: nansari
initialEstimate: 1/4h
casecomponent: Services
tags: service
"""
vm_name = catalog_item.prov_data['catalog']["vm_name"]
request.addfinalizer(
lambda: appliance.collections.infra_vms.instantiate(
"{}0001".format(vm_name), provider).cleanup_on_provider()
)
dialog_values = {'service_level': "Gold"}
service_catalogs = ServiceCatalogs(appliance, catalog=catalog_item.catalog,
name=catalog_item.name,
dialog_values=dialog_values)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service {}'.format(catalog_item.name))
request_description = catalog_item.name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
msg = "Request failed with the message {}".format(provision_request.rest.message)
assert provision_request.is_succeeded(), msg
示例15: test_service_manual_approval
# 需要导入模块: from cfme.services.service_catalogs import ServiceCatalogs [as 别名]
# 或者: from cfme.services.service_catalogs.ServiceCatalogs import order [as 别名]
def test_service_manual_approval(appliance, provider, modify_instance,
catalog_item, request):
"""Tests order catalog item
Metadata:
test_flag: provision
Polarion:
assignee: nansari
initialEstimate: 1/4h
casecomponent: Services
tags: service
"""
vm_name = catalog_item.prov_data['catalog']["vm_name"]
request.addfinalizer(
lambda: appliance.collections.infra_vms.instantiate(vm_name,
provider).cleanup_on_provider()
)
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
service_catalogs.order()
logger.info("Waiting for cfme provision request for service {}".format(catalog_item.name))
request_description = catalog_item.name
service_request = appliance.collections.requests.instantiate(description=request_description,
partial_check=True)
service_request.update(method='ui')
assert service_request.row.approval_state.text == 'Pending Approval'