Signed-off-by: Lukas Doktor <ldoktor@xxxxxxxxxx> Signed-off-by: Jiri Zupka <jzupka@xxxxxxxxxx> --- client/tests/kvm/tests/virtio_console.py | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/tests/kvm/tests/virtio_console.py b/client/tests/kvm/tests/virtio_console.py index 058bb94..d5af383 100644 --- a/client/tests/kvm/tests/virtio_console.py +++ b/client/tests/kvm/tests/virtio_console.py @@ -1,3 +1,8 @@ +""" +virtio_console test + +@copyright: Red Hat 2010 +""" import array, logging, os, random, re, select, shutil, socket, sys, tempfile import threading, time from collections import deque @@ -180,8 +185,6 @@ def run_virtio_console(test, params, env): logging.debug("th_recv_check %s: exit(%d)", self.getName(), self.idx) - seqTest = threading.Lock(); - class cpu_load(): """ @@ -226,7 +229,7 @@ def run_virtio_console(test, params, env): Start CPU usage measurement """ self.old_load = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - self.startTime = time.time(); + self.startTime = time.time() self._get_cpu_load() @@ -287,7 +290,7 @@ def run_virtio_console(test, params, env): Start CPU usage measurement """ self.old_load = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - self.startTime = time.time(); + self.startTime = time.time() self._get_cpu_load(self.pid) @@ -388,7 +391,7 @@ def run_virtio_console(test, params, env): "timeout: %s", command, vm[0].name, timeout) vm[1].sendline(command) (match, data) = vm[1].read_until_last_line_matches(["PASS:", "FAIL:" \ - "[Failed to execute]"], \ + "[Failed to execute]"], \ timeout) return (match, data) @@ -829,6 +832,11 @@ def run_virtio_console(test, params, env): exit_event.set() thread.join() + # Let the guest read-out all the remaining data + while not _on_guest("virt.poll('%s', %s)" + % (port[1], select.POLLIN), vm, 2)[0]: + time.sleep(1) + _guest_exit_threads(vm, [port], []) if (_time > slice): -- 1.7.2.3 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html