[Libguestfs] [PATCH nbdkit 2/7] tests/test-debug-flags.sh: Log the error from nbdkit unconditionally.

Richard W.M. Jones rjones at redhat.com
Thu Dec 12 12:02:07 UTC 2019


Useful to print the error displayed by nbdkit in all cases, not
just when the test fails.

Also fix the error message if the test does fail (unexpected -> expected).
---
 tests/test-debug-flags.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/test-debug-flags.sh b/tests/test-debug-flags.sh
index 10e916c..88f5a22 100755
--- a/tests/test-debug-flags.sh
+++ b/tests/test-debug-flags.sh
@@ -49,10 +49,9 @@ expected_failure ()
 
 check_error ()
 {
+    cat debug-flags.out
     if ! grep -sq "$1" debug-flags.out; then
-        echo "unexpected error message containing: $1"
-        echo "actual output:"
-        cat debug-flags.out
+        echo "expected error message containing: $1"
         exit 1
     fi
 }
-- 
2.23.0




More information about the Libguestfs mailing list