From: Eric Bollengier Date: Sun, 20 Jun 2010 09:50:35 +0000 (+0200) Subject: regress: Add prune test for copy jobs X-Git-Tag: Release-5.2.1~1251 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=307cef0a7849e21b65f3b5d9ef4f54c809952dc1;p=bacula%2Fbacula regress: Add prune test for copy jobs --- diff --git a/regress/tests/prune-copy-test b/regress/tests/prune-copy-test new file mode 100755 index 0000000000..93505f947f --- /dev/null +++ b/regress/tests/prune-copy-test @@ -0,0 +1,84 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then copy it +# to another device. +# +# This script uses the virtual disk autochanger +# +TestName="copy-job-test" +JobName=CopyJobSave +. scripts/functions + + +scripts/cleanup +scripts/copy-migration-confs +scripts/prepare-disk-changer +echo "${cwd}/build" >${cwd}/tmp/file-list +sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1 +sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf + +dircfg=$conf/bacula-dir.conf +$bperl -e "add_attribute('$dircfg', 'AutoPrune', 'No', 'Client')" +$bperl -e "add_attribute('$dircfg', 'Job Retention', '1s', 'Client')" + +change_jobname NightlySave $JobName +start_test + +# +# Note, we first backup into Pool Default, +# then Copy into Pool Full. +# Pool Default uses Storage=File +# Pool Full uses Storage=DiskChanger + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@$out /dev/null +messages +@$out ${cwd}/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 +@# run two jobs (both will be copied) +run job=$JobName yes +run job=$JobName yes +wait +list jobs +list volumes +@#setdebug level=100 dir +@# should copy two jobs +@#setdebug level=51 storage=DiskChanger +run job=copy-job yes +wait +messages +@#purge volume=FileVolume001 +list jobs +list volumes +wait +messages +@$out ${cwd}/tmp/log3.out +@# +@# Now do another backup, but level Incremental +@# +run job=$JobName level=Incremental yes +wait +messages +@# +@# This final job that runs should be Incremental and +@# not upgraded to full. +list jobs +messages +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +touch $tmp/log2.out +check_two_logs + +$bperl -e "check_job_list('$tmp/log3.out',1,3,4,5,6,7)" +estat=$(($estat + $?)) + +end_test