本文整理汇总了Python中fuelclient.objects.environment.Environment.get_testsets方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.get_testsets方法的具体用法?Python Environment.get_testsets怎么用?Python Environment.get_testsets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fuelclient.objects.environment.Environment
的用法示例。
在下文中一共展示了Environment.get_testsets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check
# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import get_testsets [as 别名]
def check(self, params):
"""To run some health checks:
fuel --env 1 health --check smoke,sanity
"""
env = Environment(params.env)
if env.status not in self._allowed_statuses and not params.force:
exit_with_error(
"Environment is not ready to run health check "
"because it is in {0} state. "
"Health check is likely to fail because of "
"this. Use --force flag to proceed anyway.". format(env.status)
)
if env.is_customized and not params.force:
exit_with_error(
"Environment deployment facts were updated. "
"Health check is likely to fail because of "
"that. Use --force flag to proceed anyway."
)
test_sets_to_check = params.check or set(
ts["id"] for ts in env.get_testsets())
env.run_test_sets(test_sets_to_check)
tests_state = env.get_state_of_tests()
self.serializer.print_to_output(
tests_state,
env,
print_method=print_health_check
)
示例2: list
# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import get_testsets [as 别名]
def list(self, params):
"""To list all health check test sets:
fuel --env 1 health
or:
fuel --env 1 health --list
"""
env = Environment(params.env)
test_sets = env.get_testsets()
self.serializer.print_to_output(test_sets, format_table(test_sets))
示例3: check
# 需要导入模块: from fuelclient.objects.environment import Environment [as 别名]
# 或者: from fuelclient.objects.environment.Environment import get_testsets [as 别名]
def check(self, params):
"""To run some health checks:
fuel --env 1 health --check smoke,sanity
"""
env = Environment(params.env)
if env.status not in self._allowed_statuses and not params.force:
raise EnvironmentException(
"Environment is not ready to run health check "
"because it is in {0} state. "
"Health check is likely to fail because of "
"this. Use --force flag to proceed anyway.". format(env.status)
)
if env.is_customized and not params.force:
raise EnvironmentException(
"Environment deployment facts were updated. "
"Health check is likely to fail because of "
"that. Use --force flag to proceed anyway."
)
test_sets_to_check = params.check or set(
ts["id"] for ts in env.get_testsets())
ostf_credentials = {}
if params.ostf_tenant_name is not None:
ostf_credentials['tenant'] = params.ostf_tenant_name
if params.ostf_username is not None:
ostf_credentials['username'] = params.ostf_username
if params.ostf_password is not None:
ostf_credentials['password'] = params.ostf_password
if not ostf_credentials:
six.print_("WARNING: ostf credentials are going to be",
"mandatory in the next release.", file=sys.stderr)
env.run_test_sets(test_sets_to_check, ostf_credentials)
tests_state = env.get_state_of_tests()
self.serializer.print_to_output(
tests_state,
env,
print_method=print_health_check
)