]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/backup-bacula-test
Add more debug
[bacula/bacula] / regress / tests / backup-bacula-test
index 2d126acd5c98dead33edba6a03923ec826b0fb79..cc0fa32c2aeb8b2b096eaf6552eccd3bb809174b 100755 (executable)
@@ -3,57 +3,90 @@
 # Run a simple backup of the Bacula build directory
 #   then restore it.
 #
-cwd=`pwd`
-scripts/copy-confs
+TestName="backup-bacula-test"
+JobName=backup
+. scripts/functions
+
 scripts/cleanup
-bin/bacula stop 2>&1 >/dev/null
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges >/dev/null 2>&1
-cd ..
-
-echo " "
-echo " "
-echo " === Starting Backup Bacula Test ==="
-echo " === Starting Backup Bacula Test ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+scripts/copy-confs
+
+change_jobname Client1 $JobName
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @output /dev/null
 messages
-@output tmp/log1.out
-label volume=TestVolume001
-run job=Client1 yes
+@$out ${cwd}/tmp/log1.out
+setdebug level=100 storage=File
+label volume=TestVolume001 storage=File pool=Default
+run job=$JobName yes
+status storage=File
+status storage=File
+status storage=File
+status storage=File
+status storage=File
+status storage=File
+@sleep 1
+status storage=File
+status storage=File
+status storage=File
+status storage=File
+status storage=File
+@sleep 1
+status storage=File
+status storage=File
+status storage=File
+status storage=File
+status storage=File
 wait
 messages
 @# 
 @# now do a restore
 @#
-@output tmp/log2.out  
-restore where=${cwd}/tmp/bacula-restores select all
+@$out ${cwd}/tmp/log2.out  
+restore where=${cwd}/tmp/bacula-restores select all done
 yes
 wait
 messages
-@output
+@$out
 quit
 END_OF_DATA
-scripts/check_for_zombie_jobs storage=File
-bin/bacula stop 2>&1 >/dev/null
-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 "  !!!!! Backup Bacula Test failed!!! !!!!! "
-   echo "  !!!!! Backup Bacula Test failed!!! !!!!! " >>test.out
-   echo " "
-else
-   echo "  ===== Backup Bacula Test OK ===== "
-   echo "  ===== Backup Bacula Test OK ===== " >>test.out
-   scripts/cleanup
-fi
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+@#setdebug level=100 storage=File
+run job=$JobName yes
+wait
+messages
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out  
+restore where=${cwd}/tmp/bacula-restores select all done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+#
+# Now do a second backup after making a few changes
+#
+touch ${cwd}/build/src/dird/*.c
+echo "test test" > ${cwd}/build/src/dird/xxx
+#
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test