4 TestName="action-on-purge-test"
10 scripts/copy-test-confs
12 echo $src > $tmp/file-list
13 sed 's/Pool Type = Backup/Pool Type = Backup; ActionOnPurge = Truncate/' $conf/bacula-dir.conf > $tmp/1
14 cp $tmp/1 $conf/bacula-dir.conf
16 change_jobname CompressedTest $JobName
19 cat >tmp/bconcmds <<END_OF_DATA
23 label storage=File volume=TestVolume001
28 restore where=${cwd}/tmp/bacula-restores select all storage=File done
32 @# Test ActionOnPurge=Truncate Volume size should be small
34 purge volume=TestVolume001
39 select VolumeName, ActionOnPurge FROM Media;
40 select Name, ActionOnPurge FROM Pool;
46 check_for_zombie_jobs storage=File
52 perl -e "die 'Volume size too big' if (-s '$tmp/TestVolume001' > 4096)"
54 print_debug `ls -l $tmp/TestVolume001`
58 print_debug "Test if Pool record is ok"
59 r=`awk '/Default/ { print $4 }' $tmp/log4.out`
60 if [ "$r" != 1 ]; then
61 print_debug "ActionOnPurge on Pool record should be 1"
65 print_debug "Test if Media record is ok"
66 r=`awk '/TestVolume001/ { print $4 }' $tmp/log4.out`
67 if [ "$r" != 1 ]; then
68 print_debug "ActionOnPurge on Media record should be 1"