]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/backup-bacula-test
Add more debug
[bacula/bacula] / regress / tests / backup-bacula-test
index 3e81db61a082940abb9d9b97eeb89f7360a894ef..cc0fa32c2aeb8b2b096eaf6552eccd3bb809174b 100755 (executable)
@@ -3,54 +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
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
-
-echo " "
-echo " "
-echo " === Starting Backup Bacula Test ==="
-echo " === Starting Backup Bacula Test ===" >>tmp/log
-echo " "
-
-bin/bacula start
-bin/console -c bin/console.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
-label
-TestVolume001
-run job=NightlySave
-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
 @#
-restore
-5
-done
+@$out ${cwd}/tmp/log2.out  
+restore where=${cwd}/tmp/bacula-restores select all done
 yes
-@sleep 1
 wait
+messages
+@$out
+quit
+END_OF_DATA
+
+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
-sleep 2
-bin/bacula stop
-diff -ur build /tmp/bacula-restores${cwd}/build
-if [ $? != 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
+
+#
+# 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