@$out ${cwd}/tmp/log.out
label barcodes storage=LTO3 slots=46-59 drive=0 pool=Scratch
yes
+sql
+update Media SET FirstWritten='2006-01-01 01:00:00', LastWritten='2006-01-01 01:00:00';
+
update volume=vol47 pool=Test inchanger=no RecyclePool=Test
update volume=vol59 pool=Test enabled=no
update volume=vol58 pool=Test volstatus=Recycle
update volume=vol46 pool=Test
update volume=vol54 volstatus=Recycle
purge volume=vol53
-update volume=vol52 MaxVolJobs=1
+update volume=vol52 MaxVolJobs=1 volretention=15
update volume=vol51 inchanger=no volstatus=Recycle
purge volume=vol50
update volume=vol50 inchanger=no
update volume AllFromPool=Test
sql
update Media SET VolJobs=1 WHERE VolumeName='vol52';
-update Media SET LastWritten='2006-01-01 01:00:00';
update Media SET LastWritten='2006-01-01 01:00:01' WHERE VolumeName='vol57';
update Media SET LastWritten='2006-01-01 01:00:02' WHERE VolumeName='vol53';
-list volume
+list volumes
+wait
+quit
EOF
run_bacula
run level=full pool=Test NightlySave yes
wait
message
-list volume
+list volumes
@# Must choose vol58
@# Pool + Recycled + Enabled + InChanger
run level=full pool=Test NightlySave yes
run level=full pool=Test NightlySave yes
wait
message
-list volume
+list volumes
@# Must choose vol55
@# Pool + Full + Recycle + Enabled + InChanger
run level=full pool=Test NightlySave yes
wait
message
-list volume
+list volumes
@# Must choose vol54
@# No more in Test pool, get from scratch
@# vol52 is Append, but have 1 job and MaxJob
run level=full pool=Test NightlySave yes
wait
message
-list volume
+list volumes
@# Must choose vol53
@# Scratch + Purged + Enabled + InChanger + LastW
run level=full pool=Test NightlySave yes
wait
-message
-list volume
+messages
+list volumes
restore fileset="Full Set" pool=Test where=${cwd}/tmp/bacula-restores select all done
yes
wait
@#wait
@#message
@#list volume
+quit
EOF
run_bconsole
else
diff tmp/normal tmp/real > /dev/null
fi
-
dstat=$?
label volume=file9 storage=File pool=Scratch
label volume=file10 storage=File pool=Scratch
label volume=file11 storage=File pool=Test
+sql
+update Media SET FirstWritten='2006-01-01 01:00:00', LastWritten='2006-01-01 01:00:00';
+
update volume=file2 enabled=no
update volume=file3 volstatus=Recycle
@# volstatus=Purged
purge volume=file11
sql
update Media SET VolJobs=1 WHERE VolumeName='file9';
-update Media SET LastWritten='2006-01-01 01:00:00';
update Media SET LastWritten='2006-01-01 01:00:01' WHERE VolumeName='file4';
update Media SET LastWritten='2006-01-01 01:00:02' WHERE VolumeName='file7';
wait
message
list volume
+wait
quit
EOF
else
diff tmp/normal4 tmp/real4 > /dev/null
fi
-
-dstat=`expr $? + $dstat`
+if [ $dstat -eq 0 ] ; then
+ dstat=$?
+ if [ $dstat -ne 0 ] ; then
+ echo "normal4 and real4 differ!!!!!"
+ echo "normal4 and real4 differ!!!!!" >>test.out
+ fi
+fi
# try to break the old code
# in this situation, we have 1 available volume (vol50) and bacula will try to use
update volume=vol49 pool=Test VolStatus=Used VolRetention=10s inchanger=no RecyclePool=Test
update volume=vol50 pool=Test VolStatus=Used VolRetention=10s inchanger=yes RecyclePool=Test
sql
-update Media SET LastWritten='2005-01-01 01:00:00' WHERE VolumeName IN ('vol47', 'vol48', 'vol49');
+update Media SET FirstWritten='2005-01-01 01:00:00', LastWritten='2005-01-01 01:00:00'
+WHERE VolumeName IN ('vol47', 'vol48', 'vol49');
list volume
run level=full pool=Test NightlySave yes
bstat=$?
fi
-check_for_zombie_jobs storage=LTO3
+check_for_zombie_jobs storage=LTO3 client=${HOST}-fd
stop_bacula
check_two_logs