提交 fc935830 编写于 作者: L Lukáš Doktor 提交者: Lucas Meneghel Rodrigues

test virtio_console: wait for data in rw_nonblocking_mode test

On heavy loaded VM data might not yet be available, give
the machine second chance in case of Errno 11.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 4f0c2b96
......@@ -481,7 +481,18 @@ def run_virtio_console(test, params, env):
raise error.TestFail("Unexpected fail\nMatch: %s\nData:\n%s" %
(match, tmp))
port.sock.sendall("1234567890")
guest_worker.cmd("virt.recv('%s', 10, 1024, False)" % port.name, 10)
time.sleep(0.01)
try:
guest_worker.cmd("virt.recv('%s', 10, 1024, False)"
% port.name, 10)
except qemu_virtio_port.VirtioPortException, details:
if '[Errno 11] Resource temporarily unavailable' in details:
# Give the VM second chance
time.sleep(0.01)
guest_worker.cmd("virt.recv('%s', 10, 1024, False)"
% port.name, 10)
else:
raise details
cleanup(vm, guest_worker)
@error.context_aware
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册