diff options
author | Fam Zheng <famz@redhat.com> | 2015-05-18 09:39:12 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-05-22 17:08:01 +0200 |
commit | aa4f592a1dd9aea5f5c36f6ff4b22b5bd208162a (patch) | |
tree | 1838a06658cfa428e481df9b84a9304912cd7bcd /tests/qemu-iotests/check | |
parent | b93bbf4ee9035ae077679482305d5beb38df4d7d (diff) |
qemu-iotests: Make debugging python tests easier
Adding "-d" option. The output goes to "tee" so it appears in your
console. Also, raise the verbosity of unnitest runner.
When testing a topic branch, it's possible that a bug introduced by a
code change makes the python test case hang, with debug output, it is
much easier to locate the problem.
This can also be helpful if you want to watch the progress of a python
test, it offers you a way to sense the speed of each test case method
you're writing.
Note: because there is no easy way to get *both* the verbose output and
the output expected by ./check comparison, the case would always fail
with an "output mismatch". The sole purpose of using this option is
giving developers a quick way to debug when things go wrong.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/check')
-rwxr-xr-x | tests/qemu-iotests/check | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index baeae80f96..1fa63193ba 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -296,9 +296,15 @@ do run_command="./$seq" fi export OUTPUT_DIR=$PWD - (cd "$source_iotests"; - MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \ - $run_command >$tmp.out 2>&1) + if $debug; then + (cd "$source_iotests"; + MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \ + $run_command -d 2>&1 | tee $tmp.out) + else + (cd "$source_iotests"; + MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \ + $run_command >$tmp.out 2>&1) + fi sts=$? $timestamp && _timestamp stop=`_wallclock` |