本文整理汇总了Python中cfme.services.myservice.MyService.service_power方法的典型用法代码示例。如果您正苦于以下问题:Python MyService.service_power方法的具体用法?Python MyService.service_power怎么用?Python MyService.service_power使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.services.myservice.MyService
的用法示例。
在下文中一共展示了MyService.service_power方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_service_start
# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import service_power [as 别名]
def test_service_start(appliance, setup_provider, context,
order_service, provider, request):
"""Test service stop
Metadata:
test_flag: ssui, services
"""
catalog_item = order_service
with appliance.context.use(context):
my_service = MyService(appliance, catalog_item.name)
if provider.one_of(InfraProvider, EC2Provider, AzureProvider):
# For Infra providers vm is provisioned.Hence Stop option is shown
# For Azure, EC2 Providers Instance is provisioned.Hence Stop option is shown
my_service.service_power(power='Stop')
view = my_service.create_view(DetailsMyServiceView)
wait_for(lambda: view.resource_power_status.power_status == 'Off',
timeout=1000,
fail_condition=None,
message='Wait for resources off',
delay=20)
else:
my_service.service_power(power='Start')
view = my_service.create_view(DetailsMyServiceView)
wait_for(lambda: view.resource_power_status.power_status == 'On',
timeout=1000,
fail_condition=None,
message='Wait for resources on',
delay=20)
@request.addfinalizer
def _finalize():
my_service.delete()
示例2: test_service_start
# 需要导入模块: from cfme.services.myservice import MyService [as 别名]
# 或者: from cfme.services.myservice.MyService import service_power [as 别名]
def test_service_start(appliance, setup_provider, context,
order_service, provider, request):
"""Test service stop"""
catalog_item = order_service
with appliance.context.use(context):
my_service = MyService(appliance, catalog_item.name)
if provider.one_of(InfraProvider):
# For Infra providers vm is provisioned.Hence Stop option is shown
my_service.service_power(power='Stop')
view = my_service.create_view(DetailsMyServiceView)
view.notification.assert_message(
"{} was {}.".format(catalog_item.name, 'stopped'))
else:
my_service.service_power(power='Start')
view = my_service.create_view(DetailsMyServiceView)
view.notification.assert_message(
"{} was {}.".format(catalog_item.name, 'started'))
@request.addfinalizer
def _finalize():
my_service.delete()