ctdb-tests: Add run_tests.sh option to print logs on test failure
[vlendec/samba-autobuild/.git] / ctdb / tests / run_tests.sh
index c162aa54bc48a563283fec05eea0914d4f257816..8304443b1962ef8e1589f982c23a67aff001396b 100755 (executable)
@@ -12,6 +12,7 @@ Options:
   -e           Exit on the first test failure
   -H           No headers - for running single test with other wrapper
   -I <count>    Iterate tests <count> times, exiting on failure (implies -e, -N)
+  -L            Print daemon logs on test failure (only some tests)
   -N           Don't print summary of tests results after running all tests
   -q           Quiet - don't show tests being run (still displays summary)
   -S <lib>      Use socket wrapper library <lib> for local integration tests
@@ -44,11 +45,12 @@ export TEST_VERBOSE=false
 export TEST_COMMAND_TRACE=false
 export TEST_CAT_RESULTS_OPTS=""
 export TEST_DIFF_RESULTS=false
+export CTDB_TEST_PRINT_LOGS_ON_ERROR=false
 export TEST_LOCAL_DAEMONS
 [ -n "$TEST_LOCAL_DAEMONS" ] || TEST_LOCAL_DAEMONS=3
 export TEST_SOCKET_WRAPPER_SO_PATH=""
 
-while getopts "AcCDehHI:NqS:T:vV:xX?" opt ; do
+while getopts "AcCDehHI:LNqS:T:vV:xX?" opt ; do
        case "$opt" in
        A) TEST_CAT_RESULTS_OPTS="-A" ;;
        c) TEST_LOCAL_DAEMONS="" ;;
@@ -57,6 +59,7 @@ while getopts "AcCDehHI:NqS:T:vV:xX?" opt ; do
        e) exit_on_fail=true ;;
        H) no_header=true ;;
        I) max_iterations="$OPTARG" ; exit_on_fail=true ; with_summary=false ;;
+       L) CTDB_TEST_PRINT_LOGS_ON_ERROR=true ;;
        N) with_summary=false ;;
        q) quiet=true ;;
        S) TEST_SOCKET_WRAPPER_SO_PATH="$OPTARG" ;;