]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add tests for unprotection
authorEric Bollengier <eric@baculasystems.com>
Fri, 31 Mar 2023 15:02:52 +0000 (17:02 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:01 +0000 (13:57 +0200)
regress/tests/read-only-volume-test

index a4e83ba0b9580decb0dc706288fac83b9a1f02f5..851fef00abdfeba67d132d6c74f05ac9031e67f7 100755 (executable)
@@ -35,6 +35,7 @@ $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeBytes', '50MB',
 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'MaximumVolumeJobs', '1', 'Pool')"
 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'VolumeRetention', '20s', 'Pool', 'Default')"
 $bperl -e "add_attribute('$conf/bacula-dir.conf', 'LabelFormat', 'Default', 'Pool', 'Default')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'ActionOnPurge', 'Truncate', 'Pool')"
 
 cat <<EOF >> $conf/bacula-dir.conf
 Pool {
@@ -47,6 +48,7 @@ Pool {
   MaximumVolumeBytes = 50MB
   MaximumVolumeJobs = 1
   LabelFormat = Test1
+  ActionOnPurge = Truncate
 }
 
 Job {
@@ -186,14 +188,10 @@ llist volume=Default0017
 @exec "stat $tmp/Default0017"
 @$out $tmp/vol9.out
 run job=$JobName level=Full storage=File2 pool=Test1 yes
-wait
-messages
 quit
 END_OF_DATA
 
 run_bacula
-check_for_zombie_jobs storage=File1
-stop_bacula
 
 $bperl -e 'my @r = stat("$tmp/Vol-0001"); exit (($r[2] & 07777 & 0400) && $r[8] > $r[9] && $r[7] > 1000*1000*49);'
 if [ $? -ne 1 ]; then
@@ -259,6 +257,28 @@ $bperl -e 'check_protect("$tmp/vol8.out", "Test10018", "Used", 1, 1, 10)'
 if [ $? != 0 ]; then
     estat=1
 fi
+
+
+cat <<END_OF_DATA >$tmp/bconcmds
+@$out $tmp/vol9.out
+wait
+messages
+time
+@exec "stat $tmp/Test10018"
+purge volume=Test10018 yes
+truncate volume=Test10018 storage=File2 yes
+@sleep 11
+truncate volume=Test10018 storage=File2 yes
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+check_for_zombie_jobs storage=File1
+
+stop_bacula
+
 check_two_logs
 check_restore_diff
 end_test