Ejemplo n.º 1
0
def myservice(appliance, setup_provider, provider, catalog_item, request):
    vm_name = catalog_item.provisioning_data["vm_name"]
    request.addfinalizer(lambda: cleanup_vm(vm_name + "_0001", provider))
    catalog_item.create()
    service_catalogs = ServiceCatalogs(catalog_item.catalog, catalog_item.name)
    service_catalogs.order()
    logger.info('Waiting for cfme provision request for service %s', catalog_item.name)
    request_description = catalog_item.name
    provision_request = RequestCollection(appliance).instantiate(request_description,
                                                                 partial_check=True)
    provision_request.wait_for_request()
    assert provision_request.is_finished()
    service = MyService(appliance, catalog_item.name, vm_name)
    yield service

    try:
        service.delete()
    except Exception as ex:
        logger.warning('Exception while deleting MyService, continuing: {}'.format(ex.message))
Ejemplo n.º 2
0
def order_catalog_item_in_ops_ui(appliance, provider, catalog_item, request):
    """
        Fixture for SSUI tests.
        Orders catalog item in OPS UI.
    """
    vm_name = catalog_item.provisioning_data["vm_name"]
    request.addfinalizer(
        lambda: cleanup_vm("{}_0001".format(vm_name), provider))
    catalog_item.create()
    service_catalogs = ServiceCatalogs(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 = RequestCollection(appliance).instantiate(
        request_description, partial_check=True)
    provision_request.wait_for_request()
    assert provision_request.is_finished()
    return catalog_item.name
Ejemplo n.º 3
0
def order_catalog_item_in_ops_ui(appliance, provider, provisioning, vm_name, dialog, catalog,
        console_template, request):
    """
        Fixture for SSUI tests.
        Orders catalog item in OPS UI.
    """
    if hasattr(request, 'param'):
        catalog_item = create_catalog_item(provider, provisioning, vm_name, dialog, catalog,
            console_template if 'console_test' in request.param else None)
    else:
        catalog_item = create_catalog_item(provider, provisioning, vm_name, dialog, catalog)
    vm_name = catalog_item.provisioning_data["vm_name"]
    request.addfinalizer(lambda: cleanup_vm("{}0001".format(vm_name), provider))
    catalog_item.create()
    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 = RequestCollection(appliance).instantiate(request_description,
                                                                 partial_check=True)
    provision_request.wait_for_request()
    assert provision_request.is_finished()
    return catalog_item.name