]> git.sur5r.net Git - bacula/bacula/commitdiff
check for purge job
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 30 Jul 2009 08:59:47 +0000 (10:59 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 3 Aug 2009 14:39:19 +0000 (16:39 +0200)
regress/tests/base-job-test

index 15d4100b40ed65a3590eb35162312b9139037409..be537e858a35664f97de4d0e67158bb47af68638 100755 (executable)
@@ -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 <<END_OF_DATA >${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 <<END_OF_DATA >${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