未验证 提交 a2becc49 编写于 作者: C chunfu wen 提交者: GitHub

Merge pull request #2979 from cliping/fix-hook

Update for libvirt_hooks case
......@@ -302,12 +302,16 @@ def run(test, params, env):
sta, pid = process.getstatusoutput("pgrep qemu-kvm")
if not pid:
test.fail("Cannot get pid of qemu command")
ret = virsh.qemu_attach(pid, **virsh_dargs)
if ret.exit_status:
try:
ret = virsh.qemu_attach(pid, **virsh_dargs)
if ret.exit_status:
utils_misc.kill_process_tree(pid)
test.fail("Cannot attach qemu process")
else:
virsh.destroy(vm_test)
except Exception as detail:
utils_misc.kill_process_tree(pid)
test.fail("Cannot attach qemu process")
else:
virsh.destroy(vm_test)
test.fail("Failed to attach qemu process: %s" % str(detail))
hook_str = hook_file + " " + vm_test + " attach begin -"
if not check_hooks(hook_str):
test.fail("Failed to check attach hooks")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册