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

qemu.tests.virtio_console: Fix variable overwriting

err value was overwritten by thread return number which resulted in
incorrectly reported failed tests as pass.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 9622bff0
......@@ -893,7 +893,7 @@ def run_virtio_console(test, params, env):
# Start loopback
error.context("Starting loopback", logging.info)
err = False
err = ""
# TODO: Use normal LOOP_NONE when bz796048 is resolved.
guest_worker.cmd("virt.loopback(['%s'], ['%s'], %s, virt.LOOP_"
"RECONNECT_NONE)"
......@@ -1013,7 +1013,7 @@ def run_virtio_console(test, params, env):
raise error.TestFail('No data transferred after'
'interruption.')
except Exception, inst:
err = True
err = "main thread, "
logging.error('interrupted_loopback failed with exception: %s',
inst)
......@@ -1036,13 +1036,10 @@ def run_virtio_console(test, params, env):
logging.info('%d data sent; %d data received and verified; %d '
'interruptions %ds each.', threads[0].idx,
threads[1].idx, no_repeats, test_time)
err = ""
if threads[0].ret_code:
err += "sender, "
if threads[1].ret_code:
err += "receiver, "
if err:
raise error.TestFail("Background thread(s) %s failed" % err[:-2])
# Ports might change (in suspend S4)
if is_serialport:
......@@ -1067,6 +1064,9 @@ def run_virtio_console(test, params, env):
cleanup(env.get_vm(params["main_vm"]), guest_worker)
if err:
raise error.TestFail("%s failed" % err[:-2])
@error.context_aware
def _process_stats(stats, scale=1.0):
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册