Пример #1
0
def test_hawkular_fail(provider):
    """Tests Hawkular server itself reload operation message on UI

    Steps:
        * Chooses Hawkular server.
        * Invokes all 'Power' toolbar operation
        * Checks that notification message is shown
        * Checks that server status is running in UI, in DB and in MGMT.
    """
    server = get_hawkular_server(provider)
    server.reload_server()
    flash.assert_success_message("Not reloading the provider")
    verify_server_running(provider, server)
    server.stop_server()
    flash.assert_success_message("Not stopping the provider")
    verify_server_running(provider, server)
    server.shutdown_server()
    flash.assert_success_message("Not shutting down the provider")
    verify_server_running(provider, server)
    server.restart_server()
    flash.assert_success_message("Not restarting the provider")
    verify_server_running(provider, server)
    server.suspend_server()
    flash.assert_success_message("Not suspending the provider")
    verify_server_running(provider, server)
    server.resume_server()
    flash.assert_success_message("Not resuming the provider")
    verify_server_running(provider, server)
def test_hawkular_fail(provider):
    """Tests Hawkular server itself reload operation message on UI

    Steps:
        * Chooses Hawkular server.
        * Invokes all 'Power' toolbar operation
        * Checks that notification message is shown
        * Checks that server status is running in UI, in DB and in MGMT.
    """
    server = get_hawkular_server(provider)
    server.reload_server()
    flash.assert_success_message('Not reloading the provider')
    verify_server_running(provider, server)
    server.stop_server()
    flash.assert_success_message('Not stopping the provider')
    verify_server_running(provider, server)
    server.shutdown_server()
    flash.assert_success_message('Not shutting down the provider')
    verify_server_running(provider, server)
    server.restart_server()
    flash.assert_success_message('Not restarting the provider')
    verify_server_running(provider, server)
    server.suspend_server()
    flash.assert_success_message('Not suspending the provider')
    verify_server_running(provider, server)
    server.resume_server()
    flash.assert_success_message('Not resuming the provider')
    verify_server_running(provider, server)
def test_list_provider_server_deployments(provider):
    """Tests deployments list from current Provider for each server
    between UI, DB and Management system

    Steps:
        * Get Local server from UI of provider
        * Get deployments list for the server
        * Get deployments list from UI of provider, server
        * Get deployments list from Database of provider, server
        * Get deployments list from Database of provider, server
        * Get deployments list from Management system(Hawkular) of server
        * Compare size of all the list [UI, Database, Management system]
    """
    server = get_hawkular_server(provider)
    ui_deps = get_deployments_set(
        MiddlewareDeployment.deployments(provider=provider, server=server))
    db_deps = get_deployments_set(
        MiddlewareDeployment.deployments_in_db(provider=provider,
                                               server=server))
    mgmt_deps = get_deployments_set(
        MiddlewareDeployment.deployments_in_mgmt(provider=provider,
                                                 server=server))
    assert ui_deps == db_deps == mgmt_deps, \
        ("Lists of deployments mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_deps, db_deps, mgmt_deps))
def test_hawkular_immutability(provider):
    """Tests Hawkular server itself reload operation message on UI

    Steps:
        * Chooses Hawkular server.
        * Checks that server is immutable, i.e. toolbar is hidden.
    """
    server = get_hawkular_server(provider)
    assert server.is_immutable()
Пример #5
0
def test_hawkular_immutability(provider):
    """Tests Hawkular server itself reload operation message on UI

    Steps:
        * Chooses Hawkular server.
        * Checks that server is immutable, i.e. toolbar is hidden.
    """
    server = get_hawkular_server(provider)
    assert server.is_immutable()
def test_list_server_datasources(provider):
    """Gets servers list and tests datasources list for each server
    Steps:
        * Get Hawkular Local server
        * Get datasources list from UI of server
        * Get datasources list from Database of server
        * Compare size of all the list [UI, Database]
    """
    server = get_hawkular_server(provider)
    ui_dses = get_datasources_set(MiddlewareDatasource.datasources(server=server))
    db_dses = get_datasources_set(MiddlewareDatasource.datasources_in_db(server=server))
    assert ui_dses == db_dses, \
        ("Lists of datasources mismatch! UI:{}, DB:{}".format(ui_dses, db_dses))
Пример #7
0
def test_list_server_datasources(provider):
    """Gets servers list and tests datasources list for each server
    Steps:
        * Get Hawkular Local server
        * Get datasources list from UI of server
        * Get datasources list from Database of server
        * Compare size of all the list [UI, Database]
    """
    server = get_hawkular_server(provider)
    ui_dses = get_datasources_set(MiddlewareDatasource.datasources(server=server))
    db_dses = get_datasources_set(MiddlewareDatasource.datasources_in_db(server=server))
    assert ui_dses == db_dses, \
        ("Lists of datasources mismatch! UI:{}, DB:{}".format(ui_dses, db_dses))
def test_list_server_deployments(provider):
    """Tests deployments list for Hawkular Local server

    Steps:
        * Get Hawkular Local server
        * Get deployments list from UI of server
        * Get deployments list from Database of server
        * Compares both lists [UI, Database]
    """
    server = get_hawkular_server(provider)
    ui_deps = get_deployments_set(MiddlewareDeployment.deployments(server=server))
    db_deps = get_deployments_set(MiddlewareDeployment.deployments_in_db(server=server))
    assert ui_deps == db_deps, "Lists of deployments mismatch! UI:{}, DB:{}".format(ui_deps, db_deps)
def test_list_server_messagings(provider):
    """Gets servers list and tests messagings list for each server
    Steps:
        * Get Local server from UI of provider
        * Get messagings list from UI of server
        * Get messagings list from Database of server
        * Compare size of all the list [UI, Database]
    """
    server = get_hawkular_server(provider)
    ui_msges = _get_messagings_set(MiddlewareMessaging.messagings(server=server))
    db_msges = _get_messagings_set(MiddlewareMessaging.messagings_in_db(server=server))
    assert ui_msges == db_msges, \
        ("Lists of messagings mismatch! UI:{}, DB:{}".format(ui_msges, db_msges))
Пример #10
0
def test_hawkular_jdr(provider):
    """Tests Hawkular server's Generate JDR button.

    Steps:
        * Chooses Hawkular server.
        * Clicks on Generate JDR button.
        * Verifies that JDR report is queued.
        * Waits until JDR Report is generated.
    """
    server = get_hawkular_server(provider)
    before_test_date = datetime.utcnow()
    server.generate_jdr()
    jdr_rc = JDRReportCollection(parent=server)
    verify_report_ready(jdr_rc, date_after=before_test_date)
Пример #11
0
def test_list_server_messagings(provider):
    """Gets servers list and tests messagings list for each server
    Steps:
        * Get Local server from UI of provider
        * Get messagings list from UI of server
        * Get messagings list from Database of server
        * Compare size of all the list [UI, Database]
    """
    server = get_hawkular_server(provider)
    ui_msges = _get_messagings_set(
        MiddlewareMessaging.messagings(server=server))
    db_msges = _get_messagings_set(
        MiddlewareMessaging.messagings_in_db(server=server))
    assert ui_msges == db_msges, \
        ("Lists of messagings mismatch! UI:{}, DB:{}".format(ui_msges, db_msges))
def test_list_server_deployments(provider):
    """Tests deployments list for Hawkular Local server

    Steps:
        * Get Hawkular Local server
        * Get deployments list from UI of server
        * Get deployments list from Database of server
        * Compares both lists [UI, Database]
    """
    server = get_hawkular_server(provider)
    ui_deps = get_deployments_set(MiddlewareDeployment.deployments(
        server=server))
    db_deps = get_deployments_set(MiddlewareDeployment.deployments_in_db(
        server=server))
    assert ui_deps == db_deps, \
        ("Lists of deployments mismatch! UI:{}, DB:{}".format(ui_deps, db_deps))
def test_deployment_details(provider):
    """Tests deployment details on UI

    Steps:
        * Get deployments list from DB
        * Select up to `ITEMS_LIMIT` deployments randomly
        * Compare selected deployment details with CFME database and UI
    """
    deps = MiddlewareDeployment.deployments_in_db(provider=provider, server=get_hawkular_server(provider))
    assert len(deps) > 0, "There is no deployment(s) available in DB"
    for dep in get_random_list(deps, ITEMS_LIMIT):
        dep_ui = dep.deployment(method="ui")
        dep_db = dep.deployment(method="db")
        assert dep_ui, "deployment was not found in UI"
        assert dep_db, "deployment was not found in DB"
        assert dep_ui.name == dep_db.name, "deployment name does not match between UI:{}, DB:{}".format(
            dep_ui.name, dep_db.name
        )
        dep_db.validate_properties()
def test_server_details(provider):
    """Tests server details on UI

    Steps:
        * Select Hawkular server details in UI
        * Compare selected server UI details with CFME database and MGMT system
    """
    server = get_hawkular_server(provider)
    srv_ui = server.server(method='ui')
    srv_db = server.server(method='db')
    srv_mgmt = srv_ui.server(method='mgmt')
    assert srv_ui, "Server was not found in UI"
    assert srv_db, "Server was not found in DB"
    assert srv_mgmt, "Server was not found in MGMT system"
    assert srv_ui.name == srv_db.name == srv_mgmt.name, \
        ("server name does not match between UI:{}, DB:{}, MGMT:{}"
         .format(srv_ui.name, srv_db.name, srv_mgmt.name))
    srv_db.validate_properties()
    srv_mgmt.validate_properties()
Пример #15
0
def test_server_details(provider):
    """Tests server details on UI

    Steps:
        * Select Hawkular server details in UI
        * Compare selected server UI details with CFME database and MGMT system
    """
    server = get_hawkular_server(provider)
    srv_ui = server.server(method='ui')
    srv_db = server.server(method='db')
    srv_mgmt = srv_ui.server(method='mgmt')
    assert srv_ui, "Server was not found in UI"
    assert srv_db, "Server was not found in DB"
    assert srv_mgmt, "Server was not found in MGMT system"
    assert srv_ui.name == srv_db.name == srv_mgmt.name, \
        ("server name does not match between UI:{}, DB:{}, MGMT:{}"
         .format(srv_ui.name, srv_db.name, srv_mgmt.name))
    srv_db.validate_properties()
    srv_mgmt.validate_properties()
def test_deployment_details(provider):
    """Tests deployment details on UI

    Steps:
        * Get deployments list from DB
        * Select up to `ITEMS_LIMIT` deployments randomly
        * Compare selected deployment details with CFME database and UI
    """
    deps = MiddlewareDeployment.deployments_in_db(provider=provider,
                                               server=get_hawkular_server(provider))
    assert len(deps) > 0, "There is no deployment(s) available in DB"
    for dep in get_random_list(deps, ITEMS_LIMIT):
        dep_ui = dep.deployment(method='ui')
        dep_db = dep.deployment(method='db')
        assert dep_ui, "deployment was not found in UI"
        assert dep_db, "deployment was not found in DB"
        assert dep_ui.name == dep_db.name, \
            ("deployment name does not match between UI:{}, DB:{}"
             .format(dep_ui.name, dep_db.name))
        dep_db.validate_properties()
def test_list_provider_server_deployments(provider):
    """Tests deployments list from current Provider for each server
    between UI, DB and Management system

    Steps:
        * Get Local server from UI of provider
        * Get deployments list for the server
        * Get deployments list from UI of provider, server
        * Get deployments list from Database of provider, server
        * Get deployments list from Database of provider, server
        * Get deployments list from Management system(Hawkular) of server
        * Compare size of all the list [UI, Database, Management system]
    """
    server = get_hawkular_server(provider)
    ui_deps = get_deployments_set(MiddlewareDeployment.deployments(provider=provider, server=server))
    db_deps = get_deployments_set(MiddlewareDeployment.deployments_in_db(provider=provider, server=server))
    mgmt_deps = get_deployments_set(MiddlewareDeployment.deployments_in_mgmt(provider=provider, server=server))
    assert ui_deps == db_deps == mgmt_deps, "Lists of deployments mismatch! UI:{}, DB:{}, MGMT:{}".format(
        ui_deps, db_deps, mgmt_deps
    )
Пример #18
0
def test_datasource_details(provider):
    """Tests datasource details on UI

    Steps:
        * Get datasources list from UI
        * Select each datasource details in UI
        * Compare selected datasource UI details with CFME database and MGMT system
    """
    server = get_hawkular_server(provider)
    ds_list = MiddlewareDatasource.datasources_in_db(server=server, provider=provider)
    for ds in get_random_list(ds_list, ITEMS_LIMIT):
        ds_ui = ds.datasource(method='ui')
        ds_db = ds.datasource(method='db')
        ds_mgmt = ds_ui.datasource(method='mgmt')
        assert ds_ui, "Datasource was not found in UI"
        assert ds_db, "Datasource was not found in DB"
        assert ds_mgmt, "Datasource was not found in MGMT system"
        assert ds_ui.name == ds_db.name == ds_mgmt.name, \
            ("datasource name does not match between UI:{}, DB:{}, MGMT:{}"
             .format(ds_ui.name, ds_db.name, ds_mgmt.name))
        ds_db.validate_properties()
        ds_mgmt.validate_properties()
def test_datasource_details(provider):
    """Tests datasource details on UI

    Steps:
        * Get datasources list from UI
        * Select each datasource details in UI
        * Compare selected datasource UI details with CFME database and MGMT system
    """
    server = get_hawkular_server(provider)
    ds_list = MiddlewareDatasource.datasources_in_db(server=server, provider=provider)
    for ds in get_random_list(ds_list, ITEMS_LIMIT):
        ds_ui = ds.datasource(method='ui')
        ds_db = ds.datasource(method='db')
        ds_mgmt = ds_ui.datasource(method='mgmt')
        assert ds_ui, "Datasource was not found in UI"
        assert ds_db, "Datasource was not found in DB"
        assert ds_mgmt, "Datasource was not found in MGMT system"
        assert ds_ui.name == ds_db.name == ds_mgmt.name, \
            ("datasource name does not match between UI:{}, DB:{}, MGMT:{}"
             .format(ds_ui.name, ds_db.name, ds_mgmt.name))
        ds_db.validate_properties()
        ds_mgmt.validate_properties()
def test_list_provider_server_messagings(provider):
    """Tests messagings list from current Provider for each server
    between UI, DB and Management system
    Steps:
        * Get Local server from UI of provider
        * Get messagings list for the server
        * Get messagings list from UI of provider, server
        * Get messagings list from Database of provider, server
        * Get messagings list from Database of provider, server
        * Get messagings list from Management system(Hawkular) of server
        * Compare size of all the list [UI, Database, Management system]
    """
    server = get_hawkular_server(provider)
    ui_msges = _get_messagings_set(
        MiddlewareMessaging.messagings(provider=provider, server=server))
    db_msges = _get_messagings_set(
        MiddlewareMessaging.messagings_in_db(provider=provider, server=server))
    mgmt_msges = _get_messagings_set(
        MiddlewareMessaging.messagings_in_mgmt(provider=provider, server=server))
    assert ui_msges == db_msges == mgmt_msges, \
        ("Lists of messagings mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_msges, db_msges, mgmt_msges))
Пример #21
0
def hawkular_server(provider):
    server = get_hawkular_server(provider)
    yield server
def hawkular_server(provider):
    server = get_hawkular_server(provider)
    yield server