本文整理汇总了Python中cfme.services.catalogs.catalog_item.CatalogBundle类的典型用法代码示例。如果您正苦于以下问题:Python CatalogBundle类的具体用法?Python CatalogBundle怎么用?Python CatalogBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CatalogBundle类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bundles_in_bundle
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
示例2: test_service_generic_catalog_bundle
def test_service_generic_catalog_bundle(catalog_item):
bundle_name = "generic_" + fauxfactory.gen_alphanumeric()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
catalog_bundle.create([catalog_item.name])
service_catalogs = ServiceCatalogs("service_name")
service_catalogs.order(catalog_item.catalog, catalog_bundle)
flash.assert_no_errors()
logger.info('Waiting for cfme provision request for service %s', bundle_name)
row_description = bundle_name
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=900, delay=20)
assert row.last_message.text == 'Request complete'
示例3: test_service_generic_catalog_bundle
def test_service_generic_catalog_bundle(appliance, catalog_item):
bundle_name = "generic_" + 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()
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, bundle_name)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service %s', bundle_name)
request_description = bundle_name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
assert provision_request.is_succeeded()
示例4: test_order_catalog_bundle
def test_order_catalog_bundle(provider_key, provider_mgmt, setup_providers, catalog_item, request):
vm_name = catalog_item.provisioning_data["vm_name"]
catalog_item.create()
bundle_name = generate_random_string()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog,
dialog=catalog_item.dialog, cat_item=catalog_item.name)
catalog_bundle.create()
service_catalogs = ServiceCatalogs("service_name")
service_catalogs.order(catalog_item.catalog, catalog_bundle)
flash.assert_no_errors()
logger.info('Waiting for cfme provision request for service %s' % bundle_name)
row_description = 'Provisioning [%s] for Service [%s]' % (bundle_name, bundle_name)
cells = {'Description': row_description}
request.addfinalizer(lambda: cleanup_vm(vm_name, provider_key, provider_mgmt))
row, __ = wait_for(requests.wait_for_request, [cells],
fail_func=requests.reload, num_sec=600, delay=20)
assert row.last_message.text == 'Request complete'
示例5: catalog_bundle
def catalog_bundle(catalog_item):
""" Create catalog bundle
Args:
catalog_item: as resource for bundle creation
"""
catalog_item.create()
bundle_name = "bundle" + 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])
yield catalog_bundle
# fixture cleanup
try:
catalog_bundle.delete()
except NoSuchElementException:
logger.warning('test_catalog_item: catalog_item yield fixture cleanup, catalog item "{}" '
'not found'.format(catalog_bundle.name))
示例6: test_order_catalog_bundle
def test_order_catalog_bundle(provider, setup_provider, catalog_item, request):
"""Tests ordering a catalog bundle
Metadata:
test_flag: provision
"""
vm_name = catalog_item.provisioning_data["vm_name"]
request.addfinalizer(lambda: cleanup_vm(vm_name + "_0001", provider))
catalog_item.create()
bundle_name = fauxfactory.gen_alphanumeric()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
catalog_bundle.create([catalog_item.name])
service_catalogs = ServiceCatalogs(catalog_bundle.name)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service %s', bundle_name)
row_description = bundle_name
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=1200, delay=20)
assert row.request_state.text == 'Finished'
示例7: test_service_circular_reference
def test_service_circular_reference(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_bundle.create([catalog_item.name])
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)
sec_catalog_bundle.create([bundle_name])
with error.expected("Error during 'Resource Add': Adding resource <{}> to Service <{}> "
"will create a circular reference".format(sec_bundle_name, bundle_name)):
catalog_bundle.update({'description': "edit_desc",
'cat_item': sec_catalog_bundle.name})
示例8: test_service_circular_reference
def test_service_circular_reference(catalog_item):
bundle_name = "first_" + generate_random_string()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
catalog_bundle.create([catalog_item.name])
sec_bundle_name = "sec_" + generate_random_string()
sec_catalog_bundle = CatalogBundle(name=sec_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog,
dialog=catalog_item.dialog)
sec_catalog_bundle.create([bundle_name])
with error.expected("Error during 'Resource Add': Adding resource <%s> to Service <%s> "
"will create a circular reference" % (sec_bundle_name, bundle_name)):
catalog_bundle.update({'description': "edit_desc",
'cat_item': sec_catalog_bundle.name})
示例9: test_service_generic_catalog_bundle
def test_service_generic_catalog_bundle(catalog_item):
bundle_name = "generic_" + fauxfactory.gen_alphanumeric()
catalog_bundle = CatalogBundle(
name=bundle_name,
description="catalog_bundle",
display_in=True,
catalog=catalog_item.catalog,
dialog=catalog_item.dialog,
)
catalog_bundle.create([catalog_item.name])
service_catalogs = ServiceCatalogs(bundle_name)
service_catalogs.order()
flash.assert_no_errors()
logger.info("Waiting for cfme provision request for service %s", bundle_name)
row_description = bundle_name
cells = {"Description": row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True], fail_func=requests.reload, num_sec=900, delay=20)
# Success message differs between 5.6 and 5.7
if version.current_version() >= "5.7":
assert "Service [{}] Provisioned Successfully".format(bundle_name) in row.last_message.text
else:
assert row.last_message.text == "Request complete"
示例10: test_order_catalog_bundle
def test_order_catalog_bundle(appliance, provider, setup_provider, catalog_item, request):
"""Tests ordering a catalog bundle
Metadata:
test_flag: provision
"""
vm_name = catalog_item.provisioning_data['catalog']["vm_name"]
request.addfinalizer(lambda: cleanup_vm(vm_name + "_0001", provider))
catalog_item.create()
bundle_name = 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()
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()
assert provision_request.is_succeeded()
示例11: test_order_catalog_bundle
def test_order_catalog_bundle(provider_crud, provider_key, provider_mgmt, provider_init,
catalog_item, request):
"""Tests ordering a catalog bundle
Metadata:
test_flag: provision
"""
vm_name = catalog_item.provisioning_data["vm_name"]
request.addfinalizer(lambda: cleanup_vm(vm_name, provider_key, provider_mgmt))
catalog_item.create()
bundle_name = fauxfactory.gen_alphanumeric()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
catalog_bundle.create([catalog_item.name])
service_catalogs = ServiceCatalogs("service_name")
service_catalogs.order(catalog_item.catalog, catalog_bundle)
flash.assert_no_errors()
logger.info('Waiting for cfme provision request for service %s' % bundle_name)
row_description = bundle_name
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=1200, delay=20)
assert row.last_message.text == 'Request complete'
示例12: test_bundles_in_bundle
def test_bundles_in_bundle(catalog_item):
bundle_name = "first_" + generate_random_string()
catalog_bundle = CatalogBundle(name=bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
catalog_bundle.create([catalog_item.name])
sec_bundle_name = "sec_" + generate_random_string()
sec_catalog_bundle = CatalogBundle(name=sec_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
sec_catalog_bundle.create([bundle_name])
third_bundle_name = "third_" + generate_random_string()
third_catalog_bundle = CatalogBundle(name=third_bundle_name, description="catalog_bundle",
display_in=True, catalog=catalog_item.catalog, dialog=catalog_item.dialog)
third_catalog_bundle.create([bundle_name, sec_bundle_name])
service_catalogs = ServiceCatalogs("service_name")
service_catalogs.order(catalog_item.catalog, third_catalog_bundle)
flash.assert_no_errors()
logger.info('Waiting for cfme provision request for service %s' % bundle_name)
row_description = third_bundle_name
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=900, delay=20)
assert row.last_message.text == 'Request complete'