diff options
author | 2011-08-19 09:20:35 -0600 | |
---|---|---|
committer | 2011-08-19 09:22:22 -0600 | |
commit | baac9c37d778cee455ce8d49f95ad2d88770c34c (patch) | |
tree | a1c8f11e29aa48a82586c6ffdf10c76f39a0fcae /tests/undefine | |
parent | maint: simplify lots of libxml2 clients (diff) | |
download | libvirt-baac9c37d778cee455ce8d49f95ad2d88770c34c.tar.gz libvirt-baac9c37d778cee455ce8d49f95ad2d88770c34c.tar.bz2 libvirt-baac9c37d778cee455ce8d49f95ad2d88770c34c.zip |
virsh: properly interleave shared stdout and stderr
Without this patch, invoking 'virsh >file 2>&1' results in
error messages appearing before normal output, even if they
occurred later in time than the normal output (since stderr
is unbuffered, but stdout waits until a full buffer).
* tools/virsh.c (print_job_progress, vshError): Flush between
stream transitions.
* tests/undefine: Test it.
Diffstat (limited to 'tests/undefine')
-rwxr-xr-x | tests/undefine | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/undefine b/tests/undefine index 6c821ad5b..22d6c1491 100755 --- a/tests/undefine +++ b/tests/undefine @@ -58,17 +58,14 @@ compare exp out || fail=1 # Succeed, now: first shut down, then undefine, both via name. $abs_top_builddir/tools/virsh -q -c test:///default \ - 'shutdown test; undefine test; dominfo test' > out 2> err + 'shutdown test; undefine test; dominfo test' > out 2>&1 test $? = 1 || fail=1 cat <<\EOF > expout || fail=1 Domain test is being shutdown Domain test has been undefined -EOF -cat <<\EOF > experr || fail=1 error: failed to get domain 'test' error: Domain not found EOF compare expout out || fail=1 -compare experr err || fail=1 (exit $fail); exit $fail |