select VolumeName, VolStatus, ActionOnPurge FROM Media;
setdebug level=100 director
+messages
wait
quit
END_OF_DATA
select Name, ActionOnPurge FROM Pool;
wait
+messages
quit
END_OF_DATA
estat=7
fi
+# Now test if the truncate command truncates labeled Volumes
+cat >tmp/bconcmds <<END_OF_DATA
+truncate allpools storage=File
+messages
+wait
+@$out $tmp/log6.out
+@# These truncates should not truncate any Volumes
+truncate allpools storage=File
+truncate allpools storage=File
+truncate allpools storage=File
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+stop_bacula
+
+grep "has been truncated" $tmp/log6.out >$tmp/log7.out
+if [ $? = 0 ] ; then
+ cat $tmp/log7.out
+ print_debug "ERROR 8: truncated volumes are truncated multiple times"
+ estat=8
+fi
+
end_test