X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fnext-vol-test;h=5ce035252c3d51ef8d558239b26fc42284581d0b;hb=576f41b2d1830dc7de53214e2fcf2365244f0531;hp=fce14d03b54def195fdca34c8085daec9d917112;hpb=511f1874d642cb9ae855c1b3445a9ea070e6a479;p=bacula%2Fbacula diff --git a/regress/tests/next-vol-test b/regress/tests/next-vol-test index fce14d03b5..5ce035252c 100755 --- a/regress/tests/next-vol-test +++ b/regress/tests/next-vol-test @@ -28,6 +28,9 @@ cat < ${cwd}/tmp/bconcmds @$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 @@ -39,7 +42,7 @@ purge volume=vol46 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 @@ -48,11 +51,12 @@ update volume=vol48 inchanger=no pool=Test 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 @@ -66,7 +70,7 @@ cat < ${cwd}/tmp/bconcmds 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 @@ -78,13 +82,13 @@ list volume 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 @@ -104,13 +108,13 @@ list volume 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 @@ -122,6 +126,7 @@ messages @#wait @#message @#list volume +quit EOF run_bconsole @@ -133,7 +138,6 @@ if [ "$debug" -eq 1 ]; then else diff tmp/normal tmp/real > /dev/null fi - dstat=$? @@ -151,6 +155,9 @@ label volume=file8 storage=File pool=Test 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 @@ -164,7 +171,6 @@ update volume=file9 volstatus=Recycle 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'; @@ -249,6 +255,7 @@ run level=full pool=Test storage=File NightlySave yes wait message list volume +wait quit EOF @@ -261,8 +268,13 @@ if [ "$debug" -eq 1 ]; then 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 @@ -275,7 +287,8 @@ update volume=vol48 pool=Test VolStatus=Used VolRetention=10s inchanger=no Recyc 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 @@ -290,7 +303,7 @@ if [ $? -ne 0 ]; then bstat=$? fi -check_for_zombie_jobs storage=LTO3 +check_for_zombie_jobs storage=LTO3 client=${HOST}-fd stop_bacula check_two_logs