004_basic_sanity.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:ovirt-system-tests 作者: oVirt 项目源码 文件源码
def restore_vm0_networking(ovirt_prefix):
    # Networking may not work after resume.  We need this pseudo-test for the
    # purpose of reviving VM networking by rebooting the VM.  We must be
    # careful to reboot just the guest OS, not to restart the whole VM, to keep
    # checking for contingent failures after resume.
    # A better solution might be using a guest OS other than Cirros.
    if _ping(ovirt_prefix, VM0_PING_DEST) == EX_OK:
        return
    host = _vm_host(ovirt_prefix, VM0_NAME)
    uri = 'qemu+tls://%s/system' % host.name()
    ret = host.ssh(['virsh', '-c', uri, 'reboot', '--mode', 'acpi', VM0_NAME])
    nt.assert_equals(ret.code, EX_OK)
    # We might want to wait until ssh server inside the VM gets up.  But the
    # interim tests, especially *_recovery, and repeated ssh connection
    # attempts in host.ssh calls should give enough time.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号