tests: dump config.log when configure fails in docker job
PATCH 1/1 tests: dump config.log when configure fails in docker job
When configure fails inside a docker job it is not easy to get access to the config.log file. It is nicer for developers if we just splatter the contents of config.log to stdout upon failure
--- tests/docker/common.rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/docker/common.rc +2 -1
@@ -30,7 +30,8 @@ build_qemu() $@" echo "Configure options:" echo $config_opts - $QEMU_SRC/configure $config_opts && make $MAKEFLAGS + $QEMU_SRC/configure $config_opts || cat config.log + make $MAKEFLAGS } test_fail()
Signature · 1 line
2.14.3
Quoted 15 lines · Daniel P. Berrangé
When configure fails inside a docker job it is not easy to get access to the config.log file. It is nicer for developers if we just splatter the contents of config.log to stdout upon failure
Suggested-by Eric Blake <[email protected]>Signed-off-by Daniel P. Berrangé <[email protected]>--- tests/docker/common.rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/docker/common.rc +0
-0
tests/docker/common.rc build_qemu() · line 33
Quoted 4 lines
tests/docker/common.rc +0
-1@@ -30,7 +30,8 @@ build_qemu() $@" echo "Configure options:" echo $config_opts - $QEMU_SRC/configure $config_opts && make $MAKEFLAGS
The old code dies if either configure or make has non-zero exit status.
tests/docker/common.rc build_qemu() · line 34
Quoted 2 lines
tests/docker/common.rc +2
-0+ $QEMU_SRC/configure $config_opts || cat config.log + make $MAKEFLAGS
But this turns a failure of configure into a successful exit status (presuming that cat doesn't also fail), which means we try the make no matter whether configure succeeded.
Better might be:
$QEMU_SRC/configure $config_opts || { cat config.log; exit 1; }
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org