tests/bsr-opt-test
tests/compressed-test
tests/concurrent-jobs-test
-tests/decremental-test
+tests/differential-test
tests/four-concurrent-jobs-test
tests/four-jobs-test
tests/incremental-test
#
Director { # define myself
- Name = roxie-dir
+ Name = localhost-dir
DIRport = 8101 # where we listen for UA connections
QueryFile = "/home/kern/bacula/regress/bin/query.sql"
WorkingDirectory = "/home/kern/bacula/regress/working"
if test x$host = x ; then
host=localhost
fi
+host="localhost"
# Create sed command script
echo "s%@sbindir@%${cwd}/bin%g" >${out}
echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
+++ /dev/null
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory then create some
-# new files, do a Decremental and restore those two files.
-#
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "${cwd}/tmp/build" >/tmp/file-list
-mkdir ${cwd}/tmp/build
-cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
-cd ${cwd}/tmp
-echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
-echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
-cd ${cwd}
-
-echo " "
-echo " "
-echo " === Starting decremental-test at `date +%R:%S` ==="
-echo " === Starting decremental-test at `date +%R:%S` ===" >>working/log
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-label storage=File volume=TestVolume002
-run job=CompressedTest yes
-wait
-messages
-quit
-END_OF_DATA
-scripts/check_for_zombie_jobs storage=File
-echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
-echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
-messages
-@output tmp/log1.out
-@# Force decremental on the second Volume
-update volume=TestVolume001 VolStatus=Used
-run level=decremental job=CompressedTest yes
-wait
-messages
-@output
-END_OF_DATA
-scripts/check_for_zombie_jobs storage=File
-echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
-messages
-@output tmp/log1.out
-run level=incremental job=CompressedTest yes
-wait
-messages
-@#
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
-yes
-wait
-messages
-@output
-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=$?
-#
-# Delete .c files because we will only restored the txt files
-#
-rm -f tmp/build/*.c
-diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
-if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
- echo " "
- echo " "
- echo " !!!!! decremental-test Bacula source failed!!! !!!!! "
- echo " !!!!! decremental-test failed!!! !!!!! " >>test.out
- if [ $bstat != 0 -o $rstat != 0 ] ; then
- echo " !!!!! Bad Job termination status !!!!! "
- echo " !!!!! Bad Job termination status !!!!! " >>test.out
- else
- echo " !!!!! Restored files differ !!!!! "
- echo " !!!!! Restored files differ !!!!! " >>test.out
- fi
- echo " "
-else
- echo " ===== decremental-test Bacula source OK ===== "
- echo " ===== decremental-test OK ===== " >>test.out
- scripts/cleanup
-fi
--- /dev/null
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then create some
+# new files, do a differential and restore those two files.
+#
+debug=0
+if test "$debug" -eq 1 ; then
+ out="tee"
+else
+ out="output"
+fi
+
+cwd=`pwd`
+scripts/copy-test-confs
+scripts/cleanup
+echo "${cwd}/tmp/build" >/tmp/file-list
+mkdir ${cwd}/tmp/build
+cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
+cd ${cwd}/tmp
+echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
+echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
+cd ${cwd}
+
+echo " "
+echo " "
+echo " === Starting differential-test at `date +%R:%S` ==="
+echo " === Starting differential-test at `date +%R:%S` ===" >>working/log
+echo " "
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+label storage=File volume=TestVolume001
+label storage=File volume=TestVolume002
+run job=CompressedTest yes
+wait
+messages
+quit
+END_OF_DATA
+
+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
+
+scripts/check_for_zombie_jobs storage=File
+echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
+echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+@# Force differential on the second Volume
+update volume=TestVolume001 VolStatus=Used
+run level=differential job=CompressedTest yes
+wait
+messages
+@$out
+END_OF_DATA
+
+if test "$debug" -eq 1 ; then
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
+else
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
+fi
+
+scripts/check_for_zombie_jobs storage=File
+echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+run level=incremental job=CompressedTest yes
+wait
+messages
+@#
+@# now do a restore
+@#
+@$out tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+if test "$debug" -eq 1 ; then
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
+else
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
+fi
+
+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=$?
+#
+# Delete .c files because we will only restore the txt files
+#
+rm -f tmp/build/*.c
+diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+ echo " "
+ echo " "
+ echo " !!!!! differential-test Bacula source failed!!! !!!!! "
+ echo " !!!!! differential-test failed!!! !!!!! " >>test.out
+ if [ $bstat != 0 -o $rstat != 0 ] ; then
+ echo " !!!!! Bad Job termination status !!!!! "
+ echo " !!!!! Bad Job termination status !!!!! " >>test.out
+ else
+ echo " !!!!! Restored files differ !!!!! "
+ echo " !!!!! Restored files differ !!!!! " >>test.out
+ fi
+ echo " "
+else
+ echo " ===== differential-test Bacula source OK ===== "
+ echo " ===== differential-test OK ===== " >>test.out
+ scripts/cleanup
+fi
# totally full. I.e. make sure that bsr selects all tapes
# including those fully spanned.
#
+debug=1
+if test "$debug" -eq 1 ; then
+ out="tee"
+else
+ out="output"
+fi
+
cwd=`pwd`
scripts/copy-test-confs
scripts/cleanup
echo " === Starting span-vol-test at `date +%R:%S` ===" >working/log
echo " "
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
messages
-@output tmp/log1.out
-label storage=File1 volume=TestVolume001
-label storage=File1 volume=TestVolume002
-label storage=File1 volume=TestVolume003
+@$out tmp/log1.out
label storage=File1 volume=TestVolume004
-update Volume=TestVolume001 MaxVolBytes=3000000
-update Volume=TestVolume002 MaxVolBytes=3000000
+label storage=File1 volume=TestVolume003
+label storage=File1 volume=TestVolume002
+label storage=File1 volume=TestVolume001
+update Volume=TestVolume004 MaxVolBytes=3000000
update Volume=TestVolume003 MaxVolBytes=3000000
+update Volume=TestVolume002 MaxVolBytes=3000000
run job=NightlySave storage=File1 yes
wait
list volumes
@#
@# now do a restore
@#
-@output tmp/log2.out
+@$out tmp/log2.out
restore where=${cwd}/tmp/bacula-restores select storage=File1
unmark *
mark *
yes
wait
messages
-@output
+@$out
quit
END_OF_DATA
+
+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
+
scripts/check_for_zombie_jobs storage=File1
bin/bacula stop 2>&1 >/dev/null
grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
# Run a simple backup of the Bacula build directory
# then verify the catalog.
#
+debug=0
+if test "$debug" -eq 1 ; then
+ out="tee"
+else
+ out="output"
+fi
+
cwd=`pwd`
scripts/copy-test-confs
scripts/cleanup
echo " === Starting verify Volume Test at `date +%R:%S` ===" >>working/log
echo " "
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-@output /dev/null
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
messages
-@output tmp/log1.out
+@$out tmp/log1.out
setdebug level=1 storage=File sd
label storage=File volume=TestVolume001
run job=NightlySave yes
@#
@# now do a verify volume
@#
-@output ${cwd}/tmp/original
+@$out ${cwd}/tmp/original
run job=VerifyVolume
yes
wait
messages
-@output
+@$out
quit
END_OF_DATA
+
+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
+
sleep 2
scripts/check_for_zombie_jobs storage=File
bin/bacula stop 2>&1 >/dev/null