本文整理汇总了Python中cfme.middleware.datasource.MiddlewareDatasource.datasources方法的典型用法代码示例。如果您正苦于以下问题:Python MiddlewareDatasource.datasources方法的具体用法?Python MiddlewareDatasource.datasources怎么用?Python MiddlewareDatasource.datasources使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.middleware.datasource.MiddlewareDatasource
的用法示例。
在下文中一共展示了MiddlewareDatasource.datasources方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_datasource_from_list
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例2: check_datasource_not_listed
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例3: verify_datasource_listed
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例4: get_random_datasource
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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]
示例5: test_list_server_datasources
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例6: test_list_provider_datasources
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例7: test_list_server_datasources
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例8: test_list_datasources
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例9: test_datasource_details
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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()
示例10: test_list_provider_server_datasources
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例11: test_list_provider_server_datasources
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
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))
示例12: get_random_datasource
# 需要导入模块: from cfme.middleware.datasource import MiddlewareDatasource [as 别名]
# 或者: from cfme.middleware.datasource.MiddlewareDatasource import datasources [as 别名]
def get_random_datasource(provider):
datasources = MiddlewareDatasource.datasources(provider=provider)
assert len(datasources) > 0, "There is no datasource(s) available in UI"
return get_random_list(datasources, 1)[0]