def configure_db_replication(db_address, appliance):
    """Enables the sync role and configures the appliance to replicate to
       the db_address specified. Then, it waits for the UI to show the replication
       as active and the backlog as empty.
    """
    conf.set_replication_worker_host(db_address)
    view = current_appliance.server.browser.create_view(ServerView)
    view.flash.assert_message(
        "Configuration settings saved for CFME Server")  # may be partial
    navigate_to(current_appliance.server, 'Server')
    appliance.server.settings.enable_server_roles('database_synchronization')
    navigate_to(current_appliance.server.zone.region, 'Replication')
    rep_status, _ = wait_for(
        conf.get_replication_status,
        func_kwargs={'navigate': False},
        fail_condition=False,
        num_sec=360,
        delay=10,
        fail_func=current_appliance.server.browser.refresh,
        message="get_replication_status")
    assert rep_status
    wait_for(lambda: conf.get_replication_backlog(navigate=False) == 0,
             fail_condition=False,
             num_sec=120,
             delay=10,
             fail_func=current_appliance.server.browser.refresh,
             message="get_replication_backlog")
Example #2
0
def configure_db_replication(db_address):
    """Enables the sync role and configures the appliance to replicate to
       the db_address specified. Then, it waits for the UI to show the replication
       as active and the backlog as empty.
    """
    conf.set_replication_worker_host(db_address)
    flash.assert_message_contain(
        "Configuration settings saved for CFME Server")
    try:
        sel.force_navigate("cfg_settings_currentserver_server")
    except WebDriverException:
        sel.handle_alert()
        sel.force_navigate("cfg_settings_currentserver_server")
    conf.set_server_roles(database_synchronization=True)
    sel.force_navigate("cfg_diagnostics_region_replication")
    wait_for(lambda: conf.get_replication_status(navigate=False),
             fail_condition=False,
             num_sec=360,
             delay=10,
             fail_func=sel.refresh,
             message="get_replication_status")
    assert conf.get_replication_status()
    wait_for(lambda: conf.get_replication_backlog(navigate=False) == 0,
             fail_condition=False,
             num_sec=120,
             delay=10,
             fail_func=sel.refresh,
             message="get_replication_backlog")
def configure_db_replication(db_address):
    """Enables the sync role and configures the appliance to replicate to
       the db_address specified. Then, it waits for the UI to show the replication
       as active and the backlog as empty.
    """
    conf.set_replication_worker_host(db_address)
    flash.assert_message_contain("Configuration settings saved for CFME Server")
    try:
        sel.force_navigate("cfg_settings_currentserver_server")
    except WebDriverException:
        sel.handle_alert()
        sel.force_navigate("cfg_settings_currentserver_server")
    conf.set_server_roles(database_synchronization=True)
    sel.force_navigate("cfg_diagnostics_region_replication")
    wait_for(
        lambda: conf.get_replication_status(navigate=False),
        fail_condition=False,
        num_sec=360,
        delay=10,
        fail_func=sel.refresh,
        message="get_replication_status",
    )
    assert conf.get_replication_status()
    wait_for(
        lambda: conf.get_replication_backlog(navigate=False) == 0,
        fail_condition=False,
        num_sec=120,
        delay=10,
        fail_func=sel.refresh,
        message="get_replication_backlog",
    )
Example #4
0
def configure_db_replication(db_address):
    """Enables the sync role and configures the appliance to replicate to
       the db_address specified. Then, it waits for the UI to show the replication
       as active and the backlog as empty.
    """
    conf.set_replication_worker_host(db_address)
    flash.assert_message_contain("Configuration settings saved for CFME Server")
    navigate_to(current_appliance.server, 'Server')
    conf.set_server_roles(database_synchronization=True)
    navigate_to(current_appliance.server.zone.region, 'Replication')
    wait_for(lambda: conf.get_replication_status(navigate=False), fail_condition=False,
             num_sec=360, delay=10, fail_func=sel.refresh, message="get_replication_status")
    assert conf.get_replication_status()
    wait_for(lambda: conf.get_replication_backlog(navigate=False) == 0, fail_condition=False,
             num_sec=120, delay=10, fail_func=sel.refresh, message="get_replication_backlog")
def configure_db_replication(db_address):
    """Enables the sync role and configures the appliance to replicate to
       the db_address specified. Then, it waits for the UI to show the replication
       as active and the backlog as empty.
    """
    conf.set_replication_worker_host(db_address)
    flash.assert_message_contain("Configuration settings saved for CFME Server")
    navigate_to(current_appliance.server, 'Server')
    conf.set_server_roles(database_synchronization=True)
    navigate_to(current_appliance.server.zone.region, 'Replication')
    wait_for(lambda: conf.get_replication_status(navigate=False), fail_condition=False,
             num_sec=360, delay=10, fail_func=sel.refresh, message="get_replication_status")
    assert conf.get_replication_status()
    wait_for(lambda: conf.get_replication_backlog(navigate=False) == 0, fail_condition=False,
             num_sec=120, delay=10, fail_func=sel.refresh, message="get_replication_backlog")