From 2a2ddfc7c0844364bb70ed4c6a07cadb27a71f32 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 30 Jul 2009 10:59:47 +0200 Subject: [PATCH] check for purge job --- regress/tests/base-job-test | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/regress/tests/base-job-test b/regress/tests/base-job-test index 15d4100b40..be537e858a 100755 --- a/regress/tests/base-job-test +++ b/regress/tests/base-job-test @@ -11,7 +11,7 @@ $rscripts/cleanup copy_test_confs sed 's/backup_advance/base_backup/' $rscripts/bacula-dir.conf.accurate > $tmp/1 -sed 's/Name = backup/Name = backup; Base = base_backup/' $tmp/1 > $conf/bacula-dir.conf +sed 's/Name = backup/Name = backup; Base = base_backup, backup/' $tmp/1 > $conf/bacula-dir.conf sed s/all,/all,saved,/ $conf/bacula-fd.conf > tmp/1 cp tmp/1 $conf/bacula-fd.conf @@ -121,6 +121,8 @@ p Now do a third backup after making few changes ################################################################ cat <${cwd}/tmp/bconcmds @$out ${cwd}/tmp/log1.out +update volume=TestVolume002 volstatus=Used +label volume=TestVolume003 storage=File pool=Default run job=backup level=incremental yes wait messages @@ -135,7 +137,7 @@ messages END_OF_DATA rm ${cwd}/build/accurate/yyyyyy # delete a file -rmdir ${cwd}/build/accurate/dirtest +rm -rf ${cwd}/build/accurate/dirtest run_bconsole @@ -143,9 +145,33 @@ check_for_zombie_jobs storage=File check_two_logs check_restore_diff -check_files_written ${cwd}/tmp/log1.out 3 +check_files_written ${cwd}/tmp/log1.out 4 rm -rf ${cwd}/tmp/bacula-restores + +################################################################ +p Test the job purge +################################################################ +cat <${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log3.out +sql +SELECT count(*) FROM BaseFiles; + +purge volume=TestVolume002 +messages +sql +SELECT count(*) FROM BaseFiles; + +END_OF_DATA + +run_bconsole + +grep -e ' 0 *|' ${cwd}/tmp/log3.out > /dev/null +if [ $? -ne 0 ]; then + print_debug "Can't purge the base job" + dstat=2 +fi + stop_bacula end_test -- 2.39.5