summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel P. Berrangé2019-02-20 15:58:18 +0100
committerEric Blake2019-02-26 17:45:37 +0100
commit84f8b840a2d9ed248c80b3601d2d212cdf60cecf (patch)
treeb2fb79c9957678bd843d01d30f2213f71f2643c4 /tests
parentiotests: handle TypeError for Python 3 in test 242 (diff)
downloadqemu-84f8b840a2d9ed248c80b3601d2d212cdf60cecf.tar.gz
qemu-84f8b840a2d9ed248c80b3601d2d212cdf60cecf.tar.xz
qemu-84f8b840a2d9ed248c80b3601d2d212cdf60cecf.zip
iotests: ensure we print nbd server log on error
If we abort the iotest early the server.log file might contain useful information for diagnosing the problem. Ensure its contents are displayed in this case. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20190220145819.30969-2-berrange@redhat.com> [eblake: fix shell quoting] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/2333
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/qemu-iotests/233 b/tests/qemu-iotests/233
index fc345a1a46..adb742fafb 100755
--- a/tests/qemu-iotests/233
+++ b/tests/qemu-iotests/233
@@ -30,6 +30,8 @@ _cleanup()
{
nbd_server_stop
_cleanup_test_img
+ # If we aborted early we want to see this log for diagnosis
+ test -f "$TEST_DIR/server.log" && cat "$TEST_DIR/server.log"
rm -f "$TEST_DIR/server.log"
tls_x509_cleanup
}
@@ -120,6 +122,7 @@ $QEMU_IO -f $IMGFMT -r -U -c 'r -P 0x22 1m 1m' "$TEST_IMG" | _filter_qemu_io
echo
echo "== final server log =="
cat "$TEST_DIR/server.log"
+rm -f "$TEST_DIR/server.log"
# success, all done
echo "*** done"