def test_reconfigure_service(provider, provisioning, create_template, catalog, request):
    """Tests stack provisioning

    Metadata:
        test_flag: provision
    """
    dialog_name, template = create_template
    item_name = fauxfactory.gen_alphanumeric()
    catalog_item = CatalogItem(item_type="Orchestration", name=item_name,
                  description="my catalog", display_in=True, catalog=catalog.name,
                  dialog=dialog_name, orch_template=template.template_name)
    catalog_item.create()
    stack_data = prepare_stack_data(provider, provisioning)

    @request.addfinalizer
    def _cleanup_vms():
        if provider.mgmt.stack_exist(stack_data['stack_name']):
            wait_for(lambda: provider.mgmt.delete_stack(stack_data['stack_name']),
             delay=10, num_sec=800, message="wait for stack delete")
        template.delete_all_templates()
        stack_data['vm_name'].delete_from_provider()

    service_catalogs = ServiceCatalogs("service_name", stack_data)
    service_catalogs.order_stack_item(catalog.name, catalog_item)
    logger.info('Waiting for cfme provision request for service %s', item_name)
    row_description = item_name
    cells = {'Description': row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True],
                       fail_func=requests.reload, num_sec=2000, delay=20)
    assert row.last_message.text == 'Service Provisioned Successfully'
    myservice = MyService(catalog_item.name)
    myservice.reconfigure_service()
Beispiel #2
0
def test_reconfigure_service(setup_provider, provider, provisioning, dialog,
                             catalog, request):
    """Tests stack provisioning

    Metadata:
        test_flag: provision
    """
    dialog_name, template_name = dialog
    item_name = fauxfactory.gen_alphanumeric()
    catalog_item = CatalogItem(item_type="Orchestration",
                               name=item_name,
                               description="my catalog",
                               display_in=True,
                               catalog=catalog.name,
                               dialog=dialog_name,
                               orch_template=template_name,
                               provider_type=provider.name)
    catalog_item.create()
    if provider.type == 'ec2':
        stack_data = {
            'stack_name':
            fauxfactory.gen_alphanumeric(),
            'key_name':
            provisioning['stack_provisioning']['key_name'],
            'db_user':
            provisioning['stack_provisioning']['db_user'],
            'db_password':
            provisioning['stack_provisioning']['db_password'],
            'db_root_password':
            provisioning['stack_provisioning']['db_root_password'],
            'select_instance_type':
            provisioning['stack_provisioning']['instance_type'],
        }
    elif provider.type == 'openstack':
        stack_data = {'stack_name': fauxfactory.gen_alphanumeric()}
    service_catalogs = ServiceCatalogs("service_name", stack_data)
    service_catalogs.order_stack_item(catalog.name, catalog_item)
    flash.assert_no_errors()
    logger.info('Waiting for cfme provision request for service %s' %
                item_name)
    row_description = item_name
    cells = {'Description': row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True],
                       fail_func=requests.reload,
                       num_sec=2000,
                       delay=20)
    assert row.last_message.text == 'Service Provisioned Successfully'
    myservice = MyService(catalog_item.name)
    myservice.reconfigure_service()
Beispiel #3
0
def test_reconfigure_service(setup_provider, provider, provisioning, dialog,
                             catalog, request):
    """Tests stack provisioning

    Metadata:
        test_flag: provision
    """
    dialog_name, template = dialog
    method = METHOD_TORSO.replace('"Description" : "AWS',
                                  '"Description" : "Amzn Web')
    template.create(method)
    template.create_service_dialog_from_template(dialog_name,
                                                 template.template_name)

    item_name = fauxfactory.gen_alphanumeric()
    catalog_item = CatalogItem(item_type="Orchestration",
                               name=item_name,
                               description="my catalog",
                               display_in=True,
                               catalog=catalog.name,
                               dialog=dialog_name,
                               orch_template=template.template_name,
                               provider_type=provider.name)
    catalog_item.create()
    stackname = "test-" + fauxfactory.gen_alphanumeric()
    stack_data = {'stack_name': stackname}

    @request.addfinalizer
    def _cleanup_vms():
        if provider.mgmt.stack_exist(stackname):
            wait_for(lambda: provider.mgmt.delete_stack(stackname),
                     delay=10,
                     num_sec=800,
                     message="wait for stack delete")
        template.delete_all_templates()

    service_catalogs = ServiceCatalogs("service_name", stack_data)
    service_catalogs.order_stack_item(catalog.name, catalog_item)
    logger.info('Waiting for cfme provision request for service %s', item_name)
    row_description = item_name
    cells = {'Description': row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True],
                       fail_func=requests.reload,
                       num_sec=2000,
                       delay=20)
    assert row.last_message.text == 'Service Provisioned Successfully'
    myservice = MyService(catalog_item.name)
    myservice.reconfigure_service()
def test_reconfigure_service(setup_provider, provider, dialog, catalog, request):
    """Tests stack provisioning

    Metadata:
        test_flag: provision
    """
    dialog_name, template = dialog
    method = METHOD_TORSO.replace('"Description" : "AWS',
                                  '"Description" : "Amzn Web')
    # template.create(method)
    try:
        template.create(method)
    except FlashMessageException:
        method = METHOD_TORSO.replace('"Description" : "AWS',
                                  '"Description" : "Amazon Web')
        template.create(method)
    template.create_service_dialog_from_template(dialog_name, template.template_name)

    item_name = fauxfactory.gen_alphanumeric()
    catalog_item = CatalogItem(item_type="Orchestration", name=item_name,
                  description="my catalog", display_in=True, catalog=catalog.name,
                  dialog=dialog_name, orch_template=template.template_name,
                  provider_type=provider.name)
    catalog_item.create()
    stackname = "test-" + fauxfactory.gen_alphanumeric()
    stack_data = {'stack_name': stackname}

    @request.addfinalizer
    def _cleanup_vms():
        if provider.mgmt.stack_exist(stackname):
            wait_for(lambda: provider.mgmt.delete_stack(stackname),
             delay=10, num_sec=800, message="wait for stack delete")
        template.delete_all_templates()

    service_catalogs = ServiceCatalogs("service_name", stack_data)
    service_catalogs.order_stack_item(catalog.name, catalog_item)
    logger.info('Waiting for cfme provision request for service %s', item_name)
    row_description = item_name
    cells = {'Description': row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True],
                       fail_func=requests.reload, num_sec=2000, delay=20)
    assert row.last_message.text == 'Service Provisioned Successfully'
    myservice = MyService(catalog_item.name)
    myservice.reconfigure_service()
def test_reconfigure_service(
    provider_init, provider_key, provider_crud, provider_type, provisioning, dialog, catalog, request
):
    """Tests stack provisioning

    Metadata:
        test_flag: provision
    """
    dialog_name, template_name = dialog
    item_name = fauxfactory.gen_alphanumeric()
    catalog_item = CatalogItem(
        item_type="Orchestration",
        name=item_name,
        description="my catalog",
        display_in=True,
        catalog=catalog.name,
        dialog=dialog_name,
        orch_template=template_name,
        provider_type=provider_crud.name,
    )
    catalog_item.create()
    if provider_type == "ec2":
        stack_data = {
            "stack_name": fauxfactory.gen_alphanumeric(),
            "key_name": provisioning["stack_provisioning"]["key_name"],
            "db_user": provisioning["stack_provisioning"]["db_user"],
            "db_password": provisioning["stack_provisioning"]["db_password"],
            "db_root_password": provisioning["stack_provisioning"]["db_root_password"],
            "select_instance_type": provisioning["stack_provisioning"]["instance_type"],
        }
    elif provider_type == "openstack":
        stack_data = {"stack_name": fauxfactory.gen_alphanumeric()}
    service_catalogs = ServiceCatalogs("service_name", stack_data)
    service_catalogs.order_stack_item(catalog.name, catalog_item)
    flash.assert_no_errors()
    logger.info("Waiting for cfme provision request for service %s" % item_name)
    row_description = item_name
    cells = {"Description": row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True], fail_func=requests.reload, num_sec=1000, delay=20)
    assert row.last_message.text == "Service Provisioned Successfully"
    myservice = MyService(catalog_item.name)
    myservice.reconfigure_service()
Beispiel #6
0
def myservice(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("service_name")
    service_catalogs.order(catalog_item.catalog, catalog_item)
    logger.info('Waiting for cfme provision request for service {}'
        .format(catalog_item.name))
    row_description = catalog_item.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'
    return MyService(catalog_item.name, vm_name)
def test_reconfigure_service(setup_provider, provider, provisioning, dialog, catalog, request):
    """Tests stack provisioning

    Metadata:
        test_flag: provision
    """
    dialog_name, template_name = dialog
    item_name = fauxfactory.gen_alphanumeric()
    catalog_item = CatalogItem(item_type="Orchestration", name=item_name,
                  description="my catalog", display_in=True, catalog=catalog.name,
                  dialog=dialog_name, orch_template=template_name,
                  provider_type=provider.name)
    catalog_item.create()
    if provider.type == 'ec2':
        stack_data = {
            'stack_name': fauxfactory.gen_alphanumeric(),
            'key_name': provisioning['stack_provisioning']['key_name'],
            'db_user': provisioning['stack_provisioning']['db_user'],
            'db_password': provisioning['stack_provisioning']['db_password'],
            'db_root_password': provisioning['stack_provisioning']['db_root_password'],
            'select_instance_type': provisioning['stack_provisioning']['instance_type'],
        }
    elif provider.type == 'openstack':
        stack_data = {
            'stack_name': fauxfactory.gen_alphanumeric()
        }
    service_catalogs = ServiceCatalogs("service_name", stack_data)
    service_catalogs.order_stack_item(catalog.name, catalog_item)
    flash.assert_no_errors()
    logger.info('Waiting for cfme provision request for service %s' % item_name)
    row_description = item_name
    cells = {'Description': row_description}
    row, __ = wait_for(requests.wait_for_request, [cells, True],
                       fail_func=requests.reload, num_sec=2000, delay=20)
    assert row.last_message.text == 'Service Provisioned Successfully'
    myservice = MyService(catalog_item.name)
    myservice.reconfigure_service()