From dbf57ee970e011f25679c77342dd474d030723b1 Mon Sep 17 00:00:00 2001 From: Wayne Sun Date: Thu, 8 Dec 2016 17:15:07 +0800 Subject: [PATCH] utils_test.libvirt: Add command string in negative fail message When command expect fail but run success, add command detail in the raise error to quickly identify problem. Signed-off-by: Wayne Sun --- virttest/utils_test/libvirt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virttest/utils_test/libvirt.py b/virttest/utils_test/libvirt.py index 0383f235af..633d62e1d7 100644 --- a/virttest/utils_test/libvirt.py +++ b/virttest/utils_test/libvirt.py @@ -1322,7 +1322,8 @@ def check_exit_status(result, expect_error=False): else: logging.debug("Command output:\n%s", result.stdout.strip()) elif expect_error and result.exit_status == 0: - raise exceptions.TestFail("Expect fail, but run successfully.") + raise exceptions.TestFail("Run '%s' expect fail, but run " + "successfully." % result.command) def get_interface_details(vm_name):