当前位置: 首页>>代码示例>>Python>>正文


Python datasource.MiddlewareDatasource类代码示例

本文整理汇总了Python中cfme.middleware.datasource.MiddlewareDatasource的典型用法代码示例。如果您正苦于以下问题:Python MiddlewareDatasource类的具体用法?Python MiddlewareDatasource怎么用?Python MiddlewareDatasource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MiddlewareDatasource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_random_datasource

def get_random_datasource(provider, load_from="db"):
    load_from = load_from.lower()
    if load_from == "ui":
        datasources = MiddlewareDatasource.datasources(provider=provider)
    elif load_from == "db":
        datasources = MiddlewareDatasource.datasources_in_db(provider=provider)
    elif load_from == "mgmt":
        datasources = MiddlewareDatasource.datasources_in_mgmt(provider=provider)
    else:
        raise RuntimeError("Not supported option: '{}'".format(load_from))
    assert len(datasources) > 0, "There is no datasource(s) available in {}".format(load_from)
    return get_random_list(datasources, 1)[0]
开发者ID:ManageIQ,项目名称:integration_tests,代码行数:12,代码来源:random_methods.py

示例2: test_list_server_datasources

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_server(provider, HAWKULAR_PRODUCT_NAME)
    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))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:13,代码来源:test_middleware_datasource.py

示例3: test_list_server_datasources

def test_list_server_datasources():
    """Gets servers list and tests datasources list for each server
    Steps:
        * Get servers list from UI
        * Get datasources list from UI of server
        * Get datasources list from Database of server
        * Compare size of all the list [UI, Database]
    """
    servers = MiddlewareServer.servers()
    assert len(servers) > 0, "There is no server(s) available in UI"
    for server in get_random_list(servers, ITEMS_LIMIT):
        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))
开发者ID:FilipB,项目名称:cfme_tests,代码行数:15,代码来源:test_middleware_datasource.py

示例4: test_list_provider_datasources

def test_list_provider_datasources(provider):
    """Tests datasources list from current Provider between UI, DB and Management system

    Steps:
        * Get datasources list from UI of provider
        * Get datasources list from Database of provider
        * Get datasources list from Management system(Hawkular)
        * Compare size of all the list [UI, Database, Management system]
    """
    ui_dses = get_datasources_set(MiddlewareDatasource.datasources(provider=provider))
    db_dses = get_datasources_set(MiddlewareDatasource.datasources_in_db(provider=provider))
    mgmt_dses = get_datasources_set(MiddlewareDatasource.datasources_in_mgmt(provider=provider))
    assert ui_dses == db_dses == mgmt_dses, \
        ("Lists of datasources mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_dses, db_dses, mgmt_dses))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:15,代码来源:test_middleware_datasource.py

示例5: test_topology_details

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)
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:35,代码来源:test_middleware_topology.py

示例6: test_list_datasources

def test_list_datasources():
    """Tests datasources list between UI, DB and Management system
    This test requires that no any other provider should exist before.

    Steps:
        * Get datasources list from UI
        * Get datasources list from Database
        * Get datasources list from Management system(Hawkular)
        * Compare size of all the list [UI, Database, Management system]
    """
    ui_dses = get_datasources_set(MiddlewareDatasource.datasources())
    db_dses = get_datasources_set(MiddlewareDatasource.datasources_in_db())
    mgmt_dses = get_datasources_set(MiddlewareDatasource.datasources_in_mgmt())
    assert ui_dses == db_dses == mgmt_dses, \
        ("Lists of datasources mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_dses, db_dses, mgmt_dses))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:16,代码来源:test_middleware_datasource.py

示例7: get_datasource_from_list

def get_datasource_from_list(provider, name, server=None):
    check_datasource_listed(provider, name, server)
    for datasource in MiddlewareDatasource.datasources(provider=provider, server=server):
        if datasource.name == name:
            return datasource
    raise ValueError('Recently created datasource {} was not found in datasource list'
                     .format(name))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:7,代码来源:datasource_methods.py

示例8: check_datasource_not_listed

def check_datasource_not_listed(provider, name, server=None):
    provider.refresh_provider_relationships(method='rest')
    wait_for(lambda: name not in
        get_datasources_name(
            MiddlewareDatasource.datasources(provider=provider, server=server)),
        delay=30, num_sec=1200,
        message='Datasource {} must not be found'
        .format(name))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:8,代码来源:datasource_methods.py

示例9: verify_datasource_listed

def verify_datasource_listed(provider, name, server=None):
    refresh(provider)
    wait_for(lambda: name in
        get_datasources_name(
            MiddlewareDatasource.datasources(provider=provider, server=server)),
        delay=30, num_sec=1200,
        message='Datasource {} must be found'
        .format(name),
        fail_func=lambda: refresh(provider))
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:9,代码来源:datasource_methods.py

示例10: test_datasource_tags

def test_datasource_tags(provider):
    """Tests tags in datasources page

    Steps:
        * Select a datasource randomly from database
        * Run `_validate_tags` with `tags` input
    """
    ds_db = MiddlewareDatasource.datasources_in_db(provider=provider)
    assert len(ds_db) > 0, "There is no datasource(s) available in UI"
    datasource = get_random_list(ds_db, 1)[0]
    validate_tags(taggable=datasource, tags=tags)
开发者ID:FilipB,项目名称:cfme_tests,代码行数:11,代码来源:test_middleware_tags.py

示例11: test_list_provider_server_datasources

def test_list_provider_server_datasources(provider):
    """Tests datasources list from current Provider for each server
    between UI, DB and Management system
    Steps:
        * Get Hawkular Local server
        * Get datasources list for the server
        * Get datasources list from UI of provider, server
        * Get datasources list from Database of provider, server
        * Get datasources list from Database of provider, server
        * Get datasources list from Management system(Hawkular) of server
        * Compare size of all the list [UI, Database, Management system]
    """
    server = get_server(provider, HAWKULAR_PRODUCT_NAME)
    ui_dses = get_datasources_set(
        MiddlewareDatasource.datasources(provider=provider, server=server))
    db_dses = get_datasources_set(
        MiddlewareDatasource.datasources_in_db(provider=provider, server=server))
    mgmt_dses = get_datasources_set(
        MiddlewareDatasource.datasources_in_mgmt(provider=provider, server=server))
    assert ui_dses == db_dses == mgmt_dses, \
        ("Lists of datasources mismatch! UI:{}, DB:{}, MGMT:{}"
         .format(ui_dses, db_dses, mgmt_dses))
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:22,代码来源:test_middleware_datasource.py

示例12: test_list_provider_server_datasources

def test_list_provider_server_datasources(provider):
    """Tests datasources list from current Provider for each server
    between UI, DB and Management system
    Steps:
        * Get servers list from UI of provider
        * Get datasources list for the server
        * Get datasources list from UI of provider, server
        * Get datasources list from Database of provider, server
        * Get datasources list from Database of provider, server
        * Get datasources list from Management system(Hawkular) of server
        * Compare size of all the list [UI, Database, Management system]
    """
    servers = MiddlewareServer.servers(provider=provider)
    assert len(servers) > 0, "There is no server(s) available in UI"
    for server in get_random_list(servers, ITEMS_LIMIT):
        ui_dses = _get_datasources_set(
            MiddlewareDatasource.datasources(provider=provider, server=server))
        db_dses = _get_datasources_set(
            MiddlewareDatasource.datasources_in_db(provider=provider, server=server))
        mgmt_dses = _get_datasources_set(
            MiddlewareDatasource.datasources_in_mgmt(provider=provider, server=server))
        assert ui_dses == db_dses == mgmt_dses, \
            ("Lists of datasources mismatch! UI:{}, DB:{}, MGMT:{}"
             .format(ui_dses, db_dses, mgmt_dses))
开发者ID:FilipB,项目名称:cfme_tests,代码行数:24,代码来源:test_middleware_datasource.py

示例13: test_topology_server_hierarchy

def test_topology_server_hierarchy(provider):
    """Tests all server's hierarchical content in topology

    Steps:
        * Read Servers in topology.
        * For each server read elements in topology.
        * Compare elements from topology with server's elements from DB.
    """

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

    for ui_server in provider.topology.elements(element_type='MiddlewareServer'):
        elements = []
        server = MiddlewareServer.servers_in_db(name=ui_server.name)[0]
        elements.extend(MiddlewareDeployment.deployments_in_db(server, provider, strict=False))
        elements.extend(MiddlewareDatasource.datasources_in_db(server, provider, strict=False))
        elements.extend(MiddlewareMessaging.messagings_in_db(server, provider, strict=False))
        verify_elements_included(elements, ui_server.children)
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:20,代码来源:test_middleware_topology.py

示例14: test_datasource_details

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
    """
    ds_list = MiddlewareDatasource.datasources(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()
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:21,代码来源:test_middleware_datasource.py

示例15: delete_datasource_from_list

def delete_datasource_from_list(provider, name):
    ds = get_datasource_from_list(provider, name)
    MiddlewareDatasource.remove_from_list(ds)
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:3,代码来源:datasource_methods.py


注:本文中的cfme.middleware.datasource.MiddlewareDatasource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。