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 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 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))
Exemple #4
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))
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))
Exemple #6
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))