本文整理汇总了Python中cfme.infrastructure.virtual_machines.Vm类的典型用法代码示例。如果您正苦于以下问题:Python Vm类的具体用法?Python Vm怎么用?Python Vm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_vm
def test_vm(request, provider_init, provider_crud, provider_mgmt, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider_crud)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider()
return vm
示例2: test_vm
def test_vm(request, provider_init, provider_crud, provider_mgmt, provider_data, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider_crud, template_name=provider_data['full_template']['name'])
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm
示例3: testing_vm
def testing_vm(request, vm_name, provider_init, provider_crud, provider_mgmt, provisioning):
vm_obj = Vm(vm_name, provider_crud, provisioning["template"])
def _finalize():
vm_obj.delete_from_provider()
request.addfinalizer(_finalize)
vm_obj.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm_obj
示例4: test_vm
def test_vm(request, provider_crud, provider_mgmt, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider_crud)
request.addfinalizer(vm.delete_from_provider)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create(timeout_in_minutes=15)
return vm
示例5: test_no_dvd_ruins_refresh
def test_no_dvd_ruins_refresh(provider, small_template):
host_group = provider.data["provisioning"]["host_group"]
with provider.mgmt.with_vm(
small_template, vm_name="test_no_dvd_{}".format(fauxfactory.gen_alpha()),
host_group=host_group) as vm_name:
provider.mgmt.disconnect_dvd_drives(vm_name)
vm = Vm(vm_name, provider)
provider.refresh_provider_relationships()
vm.wait_to_appear()
示例6: test_vm
def test_vm(request, provider_crud, provider_mgmt, vm_name):
'''Fixture to provision appliance to the provider being tested if necessary'''
vm = Vm(vm_name, provider_crud)
request.addfinalizer(vm.delete_from_provider)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider()
return vm
示例7: vm
def vm(request, vm_template_name, vm_name, provider_crud, provider_mgmt):
logger.info("Starting vm fixture")
vm = Vm(vm_name, provider_crud, template_name=vm_template_name)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider(allow_skip="default")
request.addfinalizer(vm.delete_from_provider)
return vm
示例8: test_vm
def test_vm(request, provider, vm_name, setup_provider_modscope):
"""Fixture to provision appliance to the provider being tested if necessary"""
pytest.sel.force_navigate('infrastructure_providers')
vm = Vm(vm_name, provider)
request.addfinalizer(vm.delete_from_provider)
if not provider.mgmt.does_vm_exist(vm_name):
vm.create_on_provider(find_in_cfme=True, allow_skip="default")
return vm
示例9: test_vm
def test_vm(request, provider_crud, provider_mgmt, vm_name, provider_init):
"""Fixture to provision appliance to the provider being tested if necessary"""
pytest.sel.force_navigate('infrastructure_providers')
vm = Vm(vm_name, provider_crud)
request.addfinalizer(vm.delete_from_provider)
if not provider_mgmt.does_vm_exist(vm_name):
vm.create_on_provider()
return vm
示例10: test_vm_clone
def test_vm_clone(provisioning, provider_type, provider_crud, clone_vm_name,
provider_mgmt, request, create_vm, provider_key):
request.addfinalizer(lambda: cleanup_vm(vm_name, provider_key, provider_mgmt))
request.addfinalizer(lambda: cleanup_vm(clone_vm_name, provider_key, provider_mgmt))
vm_name = create_vm + "_0001"
vm = Vm(vm_name, provider_crud)
vm.clone_vm("[email protected]", "first", "last", clone_vm_name)
row_description = 'Clone from [%s] to [%s]' % (vm_name, clone_vm_name)
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells],
fail_func=requests.reload, num_sec=4000, delay=20)
assert row.last_message.text == 'Vm Provisioned Successfully'
示例11: fleecing_vm
def fleecing_vm(request, compliance_vm, vm_analysis, provider_mgmt, provider_key, provider_crud, analysis_profile):
logger.info("Provisioning an appliance for fleecing on {}".format(provider_key))
# TODO: When we get something smaller, use it!
appliance = provision_appliance(
vm_name_prefix=PREFIX + "for_fleece_", version=str(version.current_version()), provider_name=provider_key
)
request.addfinalizer(lambda: diaper(appliance.destroy))
logger.info("Appliance {} provisioned".format(appliance.vm_name))
vm = Vm(appliance.vm_name, provider_crud)
provider_crud.refresh_provider_relationships()
vm.wait_to_appear()
return vm
示例12: testing_vm
def testing_vm(request, vm_name, provider_init, provider_crud, provider_mgmt, provisioning):
vm_obj = Vm(vm_name, provider_crud, provisioning["template"])
def _finalize():
vm_obj.delete_from_provider()
if vm_obj.does_vm_exist_in_cfme():
vm_obj.remove_from_cfme()
request.addfinalizer(_finalize)
vm_obj.create_on_provider()
provider_crud.refresh_provider_relationships()
wait_for(vm_obj.does_vm_exist_in_cfme, num_sec=450, delay=10)
return vm_obj
示例13: test_vm_migrate
def test_vm_migrate(setup_provider, provider, request):
"""Tests migration of a vm
Metadata:
test_flag: migrate, provision
"""
vm = Vm("vmtest", provider)
vm.migrate_vm("[email protected]", "first", "last")
flash.assert_no_errors()
row_description = 'vmtest'
cells = {'Description': row_description}
row, __ = wait_for(requests.wait_for_request, [cells, True],
fail_func=requests.reload, num_sec=600, delay=20)
assert row.request_state.text == 'Migrated'
示例14: test_vm_migrate
def test_vm_migrate(provider_init, provider_crud, provider_mgmt, request):
"""Tests migration of a vm
Metadata:
test_flag: migrate, provision
"""
vm = Vm("vmtest", provider_crud)
vm.migrate_vm("[email protected]", "first", "last", "host", "datstore")
flash.assert_no_errors()
row_description = 'VM Migrate'
cells = {'Request Type': row_description}
row, __ = wait_for(requests.wait_for_request, [cells],
fail_func=requests.reload, num_sec=600, delay=20)
assert row.last_message.text == 'Request complete'
示例15: test_vm
def test_vm(request, provider, vm_name):
"""Fixture to provision appliance to the provider being tested if necessary"""
vm = Vm(vm_name, provider)
request.addfinalizer(vm.delete_from_provider)
if not provider.mgmt.does_vm_exist(vm_name):
logger.info("deploying {} on provider {}".format(vm_name, provider.key))
vm.create_on_provider(allow_skip="default")
else:
logger.info("recycling deployed vm {} on provider {}".format(vm_name, provider.key))
vm.provider_crud.refresh_provider_relationships()
vm.wait_to_appear()
return vm