From: Eric Bollengier Date: Sun, 18 Oct 2009 09:30:39 +0000 (+0000) Subject: Add test when ActionOnPurge=None X-Git-Tag: Release-5.0.0~282^2~13^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9369eb5706910fba8bf36adcf6925e7dd4708eb1;p=bacula%2Fbacula Add test when ActionOnPurge=None Add test for update volume=xxx actiononpurge=yyy --- diff --git a/regress/tests/action-on-purge-test b/regress/tests/action-on-purge-test index f4ca202471..7550b7bda1 100755 --- a/regress/tests/action-on-purge-test +++ b/regress/tests/action-on-purge-test @@ -29,11 +29,28 @@ restore where=${cwd}/tmp/bacula-restores select all storage=File done yes wait messages +@######################################################### @# Test ActionOnPurge=Truncate Volume size should be small +@######################################################### @$out $tmp/log3.out purge volume=TestVolume001 messages show pool +update volume=TestVolume001 volstatus=Read-Only +@$out $tmp/log1.out +label storage=File volume=TestVolume002 +run job=$JobName yes +wait +messages +@######################################################### +@# Test ActionOnPurge=Truncate, then update it to None +@# Volume size should be normal +@######################################################### +update volume=TestVolume002 actiononpurge=none +purge volume=TestVolume002 +@######################################################### +@# Display catalog settings for Pool and Media +@######################################################### @$out $tmp/log4.out sql select VolumeName, ActionOnPurge FROM Media; @@ -55,6 +72,12 @@ if [ $? != 0 ]; then bstat=2 fi +perl -e "die 'Volume size too small' if (-s '$tmp/TestVolume002' < 4096)" +if [ $? != 0 ]; then + print_debug `ls -l $tmp/TestVolume002` + bstat=2 +fi + print_debug "Test if Pool record is ok" r=`awk '/Default/ { print $4 }' $tmp/log4.out` if [ "$r" != 1 ]; then @@ -62,11 +85,18 @@ if [ "$r" != 1 ]; then bstat=2 fi -print_debug "Test if Media record is ok" +print_debug "Test TestVolume001 if Media record is ok" r=`awk '/TestVolume001/ { print $4 }' $tmp/log4.out` if [ "$r" != 1 ]; then print_debug "ActionOnPurge on Media record should be 1" bstat=2 fi +print_debug "Test TestVolume002 if Media record is ok" +r=`awk '/TestVolume002/ { print $4 }' $tmp/log4.out` +if [ "$r" != 0 ]; then + print_debug "ActionOnPurge on Media record should be 0" + bstat=2 +fi + end_test