示例#1
0
def configure_ldap_auth_mode():
    '''Configure authentication mode'''
    server_data = cfme_data['ldap_server']
    auth_pg = cnf_configuration_pg().click_on_settings()\
        .click_on_current_server_tree_node()\
        .click_on_authentication_tab()
    if auth_pg.current_auth_mode != server_data['mode']:
        auth_pg.ldap_server_fill_data(**server_data)
        if server_data['get_groups'] and server_data['mode'] != "database":
            auth_pg.validate()
            Assert.contains("LDAP Settings validation was successful",
                            auth_pg.flash.message,
                            "Validate flash message did not match")
        auth_pg = auth_pg.save()
        Assert.contains("Authentication settings saved",
                        auth_pg.flash.message,
                        "Auth page save flash message did not match")

    yield

    auth_pg = cnf_configuration_pg().click_on_settings()\
        .click_on_current_server_tree_node()\
        .click_on_authentication_tab()
    auth_pg.current_auth_mode = 'database'
    auth_pg.save()
示例#2
0
def nav_to_roles():
    """ Helper nav function to get to server settings """
    # Nav to the settings tab
    settings_pg = nav.cnf_configuration_pg().click_on_settings()
    # Workaround to rudely bypass a popup that sometimes appears for
    # unknown reasons.
    # See also: https://github.com/RedHatQE/cfme_tests/issues/168
    from pages.configuration_subpages.settings_subpages.server_settings import ServerSettings
    server_settings_pg = ServerSettings(settings_pg.testsetup)
    # sst is a configuration_subpages.settings_subpages.server_settings_subpages.
    #   server_settings_tab.ServerSettingsTab
    return server_settings_pg.click_on_server_tab()