From 7eaa3e68f312542922233dbfe0fc9967e95e6575 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 16 Jun 2010 23:48:36 +0200 Subject: [PATCH] regress: add prune-test --- regress/tests/prune-test | 102 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 regress/tests/prune-test diff --git a/regress/tests/prune-test b/regress/tests/prune-test new file mode 100755 index 0000000000..bc556aff40 --- /dev/null +++ b/regress/tests/prune-test @@ -0,0 +1,102 @@ +#!/bin/sh +# +# This script will test prune algo with +# vtape +# +. scripts/functions + +TestName="prune-test" +JobName=NightlySave + +scripts/cleanup +scripts/copy-test-confs + +start_test + +echo $PWD/build/po > tmp/file-list + +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")' +$bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")' + +cat < ${cwd}/tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +label storage=File volume=TestVolume001 +run job=$JobName level=full yes +wait +messages +@exec "touch $cwd/build/po/fr.po" +run job=$JobName level=incremental yes +wait +messages +@exec "touch $cwd/build/po/de.po" +run job=$JobName level=incremental yes +wait +messages +@sleep 2 +@$out $tmp/log3.out +@################################################################ +@# Should not prune anything +list jobs +prune jobs yes +list jobs +@$out $tmp/log4.out +@################################################################ +@# Should prune the first incremental job +run job=$JobName level=differential yes +wait +messages +@exec "touch $cwd/build/po/es.po" +run job=$JobName level=incremental yes +wait +messages +list jobs +prune jobs yes +list jobs +@$out $tmp/log5.out +@################################################################ +@# Should prune the first Full+Diff job +run job=$JobName level=full yes +wait +messages +list jobs +prune jobs yes +list jobs +@$out $tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select all storage=File done +yes +wait +messages +@sleep 2 +@$out $tmp/log6.out +@################################################################ +@# Should prune the restore job +list jobs +prune jobs yes +list jobs +quit +EOF + +run_bacula + +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs + +estat=0 + +$bperl -e "check_job_list('$tmp/log3.out')" +estat=$(($estat + $?)) + +$bperl -e "check_job_list('$tmp/log4.out',2,3)" +estat=$(($estat + $?)) + +$bperl -e "check_job_list('$tmp/log5.out',1,4,5)" +estat=$(($estat + $?)) + +$bperl -e "check_job_list('$tmp/log6.out',7)" +estat=$(($estat + $?)) + +end_test -- 2.39.5