echo " " >>test.out
echo "Start all non-root tape tests"
echo "Start all non-root tape tests" >>test.out
+nice tests/ansi-label-tape
nice tests/backup-bacula-tape
nice tests/btape-fill-tape
nice tests/fixed-block-size-tape
--- /dev/null
+#
+# Default Bacula Storage Daemon Configuration file
+#
+# For Bacula release 2.2
+#
+# You may need to change the name of your tape drive
+# on the "Archive Device" directive in the Device
+# resource. If you change the Name and/or the
+# "Media Type" in the Device resource, please ensure
+# that dird.conf has corresponding changes.
+#
+
+Storage { # definition of myself
+ Name = @hostname@-sd
+ SDPort = 8103 # Director's port
+ WorkingDirectory = "@working_dir@"
+ Pid Directory = "@piddir@"
+ Subsys Directory = "@subsysdir@"
+}
+
+#
+# List Directors who are permitted to contact Storage daemon
+#
+Director {
+ Name = @hostname@-dir
+ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+}
+
+#
+# Devices supported by this Storage daemon
+# To connect, the Director's bacula-dir.conf must have the
+# same Name and MediaType.
+#
+
+Device {
+ Name = DDS-4 #
+ Media Type = DDS-4
+ Archive Device = @tape_drive@
+ AutomaticMount = yes; # when device opened, read it
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+ @@sbindir@/tape_options
+# Maximum File Size = 1000000
+# MaximumVolumeSize = 400M
+ Label Type = ansi
+}
+
+#
+# Send all messages to the Director,
+# mount messages also are sent to the email address
+#
+Messages {
+ Name = Standard
+ director = @hostname@-dir = all, !terminate
+}
sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxtime.in >${cwd}/scripts/bacula-dir.conf.maxtime
sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf
sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
+sed -f ${out} ${cwd}/scripts/testb-bacula-dir.conf.in >${cwd}/scripts/testb-bacula-dir.conf
sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
sed -f ${out} ${cwd}/scripts/bacula-dir-migration.conf.in >${cwd}/scripts/bacula-dir-migration.conf
sed -f ${out} ${cwd}/scripts/win32-bacula-dir-tape.conf.in >${cwd}/scripts/win32-bacula-dir-tape.conf
sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
+sed -f ${out} ${cwd}/scripts/ansi-sd-tape.conf.in >${cwd}/scripts/ansi-sd-tape.conf
sed -f ${out} ${cwd}/scripts/bacula-sd-fifo.conf.in >${cwd}/scripts/bacula-sd-fifo.conf
sed -f ${out} ${cwd}/scripts/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf
sed -f ${out} ${cwd}/scripts/bacula-sd-migration.conf.in >${cwd}/scripts/bacula-sd-migration.conf
--- /dev/null
+#
+# TestA Bacula Director Configuration file
+#
+# For Bacula release 2.2.x
+#
+
+Director { # define myself
+ Name = @hostname@-dir
+ DIRport = 8101 # where we listen for UA connections
+ QueryFile = "@scriptdir@/query.sql"
+ WorkingDirectory = "@working_dir@"
+ PidDirectory = "@piddir@"
+ SubSysDirectory = "@subsysdir@"
+ Maximum Concurrent Jobs = 20
+ Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password
+ Messages = Standard
+}
+
+
+Job {
+ Name = "MultiVol"
+ Type = Backup
+ Client=@hostname@-fd
+ Level = Full
+ FileSet="Full Set"
+ Storage = File
+ Messages = Standard
+ Write Bootstrap = "@working_dir@/SmallVols.bsr"
+ Pool = SmallVols
+ SpoolData = yes
+ Maximum Concurrent Jobs = 20
+}
+
+
+Job {
+ Name = "VerifyVolume"
+ Type = Verify
+ Level = VolumeToCatalog
+ Client=@hostname@-fd
+ FileSet="Full Set"
+ Storage = File
+ Messages = Standard
+ Pool = Default
+ Write Bootstrap = "@working_dir@/NightlySave.bsr"
+}
+
+
+
+# Standard Restore template, to be changed by Console program
+Job {
+ Name = "RestoreFiles"
+ Type = Restore
+ Client=@hostname@-fd
+ FileSet="Full Set"
+ Storage = File
+ Messages = Standard
+ Pool = Default
+ Where = /tmp/bacula-restores
+}
+
+
+# List of files to be backed up
+FileSet {
+ Name = "Full Set"
+ Include { Options { signature=SHA1 }
+ File =</tmp/file-list
+ }
+}
+
+
+# Client (File Services) to backup
+Client {
+ Name = @hostname@-fd
+ Address = @hostname@
+ FDPort = 8102
+ Catalog = MyCatalog
+ Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
+ File Retention = 30d # 30 days
+ Job Retention = 180d # six months
+ AutoPrune = yes # Prune expired Jobs/Files
+ Maximum Concurrent Jobs = 20
+}
+
+# Definiton of file storage device
+Storage {
+ Name = File
+ Address = @hostname@ # N.B. Use a fully qualified name here
+ SDPort = 8103
+ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+ Device = FileStorage
+ Media Type = File
+ Maximum Concurrent Jobs = 20
+}
+
+Storage {
+ Name = File1
+ Address = @hostname@ # N.B. Use a fully qualified name here
+ SDPort = 8103
+ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
+ Device = FileStorage1
+ Media Type = File1
+ Maximum Concurrent Jobs = 20
+}
+
+
+# Generic catalog service
+Catalog {
+ Name = MyCatalog
+ dbname = regress; user = regress; password = ""
+}
+
+# Reasonable message delivery -- send most everything to email address
+# and to the console
+Messages {
+ Name = Standard
+ mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: %t %e of %c %l\" %r"
+ operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: Intervention needed for %j\" %r"
+ MailOnError = @job_email@ = all, !terminate
+ operator = @job_email@ = mount
+ console = all, !skipped, !terminate
+
+ append = "@working_dir@/log" = all, !skipped
+}
+
+Messages {
+ Name = NoEmail
+ mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: %t %e of %c %l\" %r"
+ console = all, !skipped, !terminate, !restored
+ append = "@working_dir@/log" = all, !skipped
+}
+
+
+# Default pool definition
+Pool {
+ Name = Default
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+}
+
+Pool {
+ Name = SmallVols
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+ Maximum Volumes = 100
+ MaximumVolumeBytes = 10M
+ LabelFormat = Small
+}
--- /dev/null
+#!/bin/sh
+#
+# Test of ANSI labeled tapes
+#
+# Run a simple backup of the Bacula build directory
+# to a tape then restore it, we do that twice to ensure that
+# we can correctly append to a tape.
+# We also use the purge and the relabel commands as
+# well as a pile of status storage commands.
+#
+TestName="ansi-label-tape"
+JobName=backuptape
+. scripts/functions
+
+scripts/copy-tape-confs
+/bin/cp -f scripts/ansi-sd-tape.conf bin/bacula-sd.conf
+scripts/cleanup-tape
+
+echo "${cwd}/build" >/tmp/file-list
+
+change_jobname NightlySave $JobName
+start_test
+
+# Write out bconsole commands
+cat <<END_OF_DATA >tmp/bconcmds
+@output /dev/null
+messages
+@$out tmp/log1.out
+@#setdebug level=200 storage=DDS-4
+label storage=DDS-4 volume=Vol001 slot=0 pool=Default
+purge volume=Vol001
+relabel pool=Default storage=DDS-4 oldVolume=Vol001 volume=Vol002 slot=0
+purge volume=Vol002
+relabel pool=Default storage=DDS-4 oldVolume=Vol002 volume=Vol001 slot=0
+run job=$JobName yes
+status storage=DDS-4
+@sleep 1
+wait
+messages
+@#
+@# now do a restore
+@#
+@$out tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+list volumes
+messages
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+#
+# Now do a second backup after making a few changes
+#
+touch ${cwd}/build/src/dird/*.c
+echo "test test" > ${cwd}/build/src/dird/xxx
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+list volumes
+setdebug level=300 storage=DDS-4
+run job=$JobName yes
+wait
+list volumes
+messages
+@#
+@# now do a second restore
+@#
+@$out tmp/log2.out
+list volumes
+restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
+yes
+wait
+list volumes
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=DDS-4
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test
scripts/cleanup
scripts/copy-testa-confs
+/bin/cp -f scripts/testb-bacula-dir.conf bin/bacula-dir.conf
echo "${cwd}/tmp/largefile" >/tmp/file-list
# Create 56MB file with random data
echo "Creating a 56MB file with random data ..."
messages
@$out tmp/log1.out
run job=$JobName storage=File yes
+run job=$JobName storage=File yes
+run job=$JobName storage=File yes
+run job=$JobName storage=File yes
+run job=$JobName storage=File yes
wait
list volumes
messages