From 777e155f860e9ead86f18f5915ed6ed4b74e9922 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 18 Oct 2009 09:30:39 +0000 Subject: [PATCH] Add test when ActionOnPurge=None Add test for update volume=xxx actiononpurge=yyy --- regress/tests/action-on-purge-test | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) 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 -- 2.39.5