]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/tests/backup-bacula-tape
Final changes
[bacula/bacula] / regress / tests / backup-bacula-tape
index c7cd869d6e29400ebaabd48bd2a5931623dba6ed..ac2df5d89d559543cdd1ea347b68c33e5cca1866 100755 (executable)
@@ -1,15 +1,19 @@
 #!/bin/sh
 #
 # Run a simple backup of the Bacula build directory 
-#   to a tape then restore it.
+#   to a tape then restore it, we do that twice to ensure that
+#   we can correctly append to a tape.
 #
 cwd=`pwd`
 bin/bacula stop  2>&1 >/dev/null
 scripts/copy-tape-confs
 scripts/cleanup-tape
 echo "${cwd}/build" >/tmp/file-list
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
+cd bin
+./drop_bacula_tables >/dev/null 2>&1
+./make_bacula_tables >/dev/null 2>&1
+./grant_bacula_privileges 2>&1 >/dev/null
+cd ..
 
 echo " "
 echo " "
@@ -18,7 +22,7 @@ echo " === Starting Bacula tape test ===" >>working/log
 echo " "
 
 bin/bacula start 2>&1 >/dev/null
-bin/console -c bin/console.conf <<END_OF_DATA
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
 @output /dev/null
 messages
 @output tmp/log1.out
@@ -30,19 +34,38 @@ messages
 @# now do a restore
 @#
 @output tmp/log2.out
-restore current all
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+messages
+@#
+@# Now do a second backup
+@#
+@output /dev/null
+messages
+@output tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0
+run job=NightlySave yes
+wait
+messages
+@# 
+@# now do a second restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
 yes
 wait
 messages
 @output
 quit
 END_OF_DATA
+scripts/check_for_zombie_jobs storage=DDS-4
 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
+diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
    echo " "
    echo " "