From 95bd60e049e147ba4e547bb93ab1f509d273e7d4 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 17 Jun 2010 00:21:14 +0200 Subject: [PATCH] regress: add prune verification for base jobs --- regress/tests/prune-base-job-test | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 regress/tests/prune-base-job-test diff --git a/regress/tests/prune-base-job-test b/regress/tests/prune-base-job-test new file mode 100755 index 0000000000..204a22152e --- /dev/null +++ b/regress/tests/prune-base-job-test @@ -0,0 +1,108 @@ +#!/bin/sh +# +# Run a basejob backup of the Bacula build directory +# then restore it. +# + +TestName="prune-base-job-test" +JobName=backup +. scripts/functions +$rscripts/cleanup + +copy_test_confs +echo 's/backup_advance/base_backup/' > $tmp/s +echo 's/Name = backup/Name = backup; Base = base_backup, backup/' >> $tmp/s +sed -f $tmp/s $rscripts/bacula-dir.conf.accurate > $conf/bacula-dir.conf +rm -f $tmp/s + +sed s/all,/all,saved,/ $conf/bacula-fd.conf > tmp/1 +cp tmp/1 $conf/bacula-fd.conf + +change_jobname BackupClient1 $JobName +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")' +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")' + +p() { + echo "##############################################" >> ${cwd}/tmp/log1.out + echo "$*" >> ${cwd}/tmp/log1.out + echo "##############################################" >> ${cwd}/tmp/log2.out + echo "$*" >> ${cwd}/tmp/log2.out +} + + +echo ${cwd}/bin > ${cwd}/tmp/file-list + +start_test + +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +label volume=TestVolume001 storage=File pool=Default +messages +END_OF_DATA + +run_bacula + +################################################################ +p Now do a backup using base backup +################################################################ + +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log1.out +run job=base_backup level=base yes +wait +messages +update volume=TestVolume001 volstatus=Used +END_OF_DATA + +run_bconsole + +echo ${cwd}/build > ${cwd}/tmp/file-list + +cat <${cwd}/tmp/bconcmds +@$out $tmp/log4.out +label volume=TestVolume002 storage=File pool=Default +run job=backup level=full yes +wait +messages +@exec "touch $cwd/build/po/fr.po" +run job=backup level=incremental yes +wait +messages +@$out $tmp/log2.out +@# +@# now do a restore +@# +restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out ${cwd}/tmp/log4.out +@exec "touch $cwd/build/po/fr.po" +run job=backup level=incremental yes +wait +messages +quit +END_OF_DATA + + +run_bconsole +check_for_zombie_jobs storage=File + +check_two_logs +check_restore_diff + +export bstat dstat estat + +cat <${cwd}/tmp/bconcmds +@$out $tmp/log10.out +list jobs +prune jobs yes +list jobs +END_OF_DATA + +run_bconsole + +$bperl -e "check_job_list('$tmp/log10.out', 4)" +stop_bacula +end_test -- 2.39.5