示例#1
0
def configure_appliance_for_event_testing(request, listener_info):
    """ This fixture ensures that the appliance is configured for event testing.
    """
    event_testing = request.config.pluginmanager.getplugin("event_testing")
    # If we did not enable the event testing, do not setup
    if event_testing.listener is None:
        return
    return setup_for_event_testing(SSHClient(), cfmedb(), listener_info,
                                   providers.list_infra_providers())
示例#2
0
def configure_appliance_for_event_testing(request, listener_info):
    """ This fixture ensures that the appliance is configured for event testing.
    """
    event_testing = request.config.pluginmanager.getplugin("event_testing")
    # If we did not enable the event testing, do not setup
    if event_testing.listener is None:
        return
    return setup_for_event_testing(
        SSHClient(), cfmedb(), listener_info, providers.list_infra_providers()
    )
示例#3
0
def configure_appliance(browser_setup, provider, vm_to_analyze, listener_info):
    ''' Configure the appliance for smart state analysis '''
    global appliance_vm_name

    # ensure smart proxy role enabled
    logger.info('Enabling smart proxy role...')
    nav_to_roles().edit_defaults_list("smartproxy")

    # add provider
    logger.info('Setting up provider...')
    setup_provider(provider)

    # credential hosts
    logger.info('Credentialing hosts')
    setup_providers_hosts_credentials(provider)

    prov_data = cfme_data['management_systems'][provider]
    if prov_data['type'] == 'rhevm':
        vm_details = nav_to_vm_details(provider, appliance_vm_name)
        vm_details.edit_cfme_relationship_and_save()

    #wait for vm smart state to enable
    logger.info('Waiting for smartstate option to enable...')
    vm_details = nav_to_vm_details(provider, vm_to_analyze)
    wait_for(vm_details.config_button.is_smart_state_analysis_enabled,
             delay=30,
             num_sec=450,
             fail_func=pytest.sel.refresh)

    # Configure for events
    ssh_kwargs = {
        'username': conf.credentials['ssh']['username'],
        'password': conf.credentials['ssh']['password'],
        'hostname': appliance_list[provider]
    }
    # Init SSH client
    client = SSHClient(**ssh_kwargs)
    setup_for_event_testing(client, None, listener_info,
                            providers.list_infra_providers())

    return browser_setup
示例#4
0
def configure_appliance(browser_setup, provider, vm_name, listener_info):
    """ Configure the appliance for smart state analysis """
    global appliance_vm_name

    # ensure smart proxy role enabled
    logger.info("Enabling smart proxy role...")
    nav_to_roles().edit_defaults_list("smartproxy")

    # add provider
    logger.info("Setting up provider...")
    setup_provider(provider)

    # credential hosts
    logger.info("Credentialing hosts")
    setup_providers_hosts_credentials(provider)

    prov_data = cfme_data["management_systems"][provider]
    if prov_data["type"] == "rhevm":
        vm_details = nav_to_vm_details(provider, appliance_vm_name)
        vm_details.edit_cfme_relationship_and_save()

    # wait for vm smart state to enable
    logger.info("Waiting for smartstate option to enable...")
    vm_details = nav_to_vm_details(provider, vm_name)
    wait_for(
        vm_details.config_button.is_smart_state_analysis_enabled, delay=30, num_sec=450, fail_func=pytest.sel.refresh
    )

    # Configure for events
    ssh_kwargs = {
        "username": conf.credentials["ssh"]["username"],
        "password": conf.credentials["ssh"]["password"],
        "hostname": appliance_list[provider],
    }
    # Init SSH client
    client = SSHClient(**ssh_kwargs)
    setup_for_event_testing(client, None, listener_info, providers.list_infra_providers())

    return browser_setup
示例#5
0
def configure_appliance(browser_setup, provider, vm_to_analyze, listener_info):
    ''' Configure the appliance for smart state analysis '''
    global appliance_vm_name

    # ensure smart proxy role enabled
    logger.info('Enabling smart proxy role...')
    nav_to_roles().edit_defaults_list("smartproxy")

    # add provider
    logger.info('Setting up provider...')
    setup_provider(provider)

    # credential hosts
    logger.info('Credentialing hosts')
    setup_providers_hosts_credentials(provider)

    prov_data = cfme_data['management_systems'][provider]
    if prov_data['type'] == 'rhevm':
        vm_details = nav_to_vm_details(provider, appliance_vm_name)
        vm_details.edit_cfme_relationship_and_save()

    #wait for vm smart state to enable
    logger.info('Waiting for smartstate option to enable...')
    vm_details = nav_to_vm_details(provider, vm_to_analyze)
    wait_for(vm_details.config_button.is_smart_state_analysis_enabled, delay=30,
        num_sec=450, fail_func=pytest.sel.refresh)

    # Configure for events
    ssh_kwargs = {
        'username': conf.credentials['ssh']['username'],
        'password': conf.credentials['ssh']['password'],
        'hostname': appliance_list[provider]
    }
    # Init SSH client
    client = SSHClient(**ssh_kwargs)
    setup_for_event_testing(client, None, listener_info, providers.list_infra_providers())

    return browser_setup
示例#6
0
def configure_appliance_for_event_testing(listener_info):
    """ This fixture ensures that the appliance is configured for event testing.
    """
    return setup_for_event_testing(
        SSHClient(), db_session_maker(), listener_info, providers.list_infra_providers()
    )