rm -rf ${tmp}/sed_tmp ${tmp}/file-list
rm -rf ${tmp}/*
rm -rf ${working}/log ${tmp}/TEST-*
+rm -rf ${working}/log ${tmp}/Backup-*
rm -rf ${working}/*.bsr ${working}/log*.sd
rm -rf ${working}/*.trace
rm -rf ${tmp}disk-changer
AutoPrune = yes # Prune expired volumes
Volume Retention = 365d # one year
# Label Format = "TEST-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}:${NumVols}"
+# Simple Label Format = "Backup-"
# Maximum Volume Jobs = 1
+# Maximum Volume Bytes = 512000
}
--- /dev/null
+#!/bin/sh
+#
+# Run a job with small Maximum Volume Bytes. It should
+# create a lot of volumes. The test stresses auto-creation of
+# Volumes and restores from a lot of Volumes. Note, it creates
+# writes and then reads something like 110 Volumes (will vary
+# depending on the size of the Bacula source).
+#
+TestName="maxbytes-test"
+JobName=maxbytes
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+cp -f ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
+sed "s%# Maximum Volume Bytes% Maximum Volume Bytes%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+cp -f ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
+sed "s%# Simple Label Format% Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
+
+change_jobname NightlySave $JobName
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+@#setdebug level=100 Storage=File1
+run job=$JobName level=Full Storage=File1 yes
+wait
+list volumes
+messages
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=File1
+unmark *
+mark *
+done
+yes
+wait
+@#reload
+@#reload
+messages
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File1
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test