本文整理汇总了Python中cfme.infrastructure.virtual_machines.Vm.get_first_vm方法的典型用法代码示例。如果您正苦于以下问题:Python Vm.get_first_vm方法的具体用法?Python Vm.get_first_vm怎么用?Python Vm.get_first_vm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.infrastructure.virtual_machines.Vm
的用法示例。
在下文中一共展示了Vm.get_first_vm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_scope_windows_registry_stuck
# 需要导入模块: from cfme.infrastructure.virtual_machines import Vm [as 别名]
# 或者: from cfme.infrastructure.virtual_machines.Vm import get_first_vm [as 别名]
def test_scope_windows_registry_stuck(request, appliance, infra_provider, policy_collection,
policy_profile_collection):
"""If you provide Scope checking windows registry, it messes CFME up. Recoverable."""
policy = policy_collection.create(
VMCompliancePolicy,
"Windows registry scope glitch testing Compliance Policy",
active=True,
scope=r"fill_registry(HKLM\SOFTWARE\Microsoft\CurrentVersion\Uninstall\test, "
r"some value, INCLUDES, some content)"
)
request.addfinalizer(lambda: policy.delete() if policy.exists else None)
profile = policy_profile_collection.create(
"Windows registry scope glitch testing Compliance Policy",
policies=[policy]
)
request.addfinalizer(lambda: profile.delete() if profile.exists else None)
# Now assign this malformed profile to a VM
vm = VM.factory(Vm.get_first_vm(provider=infra_provider).name, infra_provider)
vm.assign_policy_profiles(profile.description)
# It should be screwed here, but do additional check
navigate_to(appliance.server, 'Dashboard')
view = navigate_to(Vm, 'All')
assert "except" not in view.entities.title.text.lower()
vm.unassign_policy_profiles(profile.description)