tests/decremental-test
tests/restore-disk-seek-test
tests/query-test
+tests/auto-label-test
echo " "
echo " "
echo "Test results"
--- /dev/null
+#!/bin/sh
+./all-non-root-tests
rm -rf /tmp/sed_tmp /tmp/file-list
rm -rf tmp/build tmp/restore-list tmp/restore2-list
rm -rf tmp/fd.out tmp/dir.out tmp/sd.out
-rm -rf working/log
+rm -rf working/log tmp/TEST-*
+
+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 ..
#
# Cleanup left over files -- both before and after test run
#
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
-rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
-rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
+scripts/cleanup
if ! test x@autochanger@ = x/dev/null; then
drive=`bin/mtx-changer @autochanger@ loaded`
#
# Cleanup left over files -- both before and after test run
#
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
-rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
-rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
+scripts/cleanup
mt -f @tape_drive@ rewind
mt -f @tape_drive@ weof
if test x`uname` = xLinux ; then \
cp -f scripts/linux_tape_options bin/tape_options ; \
fi
-if test x`uname` = xFreeBsd ; then \
+if test x`uname` = xFreeBSD ; then \
cp -f scripts/freebsd_tape_options bin/tape_options ; \
fi
+#
+# FreeBSD tape drive options
+#
Hardware End of Medium = no
Fast Forward Space File = no
BSF at EOM = yes
-# nothing needed
+# nothing needed for Linux
AutoPrune = yes # Prune expired volumes
Volume Retention = 365d # one year
Accept Any Volume = yes # write on any volume in the pool
+# Label Format = "TEST-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}:${NumVols}"
}
--- /dev/null
+#!/bin/sh
+./all-non-root-tape-tests
--- /dev/null
+#!/bin/sh
+#
+# Test if Bacula can automatically create a Volume label.
+#
+cwd=`pwd`
+scripts/copy-test-confs
+scripts/cleanup
+echo "${cwd}/build" >/tmp/file-list
+
+cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
+sed "s%# Label Format% Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+
+echo " "
+echo " "
+echo " === Starting auto-label-test ==="
+echo " === Starting auto-label-test ===" >>working/log
+echo " "
+
+bin/bacula start 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+@output /dev/null
+status all
+status all
+list pools
+messages
+@output tmp/log1.out
+run job=CompressedTest storage=File yes
+list pools
+list volumes
+wait
+messages
+@#
+@# now do a restore
+@#
+@output tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=File
+unmark *
+mark *
+done
+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=$?
+diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
+if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
+ echo " "
+ echo " "
+ echo " !!!!! auto-label-test failed!!! !!!!! "
+ echo " !!!!! auto-label-test failed!!! !!!!! " >>test.out
+ echo " "
+else
+ echo " ===== auto-label-test OK ===== "
+ echo " ===== auto-label-test OK ===== " >>test.out
+ scripts/cleanup
+fi
# 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
-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 " "
yes
wait
messages
-@#
-@# Now do a second backup
-@#
+END_OF_DATA
+bin/bacula stop 2>&1 >/dev/null
+#
+# Now do a second backup after making a few changes
+#
+touch ${cwd}/build/src/dird/*.c
+echo "test test" > ${cwd}/build/src/dird/xxx
+bin/bacula start 2>&1 >/dev/null
+bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
@output /dev/null
messages
@output tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0
run job=NightlySave yes
wait
messages
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=$?
cwd=`pwd`
scripts/copy-confs
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 " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
# It should require at least 4 different bsrs.
#
cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
scripts/copy-tape-confs
scripts/cleanup-tape
echo "${cwd}/build" >/tmp/file-list
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
+
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
bin/bacula stop 2>&1 >/dev/null
echo "volume=TestVolume001" >tmp/bscan.bsr
-bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf /dev/nst0 2>&1 >/dev/null
+bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
bin/bacula start 2>&1 >/dev/null
bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
@output /dev/null
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
--- /dev/null
+#!/bin/sh
+#
+# Test the fill command in btape
+#
+cwd=`pwd`
+scripts/copy-tape-confs
+scripts/cleanup-tape
+
+echo " "
+echo " "
+echo " === Starting btape fill test ==="
+echo " === Starting btape fill test ===" >>working/log
+echo " "
+
+bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
+fill
+s
+
+quit
+END_OF_DATA
+
+
+grep "^The last block on the tape matches\. Test succeeded\." tmp/log1.out 2>&1 >/dev/null
+if [ $? != 0 ] ; then
+ echo " "
+ echo " "
+ echo " !!!!! btape fill test failed!!! !!!!! "
+ echo " !!!!! btape fill test failed!!! !!!!! " >>test.out
+ echo " "
+else
+ echo " ===== btape fill test OK ===== "
+ echo " ===== btape fill test OK ===== " >>test.out
+# scripts/cleanup
+fi
# Test the fill command in btape
#
cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
scripts/copy-tape-confs
scripts/cleanup-tape
+
echo "${cwd}/build" >/tmp/file-list
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
+
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# MaximumVolumeSize% MaximumVolumeSize%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
fi
echo "largefile created"
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
cd ${cwd}
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
# sizes.
#
cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
scripts/copy-tape-confs
scripts/cleanup-tape
-echo "${cwd}/build" >/tmp/file-list
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
+
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
echo "s%# Maximum Block Size% Maximum Block Size%" >${cwd}/tmp/2
echo "s%# Minimum Block Size% Minimum Block Size%" >>${cwd}/tmp/2
# Run two jobs at the same time
#
cwd=`pwd`
-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 2>&1 >/dev/null
-cd ..
scripts/copy-tape-confs
scripts/cleanup-tape
+
echo "${cwd}/build" >/tmp/file-list
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
# It should require at least 4 different bsrs.
#
cwd=`pwd`
-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 2>&1 >/dev/null
-cd ..
scripts/copy-tape-confs
scripts/cleanup-tape
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
# new files, do an Incremental and restore those two files.
#
cwd=`pwd`
-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 2>&1 >/dev/null
-cd ..
scripts/copy-tape-confs
scripts/cleanup-tape
echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
cd ${cwd}
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
cd ${cwd}
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
# are created during each of the two backups.
#
cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
scripts/copy-tape-confs
scripts/cleanup-tape
echo "${cwd}/build" >/tmp/file-list
sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
+
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
sed s%\^%${cwd}/tmp/build/% 1 >restore-list
rm -f 1
cd ${cwd}
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
rm -rf ${cwd}/tmp/build
mkdir ${cwd}/tmp/build
cp -fp ${cwd}/build/src/dird/* ${cwd}/tmp/build
-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 2>&1 >/dev/null
-cd ..
# Enable MaximumFileSize
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
echo "Creating a 56MB file with random data ..."
dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
echo "largefile created"
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
# to a tape where the maximum tape file size is set to 1M
#
cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
scripts/copy-tape-confs
scripts/cleanup-tape
+
echo "${cwd}/build" >/tmp/file-list
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
scripts/copy-test-confs
scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
#
echo "${cwd}/weird-files" >/tmp/file-list
echo "${cwd}/weird-files" >>/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "
rm -rf weird-files2
cp -Rp weird-files weird-files2
echo "${cwd}/weird-files2" >/tmp/file-list
-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 2>&1 >/dev/null
-cd ..
echo " "
echo " "