From 079fb12544dbab6a4d019303edb2cc11d2641c5b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 3 Oct 2009 15:38:17 +0200 Subject: [PATCH] Add a MaxVolBytes test that create over 100 Vols --- regress/scripts/cleanup | 1 + regress/scripts/new-test-bacula-dir.conf.in | 2 + regress/tests/maxbytes-test | 56 +++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100755 regress/tests/maxbytes-test diff --git a/regress/scripts/cleanup b/regress/scripts/cleanup index b74b91a084..bccd1ea9cd 100755 --- a/regress/scripts/cleanup +++ b/regress/scripts/cleanup @@ -9,6 +9,7 @@ rm -rf ${tmp}/TestVolume001 ${tmp}bacula-restores ${tmp}/Small* 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 diff --git a/regress/scripts/new-test-bacula-dir.conf.in b/regress/scripts/new-test-bacula-dir.conf.in index 4a8e9a8d6c..3fe97c7d68 100644 --- a/regress/scripts/new-test-bacula-dir.conf.in +++ b/regress/scripts/new-test-bacula-dir.conf.in @@ -486,5 +486,7 @@ Pool { 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 } diff --git a/regress/tests/maxbytes-test b/regress/tests/maxbytes-test new file mode 100755 index 0000000000..8b9ea83f4b --- /dev/null +++ b/regress/tests/maxbytes-test @@ -0,0 +1,56 @@ +#!/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 <${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 -- 2.39.5