def test_topology_details(provider):
    """Tests items details in topology page from provider page

    Steps:
        * Get topology elements detail
        * Check details of `Servers`, `Domains`, `Messagings`,
        * `Datasources`, `Server Groups`, `Deployments` on topology page
    """

    # reload topology page to make sure all elements are loaded
    provider.topology.reload()
    provider.topology.refresh()

    verify_elements_match(MiddlewareServer.servers_in_db(),
                          provider.topology.elements(element_type='MiddlewareServer'))

    verify_elements_match(MiddlewareMessaging.messagings_in_db(),
                          provider.topology.elements(element_type='MiddlewareMessaging'))

    verify_elements_match(MiddlewareDatasource.datasources_in_db(),
                          provider.topology.elements(element_type='MiddlewareDatasource'))

    verify_elements_match(MiddlewareDomain.domains_in_db(),
                          provider.topology.elements(element_type='MiddlewareDomain'))

    server_groups = []
    for domain in MiddlewareDomain.domains_in_db():
        server_groups.extend(MiddlewareServerGroup.server_groups_in_db(domain))
    verify_elements_match(server_groups,
                          provider.topology.elements(element_type='MiddlewareServerGroup'))

    deployments = provider.topology.elements(element_type='MiddlewareDeployment')
    deployments.extend(provider.topology.elements(element_type='MiddlewareDeploymentWar'))
    deployments.extend(provider.topology.elements(element_type='MiddlewareDeploymentEar'))
    verify_elements_match(MiddlewareDeployment.deployments_in_db(), deployments)
Ejemplo n.º 2
0
def test_topology_details(provider):
    """Tests items details in topology page from provider page

    Steps:
        * Get topology elements detail
        * Check details of `Servers`, `Domains`, `Messagings`,
        * `Datasources`, `Server Groups`, `Deployments` on topology page
    """

    # reload topology page to make sure all elements are loaded
    provider.topology.reload()
    provider.topology.refresh()

    verify_elements_match(MiddlewareServer.servers_in_db(),
                          provider.topology.elements(element_type='MiddlewareServer'))

    verify_elements_match(MiddlewareMessaging.messagings_in_db(),
                          provider.topology.elements(element_type='MiddlewareMessaging'))

    verify_elements_match(MiddlewareDatasource.datasources_in_db(),
                          provider.topology.elements(element_type='MiddlewareDatasource'))

    verify_elements_match(MiddlewareDomain.domains_in_db(),
                          provider.topology.elements(element_type='MiddlewareDomain'))

    server_groups = []
    for domain in MiddlewareDomain.domains_in_db():
        server_groups.extend(MiddlewareServerGroup.server_groups_in_db(domain))
    verify_elements_match(server_groups,
                          provider.topology.elements(element_type='MiddlewareServerGroup'))

    deployments = provider.topology.elements(element_type='MiddlewareDeployment')
    deployments.extend(provider.topology.elements(element_type='MiddlewareDeploymentWar'))
    deployments.extend(provider.topology.elements(element_type='MiddlewareDeploymentEar'))
    verify_elements_match(MiddlewareDeployment.deployments_in_db(), deployments)
def test_server_group_details(provider):
    """Tests server group details on UI

    Steps:
        * Get domains list from DB
        * Chooses one of domains
        * Get server groups list from DB
        * Chooses several server groups from list
        * Select each server group's details in UI, DB and MGMT
        * Compare selected server group UI details with CFME database and MGMT system
    """
    domain_list = MiddlewareDomain.domains_in_db(provider=provider, strict=False)
    for domain in get_random_list(domain_list, ITEMS_LIMIT):
        server_group_list = MiddlewareServerGroup.server_groups_in_db(domain=domain, strict=False)
        for server_group in get_random_list(server_group_list, 1):
            svgr_ui = server_group.server_group(method='ui')
            svgr_db = server_group.server_group(method='db')
            svgr_mgmt = server_group.server_group(method='mgmt')
            assert svgr_ui, "Server Group was not found in UI"
            assert svgr_db, "Server Group was not found in DB"
            assert svgr_mgmt, "Server Group was not found in MGMT system"
            assert svgr_ui.name == svgr_db.name == svgr_mgmt.name, \
                ("Server Group name does not match between UI:{}, DB:{}, MGMT:{}"
                 .format(svgr_ui.name, svgr_db.name, svgr_mgmt.name))
            svgr_db.validate_properties()
            svgr_mgmt.validate_properties()
def test_list_provider_server_groups(provider):
    """Tests server groups lists from current Provider between UI, DB and Management system

    Steps:
        * Get domains list from DB
        * Chooses one of domains
        * Get server groups list from UI of domain
        * Get server groups list from Database of domain
        * Get server groups list from Management system(Hawkular)
        * Get headers from UI
        * Compare headers from UI with expected headers list
        * Compare content of all the list [UI, Database, Management system]
    """
    domain_list = MiddlewareDomain.domains_in_db(provider=provider)
    for domain in get_random_list(domain_list, 1):
        ui_server_groups = get_server_group_set(
            MiddlewareServerGroup.server_groups(domain=domain))
        db_server_groups = get_server_group_set(
            MiddlewareServerGroup.server_groups_in_db(domain=domain))
        mgmt_server_groups = get_server_group_set(
            MiddlewareServerGroup.server_groups_in_mgmt(domain=domain))
        headers = MiddlewareServerGroup.headers(domain)
        headers_expected = ['Server Group Name', 'Feed', 'Domain Name', 'Profile']
        assert headers == headers_expected
        assert ui_server_groups == db_server_groups == mgmt_server_groups, \
            ("Lists of server groups mismatch! UI:{}, DB:{}, MGMT:{}"
             .format(ui_server_groups, db_server_groups, mgmt_server_groups))
Ejemplo n.º 5
0
def test_list_provider_server_groups(provider):
    """Tests server groups lists from current Provider between UI, DB and Management system

    Steps:
        * Get domains list from DB
        * Chooses one of domains
        * Get server groups list from UI of domain
        * Get server groups list from Database of domain
        * Get server groups list from Management system(Hawkular)
        * Get headers from UI
        * Compare headers from UI with expected headers list
        * Compare content of all the list [UI, Database, Management system]
    """
    domain_list = MiddlewareDomain.domains_in_db(provider=provider)
    for domain in get_random_list(domain_list, 1):
        ui_server_groups = get_server_group_set(
            MiddlewareServerGroup.server_groups(domain=domain))
        db_server_groups = get_server_group_set(
            MiddlewareServerGroup.server_groups_in_db(domain=domain))
        mgmt_server_groups = get_server_group_set(
            MiddlewareServerGroup.server_groups_in_mgmt(domain=domain))
        headers = MiddlewareServerGroup.headers(domain)
        headers_expected = [
            'Server Group Name', 'Feed', 'Domain Name', 'Profile'
        ]
        assert headers == headers_expected
        assert ui_server_groups == db_server_groups == mgmt_server_groups, \
            ("Lists of server groups mismatch! UI:{}, DB:{}, MGMT:{}"
             .format(ui_server_groups, db_server_groups, mgmt_server_groups))
Ejemplo n.º 6
0
def test_server_group_details(provider):
    """Tests server group details on UI

    Steps:
        * Get domains list from DB
        * Chooses one of domains
        * Get server groups list from DB
        * Chooses several server groups from list
        * Select each server group's details in UI, DB and MGMT
        * Compare selected server group UI details with CFME database and MGMT system
    """
    domain_list = MiddlewareDomain.domains_in_db(provider=provider,
                                                 strict=False)
    for domain in get_random_list(domain_list, ITEMS_LIMIT):
        server_group_list = MiddlewareServerGroup.server_groups_in_db(
            domain=domain, strict=False)
        for server_group in get_random_list(server_group_list, 1):
            svgr_ui = server_group.server_group(method='ui')
            svgr_db = server_group.server_group(method='db')
            svgr_mgmt = server_group.server_group(method='mgmt')
            assert svgr_ui, "Server Group was not found in UI"
            assert svgr_db, "Server Group was not found in DB"
            assert svgr_mgmt, "Server Group was not found in MGMT system"
            assert svgr_ui.name == svgr_db.name == svgr_mgmt.name, \
                ("Server Group name does not match between UI:{}, DB:{}, MGMT:{}"
                 .format(svgr_ui.name, svgr_db.name, svgr_mgmt.name))
            svgr_db.validate_properties()
            svgr_mgmt.validate_properties()
Ejemplo n.º 7
0
def domain(provider):
    domain_list = MiddlewareDomain.domains_in_db(provider=provider, strict=False)
    assert domain_list, "Domain was not found in DB"
    domain = domain_list[0]
    yield domain
    # make sure domain is started after test execution
    domain.start_domain()
Ejemplo n.º 8
0
def domain(provider):
    domain_list = MiddlewareDomain.domains_in_db(provider=provider, strict=False)
    assert domain_list, "Domain was not found in DB"
    domain = domain_list[0]
    yield domain
    # make sure domain is started after test execution
    domain.start_domain()
Ejemplo n.º 9
0
def get_random_domain(provider, load_from="db"):
    load_from = load_from.lower()
    if load_from == "ui":
        domains = MiddlewareDomain.domains(provider=provider)
    elif load_from == "db":
        domains = MiddlewareDomain.domains_in_db(provider=provider)
    elif load_from == "mgmt":
        domains = MiddlewareDomain.domains_in_mgmt(provider=provider)
    else:
        raise RuntimeError("Not supported option: '{}'".format(load_from))
    assert len(domains) > 0, "There is no domain(s) available in {}".format(load_from)
    return get_random_list(domains, 1)[0]
Ejemplo n.º 10
0
def get_random_domain(provider, load_from="db"):
    load_from = load_from.lower()
    if load_from == "ui":
        domains = MiddlewareDomain.domains(provider=provider)
    elif load_from == "db":
        domains = MiddlewareDomain.domains_in_db(provider=provider)
    elif load_from == "mgmt":
        domains = MiddlewareDomain.domains_in_mgmt(provider=provider)
    else:
        raise RuntimeError("Not supported option: '{}'".format(load_from))
    assert len(domains) > 0, "There is no domain(s) available in {}".format(load_from)
    return get_random_list(domains, 1)[0]
def main_server_group(provider):
    domain_list = MiddlewareDomain.domains_in_db(provider=provider, strict=False)
    assert domain_list, "Domain was not found in DB"
    domain = domain_list[0]
    server_group_list = MiddlewareServerGroup.server_groups_in_db(
        domain=domain, name="main-server-group", strict=False)
    assert server_group_list, "Server group was not found in DB"
    server_group = server_group_list[0]
    yield server_group
    # make sure server is resumed just in case, if after test server group is suspended
    server_group.resume_server_group()
    # resume does not start stopped server group
    # make sure server is started after test execution
    server_group.start_server_group()
Ejemplo n.º 12
0
def test_list_provider_domains(provider):
    """Tests domains lists from current Provider between UI, DB and Management system

    Steps:
        * Get domains list from UI of provider
        * Get domains list from Database of provider
        * Get domains list from Management system(Hawkular)
        * Compare content of all the list [UI, Database, Management system]
    """
    ui_domains = get_domains_set(MiddlewareDomain.domains(provider=provider))
    db_domains = get_domains_set(MiddlewareDomain.domains_in_db(provider=provider))
    mgmt_domains = get_domains_set(MiddlewareDomain.domains_in_mgmt(provider=provider))
    assert ui_domains == db_domains == mgmt_domains, \
        ("Lists of domains mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_domains, db_domains, mgmt_domains))
Ejemplo n.º 13
0
def main_server_group(provider):
    domain_list = MiddlewareDomain.domains_in_db(provider=provider,
                                                 strict=False)
    assert domain_list, "Domain was not found in DB"
    domain = domain_list[0]
    server_group_list = MiddlewareServerGroup.server_groups_in_db(
        domain=domain, name="main-server-group", strict=False)
    assert server_group_list, "Server group was not found in DB"
    server_group = server_group_list[0]
    yield server_group
    # make sure server is resumed just in case, if after test server group is suspended
    server_group.resume_server_group()
    # resume does not start stopped server group
    # make sure server is started after test execution
    server_group.start_server_group()
Ejemplo n.º 14
0
def test_list_provider_domains(provider):
    """Tests domains lists from current Provider between UI, DB and Management system

    Steps:
        * Get domains list from UI of provider
        * Get domains list from Database of provider
        * Get domains list from Management system(Hawkular)
        * Compare content of all the list [UI, Database, Management system]
    """
    ui_domains = get_domains_set(MiddlewareDomain.domains(provider=provider))
    db_domains = get_domains_set(MiddlewareDomain.domains_in_db(provider=provider))
    mgmt_domains = get_domains_set(MiddlewareDomain.domains_in_mgmt(provider=provider))
    assert ui_domains == db_domains == mgmt_domains, \
        ("Lists of domains mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_domains, db_domains, mgmt_domains))
Ejemplo n.º 15
0
def test_list_domains():
    """Tests domains lists between UI, DB and Management system.

    Steps:
        * Get domains list from UI
        * Get domains list from Database
        * Get headers from UI
        * Compare headers from UI with expected headers list
        * Compare content of all the list [UI, Database, Management system]
    """
    ui_domains = get_domains_set(MiddlewareDomain.domains())
    db_domains = get_domains_set(MiddlewareDomain.domains_in_db())
    mgmt_domains = get_domains_set(MiddlewareDomain.domains_in_mgmt())
    headers = MiddlewareDomain.headers()
    headers_expected = ['Domain Name', 'Feed', 'Provider']
    assert headers == headers_expected
    assert ui_domains == db_domains == mgmt_domains, \
        ("Lists of domains mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_domains, db_domains, mgmt_domains))
Ejemplo n.º 16
0
def test_list_domains():
    """Tests domains lists between UI, DB and Management system.

    Steps:
        * Get domains list from UI
        * Get domains list from Database
        * Get headers from UI
        * Compare headers from UI with expected headers list
        * Compare content of all the list [UI, Database, Management system]
    """
    ui_domains = get_domains_set(MiddlewareDomain.domains())
    db_domains = get_domains_set(MiddlewareDomain.domains_in_db())
    mgmt_domains = get_domains_set(MiddlewareDomain.domains_in_mgmt())
    headers = MiddlewareDomain.headers()
    headers_expected = ['Domain Name', 'Feed', 'Provider']
    assert headers == headers_expected
    assert ui_domains == db_domains == mgmt_domains, \
        ("Lists of domains mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_domains, db_domains, mgmt_domains))
Ejemplo n.º 17
0
def test_domain_details(provider):
    """Tests domain details on UI

    Steps:
        * Get domains list from DB
        * Select each domain details in UI
        * Compare selected domain UI details with CFME database and MGMT system
    """
    domain_list = MiddlewareDomain.domains_in_db(provider=provider)
    for domain in get_random_list(domain_list, 1):
        dmn_ui = domain.domain(method='ui')
        dmn_db = domain.domain(method='db')
        dmn_mgmt = domain.domain(method='mgmt')
        assert dmn_ui, "Domain was not found in UI"
        assert dmn_db, "Domain was not found in DB"
        assert dmn_mgmt, "Domain was not found in MGMT system"
        assert dmn_ui.name == dmn_db.name == dmn_mgmt.name, \
            ("domain name does not match between UI:{}, DB:{}, MGMT:{}"
             .format(dmn_ui.name, dmn_db.name, dmn_mgmt.name))
        dmn_db.validate_properties()
        dmn_mgmt.validate_properties()
Ejemplo n.º 18
0
def test_domain_details(provider):
    """Tests domain details on UI

    Steps:
        * Get domains list from DB
        * Select each domain details in UI
        * Compare selected domain UI details with CFME database and MGMT system
    """
    domain_list = MiddlewareDomain.domains_in_db(provider=provider)
    for domain in get_random_list(domain_list, 1):
        dmn_ui = domain.domain(method='ui')
        dmn_db = domain.domain(method='db')
        dmn_mgmt = domain.domain(method='mgmt')
        assert dmn_ui, "Domain was not found in UI"
        assert dmn_db, "Domain was not found in DB"
        assert dmn_mgmt, "Domain was not found in MGMT system"
        assert dmn_ui.name == dmn_db.name == dmn_mgmt.name, \
            ("domain name does not match between UI:{}, DB:{}, MGMT:{}"
             .format(dmn_ui.name, dmn_db.name, dmn_mgmt.name))
        dmn_db.validate_properties()
        dmn_mgmt.validate_properties()
Ejemplo n.º 19
0
def get_random_domain(provider):
    domains = MiddlewareDomain.domains_in_db(provider=provider, strict=False)
    assert len(domains) > 0, "There is no domains(s) available in DB"
    return get_random_list(domains, 1)[0]