Harald Hoyer 9d5d75
From 827a5b1a80c63f62fbe70945d46a8eb9453fc9fe Mon Sep 17 00:00:00 2001
Harald Hoyer 9d5d75
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 9d5d75
Date: Tue, 14 Aug 2018 11:37:57 +0200
Harald Hoyer 9d5d75
Subject: [PATCH] test: also output server.log on failure
Harald Hoyer 9d5d75
Harald Hoyer 9d5d75
---
Harald Hoyer 9d5d75
 test/test-functions | 6 +++++-
Harald Hoyer 9d5d75
 1 file changed, 5 insertions(+), 1 deletion(-)
Harald Hoyer 9d5d75
Harald Hoyer 9d5d75
diff --git a/test/test-functions b/test/test-functions
Harald Hoyer 9d5d75
index 57611ff5..f27be912 100644
Harald Hoyer 9d5d75
--- a/test/test-functions
Harald Hoyer 9d5d75
+++ b/test/test-functions
Harald Hoyer 9d5d75
@@ -75,6 +75,9 @@ while (($# > 0)); do
Harald Hoyer 9d5d75
 		    test_setup && test_run
Harald Hoyer 9d5d75
 		    ret=$?
Harald Hoyer 9d5d75
 		    test_cleanup
Harald Hoyer 9d5d75
+                    if ((ret!=0)) && [[ -f "$TESTDIR"/server.log ]]; then
Harald Hoyer 9d5d75
+                        mv [[ -f "$TESTDIR"/server.log ]] ./
Harald Hoyer 9d5d75
+                    fi
Harald Hoyer 9d5d75
 		    rm -fr -- "$TESTDIR"
Harald Hoyer 9d5d75
 		    rm -f -- .testdir
Harald Hoyer 9d5d75
 		    exit $ret
Harald Hoyer 9d5d75
@@ -88,7 +91,8 @@ while (($# > 0)); do
Harald Hoyer 9d5d75
 	    else
Harald Hoyer 9d5d75
 	        echo -e "TEST: $TEST_DESCRIPTION " $COLOR_FAILURE "[FAILED]" $COLOR_NORMAL
Harald Hoyer 9d5d75
                 if [ "$V" == "2" ]; then
Harald Hoyer 9d5d75
-	            cat $(pwd)/test.log
Harald Hoyer 9d5d75
+	            cat $(pwd)/server.log $(pwd)/test.log
Harald Hoyer 9d5d75
+	            echo -e "TEST: $TEST_DESCRIPTION " $COLOR_FAILURE "[FAILED]" $COLOR_NORMAL
Harald Hoyer 9d5d75
                 else
Harald Hoyer 9d5d75
 	            echo "see $(pwd)/test.log"
Harald Hoyer 9d5d75
                 fi
Harald Hoyer 9d5d75