Merge remote branch 'martins/master'
[vlendec/samba-autobuild/.git] / ctdb / tests / scripts / ctdb_test_functions.bash
index 063f1c3a3e4f9a42bdbd7cf5caf99abe22352c5b..70c5b5d10b623680f412b727e9585adbba52a715 100644 (file)
@@ -8,51 +8,6 @@ fail ()
 
 ######################################################################
 
-ctdb_test_begin ()
-{
-    local name="$1"
-
-    teststarttime=$(date '+%s')
-    testduration=0
-
-    echo "--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--"
-    echo "Running test $name ($(date '+%T'))"
-    echo "--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--"
-}
-
-ctdb_test_end ()
-{
-    local name="$1" ; shift
-    local status="$1" ; shift
-    # "$@" is command-line
-
-    local interp="SKIPPED"
-    local statstr=" (reason $*)"
-    if [ -n "$status" ] ; then
-       if [ $status -eq 0 ] ; then
-           interp="PASSED"
-           statstr=""
-           echo "ALL OK: $*"
-       else
-           interp="FAILED"
-           statstr=" (status $status)"
-           testfailures=$(($testfailures+1))
-       fi
-    fi
-
-    testduration=$(($(date +%s)-$teststarttime))
-
-    echo "=========================================================================="
-    echo "TEST ${interp}: ${name}${statstr} (duration: ${testduration}s)"
-    echo "=========================================================================="
-
-}
-
-test_exit ()
-{
-    exit $(($testfailures+0))
-}
-
 ctdb_check_time_logs ()
 {
     local threshold=20
@@ -116,7 +71,8 @@ ctdb_test_exit ()
 
     echo "*** TEST COMPLETED (RC=$status) AT $(date '+%F %T'), CLEANING UP..."
 
-    if [ -n "$CTDB_TEST_REAL_CLUSTER" -a $status -ne 0 ] ; then
+    if [ -n "$CTDB_TEST_REAL_CLUSTER"  -a -n "$CTDB_TEST_TIME_LOGGING" -a \
+       $status -ne 0 ] ; then
        ctdb_check_time_logs
     fi
 
@@ -143,22 +99,6 @@ ctdb_test_exit_hook_add ()
     ctdb_test_exit_hook="${ctdb_test_exit_hook}${ctdb_test_exit_hook:+ ; }$*"
 }
 
-ctdb_test_run ()
-{
-    local name="$1" ; shift
-    
-    [ -n "$1" ] || set -- "$name"
-
-    ctdb_test_begin "$name"
-
-    local status=0
-    "$@" || status=$?
-
-    ctdb_test_end "$name" "$status" "$*"
-    
-    return $status
-}
-
 ctdb_test_usage()
 {
     local status=${1:-2}