本文整理汇总了Python中cfme.services.myservice.MyService类的典型用法代码示例。如果您正苦于以下问题:Python MyService类的具体用法?Python MyService怎么用?Python MyService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MyService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reconfigure_service
def test_reconfigure_service(appliance, provider, provisioning, catalog, catalog_item, request):
"""Tests stack provisioning
Metadata:
test_flag: provision
"""
catalog_item, template = catalog_item
stack_data = prepare_stack_data(provider, provisioning)
@request.addfinalizer
def _cleanup_vms():
clean_up(stack_data, provider)
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog,
catalog_item.name, stack_data)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service {}'.format(catalog_item.name))
request_description = catalog_item.name
provision_request = appliance.collections.requests.instantiate(request_description,
partial_check=True)
provision_request.wait_for_request()
assert provision_request.is_succeeded()
myservice = MyService(appliance, catalog_item.name)
myservice.reconfigure_service()
示例2: _finalize
def _finalize():
_service = MyService(appliance, cat_item_name)
if service_request.exists():
service_request.wait_for_request()
service_request.remove_request()
if _service.exists:
_service.delete()
示例3: test_reconfigure_service
def test_reconfigure_service(provider, provisioning, catalog, catalog_item, request):
"""Tests stack provisioning
Metadata:
test_flag: provision
"""
catalog_item, item_name = catalog_item
stack_data = prepare_stack_data(provider, provisioning)
@request.addfinalizer
def _cleanup_vms():
clean_up(stack_data, provider)
service_catalogs = ServiceCatalogs(item_name, stack_data)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service {}'.format(item_name))
row_description = item_name
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=2000, delay=20)
assert 'Provisioned Successfully' in row.last_message.text
myservice = MyService(catalog_item.name)
myservice.reconfigure_service()
示例4: _finalize
def _finalize():
_service = MyService(appliance, cat_item_name)
if service_request.exists():
service_request.wait_for_request()
appliance.rest_api.collections.service_requests.action.delete(id=service_id.id)
if _service.exists:
_service.delete()
示例5: test_reconfigure_service
def test_reconfigure_service(provider, provisioning, catalog, catalog_item, request):
"""Tests stack provisioning
Metadata:
test_flag: provision
"""
catalog_item, item_name = catalog_item
stack_data = prepare_stack_data(provider, provisioning)
@request.addfinalizer
def _cleanup_vms():
try:
if provider.mgmt.stack_exist(stack_data['stack_name']):
wait_for(lambda: provider.mgmt.delete_stack(stack_data['stack_name']),
delay=10, num_sec=800, message="wait for stack delete")
stack_data['vm_name'].delete_from_provider()
except Exception as ex:
logger.warning('Exception while checking/deleting stack, continuing: {}'
.format(ex.message))
pass
service_catalogs = ServiceCatalogs(item_name, stack_data)
service_catalogs.order()
logger.info('Waiting for cfme provision request for service %s', item_name)
row_description = item_name
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=2000, delay=20)
assert provision_success_message(catalog_item.name) in row.last_message.text
myservice = MyService(catalog_item.name)
myservice.reconfigure_service()
示例6: service
def service(appliance, ansible_catalog_item):
_service = MyService(appliance, ansible_catalog_item.name)
yield _service
try:
if _service.exists:
_service.delete()
except ItemNotFound:
pass
示例7: test_service_link
def test_service_link(appliance, context, myservice):
"""Tests service link from VM details page(BZ1443772)"""
service_name, vm_name = myservice
with appliance.context.use(context):
myservice = MyService(appliance, name=service_name, vm_name=vm_name)
view = navigate_to(myservice, 'VMDetails')
view.summary('Relationships').click_at('Service')
new_view = myservice.create_view(MyServiceDetailView)
assert new_view.is_displayed
示例8: _cleanup
def _cleanup(appliance=None, provision_request=None, service=None):
if not service:
last_message = provision_request.get_request_row_from_ui()['Last Message'].text
service_name = last_message.split()[2].strip('[]')
myservice = MyService(appliance, service_name)
else:
myservice = service
if myservice.exists:
myservice.delete()
示例9: test_retire_service
def test_retire_service(appliance, context, myservice):
"""Tests my service
Metadata:
test_flag: provision
"""
service_name, vm_name = myservice
with appliance.context.use(context):
myservice = MyService(appliance, name=service_name, vm_name=vm_name)
myservice.retire()
示例10: test_download_file
def test_download_file(appliance, context, needs_firefox, myservice, filetype):
"""Tests my service download files
Metadata:
test_flag: provision
"""
service_name, vm_name = myservice
with appliance.context.use(context):
myservice = MyService(appliance, name=service_name, vm_name=vm_name)
myservice.download_file(filetype)
示例11: test_retire_service_ssui
def test_retire_service_ssui(appliance, setup_provider,
context, order_service, request):
"""Test retire service."""
catalog_item = order_service
with appliance.context.use(context):
my_service = MyService(appliance, catalog_item.name)
my_service.retire()
@request.addfinalizer
def _finalize():
my_service.delete()
示例12: test_retire_service_on_date
def test_retire_service_on_date(appliance, context, myservice):
"""Tests my service retirement
Metadata:
test_flag: provision
"""
service_name, vm_name = myservice
with appliance.context.use(context):
myservice = MyService(appliance, name=service_name, vm_name=vm_name)
dt = datetime.utcnow()
myservice.retire_on_date(dt)
示例13: test_myservice_crud
def test_myservice_crud(appliance, setup_provider, context, order_service):
"""Test Myservice crud in SSUI."""
catalog_item = order_service
with appliance.context.use(context):
my_service = MyService(appliance, catalog_item.name)
my_service.set_ownership("Administrator", "EvmGroup-approver")
my_service.update({'description': '{}_edited'.format(catalog_item.name)})
if appliance.version > "5.8":
my_service.edit_tags("Cost Center", "Cost Center 001")
my_service.delete()
示例14: order_ansible_service_in_ops_ui
def order_ansible_service_in_ops_ui(appliance, ansible_catalog_item,
ansible_service_catalog):
"""Tests if ansible playbook service provisioning is shown in service requests."""
ansible_service_catalog.order()
cat_item_name = ansible_catalog_item.name
request_descr = "Provisioning Service [{0}] from [{0}]".format(cat_item_name)
service_request = appliance.collections.requests.instantiate(description=request_descr)
if service_request.exists():
service_request.wait_for_request()
service_request.remove_request()
yield cat_item_name
service = MyService(appliance, cat_item_name)
if service.exists:
service.delete()
示例15: test_download_file
def test_download_file(appliance, context, needs_firefox, myservice, filetype):
"""Tests my service download files
Metadata:
test_flag: provision
Polarion:
assignee: nansari
initialEstimate: 1/16h
"""
service_name, vm_name = myservice
with appliance.context.use(context):
myservice = MyService(appliance, name=service_name, vm_name=vm_name)
myservice.download_file(filetype)