]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/two-pool-test
Update
[bacula/bacula] / regress / tests / two-pool-test
index 9686b425668f4ff958aa6dafd4fb80e48723866b..bec846f2363bbcf814ba7d1636ba3f0a091eb22b 100755 (executable)
@@ -9,17 +9,16 @@
 #
 #  Note, we use the virtual disk autochanger.
 #
+TestName="two-pool-test"
+JobName=Two-pool
+. scripts/functions
+set_debug 0
+
 . config.out
 if test x${AUTOCHANGER} = x/dev/null ; then
    echo "two-pool-test skipped. No autochanger."
    exit
 fi
-debug=0
-if test "$debug" -eq 1 ; then
-  out="tee"
-else
-  out="output"
-fi
 cwd=`pwd`
 scripts/cleanup
 scripts/copy-2disk-confs
@@ -29,11 +28,8 @@ scripts/prepare-two-disks
 #  Reduced to 1 for portable
 echo "${cwd}/build" >/tmp/file-list
 
-echo " "
-echo " "
-echo " === Starting Two Pool Test at `date +%R:%S` ==="
-echo " === Starting Two Pool Test at `date +%R:%S` ===" >>working/log
-echo " "
+start_test
+
 # Write out bconsole commands to a file
 cat <<END_OF_DATA >tmp/bconcmds
 @output /dev/null
@@ -74,33 +70,10 @@ messages
 quit
 END_OF_DATA
 
-# start Bacula and run bconsole commands
-if test "$debug" -eq 1 ; then
-  bin/bacula start
-  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
-else
-  bin/bacula start 2>&1 >/dev/null
-  cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
-fi
-# Make sure no jobs are still running (debug check)
-scripts/check_for_zombie_jobs storage=DDS-4
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
 
-# stop Bacula
-bin/bacula stop 2>&1 >/dev/null
-# Check if backup done correctly
-grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
-bstat=$?
-grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
-rstat=$?
-diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
-   echo " "
-   echo " "
-   echo "  !!!!! Two Pool Test Bacula source failed!!! !!!!! "
-   echo "  !!!!! Two Pool Test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Two Pool Test Bacula source OK ===== "
-   echo "  ===== Two Pool Test OK ===== " >>test.out
-#  scripts/cleanup
-fi
+check_two_logs
+check_restore_diff
+end_test