From 7bfb8fb4f3265f5812d59b0e65821104721d467a Mon Sep 17 00:00:00 2001 From: Haotong Chen Date: Thu, 7 Dec 2017 13:52:51 +0800 Subject: [PATCH] usb_common: added error checking in dmesg for linux guest Signed-off-by: Haotong Chen --- qemu/tests/usb_common.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qemu/tests/usb_common.py b/qemu/tests/usb_common.py index 1041c964..5dd352df 100644 --- a/qemu/tests/usb_common.py +++ b/qemu/tests/usb_common.py @@ -129,6 +129,14 @@ def verify_usb_device_in_guest(params, session, devs): return False return True + if params.get("os_type") == "linux": + logging.info("checking if there is I/O error in dmesg") + output = session.cmd_output("dmesg | grep -i usb", + float(params["cmd_timeout"])) + for line in output.splitlines(): + if "error" in line or "ERROR" in line: + return (False, "error found in guest's dmesg: %s " % line) + res = utils_misc.wait_for(_verify_guest_usb, float(params["cmd_timeout"]), step=5.0, -- GitLab