Skip to content

Commit

Permalink
utils_test.libvirt: Add command string in negative fail message
Browse files Browse the repository at this point in the history
When command expect fail but run success, add command detail in
the raise error to quickly identify problem.

Signed-off-by: Wayne Sun <[email protected]>
  • Loading branch information
waynesun09 committed Dec 8, 2016
1 parent 62b7060 commit dbf57ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virttest/utils_test/libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit dbf57ee

Please sign in to comment.