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))
Exemple #2
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))
def get_random_server_group(provider, load_from="db"):
    load_from = load_from.lower()
    if load_from == "ui":
        server_groups = MiddlewareServerGroup.server_groups(get_random_domain(provider, load_from))
    elif load_from == "db":
        server_groups = MiddlewareServerGroup.server_groups_in_db(
            get_random_domain(provider, load_from))
    elif load_from == "mgmt":
        server_groups = MiddlewareServerGroup.server_groups_in_mgmt(
            get_random_domain(provider, load_from))
    else:
        raise RuntimeError("Not supported option: '{}'".format(load_from))
    assert len(server_groups) > 0, "There is no server group(s) available in {}".format(load_from)
    return get_random_list(server_groups, 1)[0]
def get_random_server_group(provider, load_from="db"):
    load_from = load_from.lower()
    if load_from == "ui":
        server_groups = MiddlewareServerGroup.server_groups(get_random_domain(provider, load_from))
    elif load_from == "db":
        server_groups = MiddlewareServerGroup.server_groups_in_db(
            get_random_domain(provider, load_from))
    elif load_from == "mgmt":
        server_groups = MiddlewareServerGroup.server_groups_in_mgmt(
            get_random_domain(provider, load_from))
    else:
        raise RuntimeError("Not supported option: '{}'".format(load_from))
    assert len(server_groups) > 0, "There is no server group(s) available in {}".format(load_from)
    return get_random_list(server_groups, 1)[0]
Exemple #5
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()
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()
Exemple #7
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_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)
Exemple #9
0
 def server_group(self):
     self.load_details()
     return MiddlewareServerGroup(
         provider=self.provider,
         name=self.get_detail("Properties", "Name"),
         domain=MiddlewareDomain(provider=self.provider,
                                 name=self.get_detail(
                                     "Relationships", "Middleware Domain")))
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()
Exemple #11
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()
def test_list_server_group_servers(provider):
    """Tests servers lists from server groups of domain and checks values
    between UI, DB and Management system

    Steps:
        * Get domains list from UI of provider
        * Chooses one of domains
        * Get server groups list from UI of domain
        * Get servers list from UI of each server group
        * Get servers list from Database of each server group
        * @TODO add support of checking in MGMT
        * Compare content of all the list [UI, Database]
    """
    domain_list = MiddlewareDomain.domains(provider=provider)
    for domain in get_random_list(domain_list, 1):
        server_groups = MiddlewareServerGroup.server_groups(domain=domain)
        for server_group in server_groups:
            ui_servers = get_servers_set(MiddlewareServer.servers(server_group=server_group))
            db_servers = get_servers_set(MiddlewareServer.servers_in_db(server_group=server_group))
            assert ui_servers == db_servers, "Lists of servers mismatch! UI:{}, DB:{}".format(ui_servers, db_servers)
def test_list_server_group_servers(provider):
    """Tests servers lists from server groups of domain and checks values
    between UI, DB and Management system

    Steps:
        * Get domains list from UI of provider
        * Chooses one of domains
        * Get server groups list from UI of domain
        * Get servers list from UI of each server group
        * Get servers list from Database of each server group
        * @TODO add support of checking in MGMT
        * Compare content of all the list [UI, Database]
    """
    domain_list = MiddlewareDomain.domains(provider=provider)
    for domain in get_random_list(domain_list, 1):
        server_groups = MiddlewareServerGroup.server_groups(domain=domain)
        for server_group in server_groups:
            ui_servers = get_servers_set(MiddlewareServer.servers(server_group=server_group))
            db_servers = get_servers_set(MiddlewareServer.servers_in_db(server_group=server_group))
            assert ui_servers == db_servers, \
                ("Lists of servers mismatch! UI:{}, DB:{}"
                 .format(ui_servers, db_servers))
def get_random_server_group(provider):
    server_groups = MiddlewareServerGroup.server_groups(get_random_domain(provider))
    assert len(server_groups) > 0, "There is no server_groups(s) available in UI"
    return get_random_list(server_groups, 1)[0]
Exemple #15
0
def get_random_server_group(provider):
    server_groups = MiddlewareServerGroup.server_groups_in_db(get_random_domain(provider),
                                                              strict=False)
    assert len(server_groups) > 0, "There is no server_groups(s) available in DB"
    return get_random_list(server_groups, 1)[0]
def domain_server_groups(provider, domain):
    return MiddlewareServerGroup.server_groups_in_db(domain=domain)