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;
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
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