本文整理汇总了Python中cfme.infrastructure.virtual_machines.Vm.get_first_vm_title方法的典型用法代码示例。如果您正苦于以下问题:Python Vm.get_first_vm_title方法的具体用法?Python Vm.get_first_vm_title怎么用?Python Vm.get_first_vm_title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfme.infrastructure.virtual_machines.Vm
的用法示例。
在下文中一共展示了Vm.get_first_vm_title方法的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_title [as 别名]
def test_scope_windows_registry_stuck(request, setup_a_provider):
"""If you provide Scope checking windows registry, it messes CFME up. Recoverable."""
policy = 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)
policy.create()
profile = PolicyProfile(
"Windows registry scope glitch testing Compliance Policy",
policies=[policy]
)
request.addfinalizer(lambda: profile.delete() if profile.exists else None)
profile.create()
# Now assign this malformed profile to a VM
vm = VM.factory(Vm.get_first_vm_title(provider=setup_a_provider), setup_a_provider)
vm.assign_policy_profiles(profile.description)
# It should be screwed here, but do additional check
pytest.sel.force_navigate("dashboard")
pytest.sel.force_navigate("infrastructure_virtual_machines")
assert "except" not in pytest.sel.title().lower()
vm.unassign_policy_profiles(profile.description)