From a4112882a850c497cd6e1147a08d355cf394252b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 7 Jul 2007 14:16:48 +0000 Subject: [PATCH] Add a new recycle test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5127 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/all-non-root-tests | 1 + regress/scripts/bacula-dir-tape.conf.in | 1 + regress/tests/migration-job-test | 3 +- regress/tests/three-pool-recycle-test | 106 ++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 1 deletion(-) create mode 100755 regress/tests/three-pool-recycle-test diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests index 2459a0c746..4a3efeb7e9 100755 --- a/regress/all-non-root-tests +++ b/regress/all-non-root-tests @@ -51,6 +51,7 @@ nice tests/hardlink-test nice tests/tls-test # # The following are Virtual Disk Autochanger tests +nice tests/three-pool-recycle-test nice tests/two-pool-test nice tests/fast-two-pool-test nice tests/two-volume-test diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in index f629355929..34c7bdcfb3 100644 --- a/regress/scripts/bacula-dir-tape.conf.in +++ b/regress/scripts/bacula-dir-tape.conf.in @@ -236,4 +236,5 @@ Pool { Recycle = yes # Bacula can automatically recycle Volumes AutoPrune = yes # Prune expired volumes Volume Retention = 365d # one year + Recycle Pool = Scratch # recycle back here } diff --git a/regress/tests/migration-job-test b/regress/tests/migration-job-test index 5600afb093..9661a60f8e 100755 --- a/regress/tests/migration-job-test +++ b/regress/tests/migration-job-test @@ -29,6 +29,7 @@ cat <tmp/bconcmds @output messages @$out tmp/log1.out +setdebug level=100 storage=File label storage=File volume=FileVolume001 Pool=Default label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0 @@ -40,7 +41,7 @@ list jobs list volumes @#setdebug level=100 dir @# should migrate two jobs -setdebug level=51 storage=DiskChanger +@#setdebug level=51 storage=DiskChanger run job=migrate-job yes wait messages diff --git a/regress/tests/three-pool-recycle-test b/regress/tests/three-pool-recycle-test new file mode 100755 index 0000000000..7f1557a169 --- /dev/null +++ b/regress/tests/three-pool-recycle-test @@ -0,0 +1,106 @@ +#!/bin/sh +# +# This is Arno's test. It uses three pools, three tapes, and +# an autochanger. Note, the Director has four Pools in its +# conf: Default, Full, Inc, and Scratch. Default is used in the +# NightlySave job by default. What is backed up is what +# is in /tmp/file-list, which is by default the Bacula +# source code (i.e. the build directory). +# +# Note, we use the virtual disk autochanger. +# +TestName="three-pool-recycle-test" +JobName=Three-pool-recycle +. scripts/functions + +cwd=`pwd` +scripts/cleanup +scripts/copy-2disk-confs +scripts/prepare-two-disks + +# remove Client Run Before Job +cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1 +sed "s%Client Run Before Job%#Client Run Before Job%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf + +echo "${cwd}/build" >/tmp/file-list + +start_test + +# Write out bconsole commands to a file +cat <tmp/bconcmds +@output /dev/null +messages +@$out tmp/log1.out +@#setdebug level=150 storage=DDS-4 +label storage=DDS-4 volume=TestVolume001 slot=1 pool=Full drive=0 +label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0 +label storage=DDS-4 volume=TestVolume003 slot=3 pool=Scratch drive=0 +update Volume=TestVolume001 maxvoljobs=1 +update Volume=TestVolume002 maxvoljobs=1 +update Volume=TestVolume003 volretention=7s +update Volume=TestVolume003 maxvoljobs=1 +list volumes +llist volume=TestVolume003 +@# should pull Scratch volume +run job=NightlySave1 level=Full pool=Inc yes +wait +update Volume=TestVolume003 volretention=7s +update Volume=TestVolume003 maxvoljobs=1 +messages +list volumes +llist volume=TestVolume003 +run job=NightlySave1 level=Full pool=Default yes +wait +messages +list volumes +llist volume=TestVolume003 +run job=NightlySave1 level=Full pool=Full yes +wait +@sleep 10 +messages +list volumes +llist volume=TestVolume003 +@# should recycle Scratch pool +run job=NightlySave2 level=Full pool=Inc yes +wait +update Volume=TestVolume003 volretention=7s +update Volume=TestVolume003 maxvoljobs=1 +@sleep 10 +messages +list volumes +@# should recycle Scratch pool +llist volume=TestVolume003 +@#setdebug level=50 dir +run job=NightlySave2 level=Full pool=Default yes +wait +update Volume=TestVolume003 volretention=7s +update Volume=TestVolume003 maxvoljobs=1 +@sleep 10 +messages +list volumes +@# should recycle Scratch pool +run job=NightlySave2 level=Full pool=Full yes +status storage=DDS-4 +messages +wait +list volumes +messages +@# +@# now do a restore +@# +@$out tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done +yes +wait +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 -- 2.39.5