From: Eric Bollengier Date: Wed, 29 Oct 2008 13:56:44 +0000 (+0000) Subject: ebl Update next-vol test with disk volume X-Git-Tag: Release-7.0.0~3825 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=511f1874d642cb9ae855c1b3445a9ea070e6a479;p=bacula%2Fbacula ebl Update next-vol test with disk volume git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7937 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/tests/next-vol-test b/regress/tests/next-vol-test index 4818098425..fce14d03b5 100755 --- a/regress/tests/next-vol-test +++ b/regress/tests/next-vol-test @@ -33,7 +33,7 @@ update volume=vol59 pool=Test enabled=no update volume=vol58 pool=Test volstatus=Recycle purge volume=vol57 update volume=vol56 pool=Test -update volume=vol55 pool=Test volstatus=Full volretention=15 +update volume=vol55 pool=Test volstatus=Full update volume=vol46 volstatus=Full volretention=15 purge volume=vol46 update volume=vol46 pool=Test @@ -51,6 +51,7 @@ 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 EOF @@ -135,6 +136,134 @@ fi dstat=$? + +# so some tests with File media +cat < ${cwd}/tmp/bconcmds +@$out ${cwd}/tmp/log3.out +label volume=file1 storage=File pool=Test +label volume=file2 storage=File pool=Test +label volume=file3 storage=File pool=Test +label volume=file4 storage=File pool=Scratch +label volume=file5 storage=File pool=Test +label volume=file6 storage=File pool=Test +label volume=file7 storage=File pool=Scratch +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 +update volume=file2 enabled=no +update volume=file3 volstatus=Recycle +@# volstatus=Purged +purge volume=file4 +update volume=file5 recycle=no volretention=1 +update volume=file6 volstatus=Full volretention=15 +update volume=file7 volstatus=Full volretention=15 +purge volume=file7 +update volume=file8 pool=Test VolRetention=1 +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'; + +messages +@$out ${cwd}/tmp/log4.out +list volume +messages +@# Must choose file1 +@# Pool + Append + Lowest MediaId +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file5 +@# Pool + Append + Lowest MediaId (only once) +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file8 +@# Pool + Append + Lowest MediaId +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file3 +@# Pool + Recycle +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file11 +@# Pool + Purged +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file6 +@# Pool + Full (prunable) +setdebug level=50 director +run level=full pool=Test storage=File NightlySave yes +wait +message +setdebug level=0 director +list volume +@sleep 5 +@# Must choose file8 +@# Pool + Full (prunable) +run level=full pool=Test storage=File NightlySave yes +wait +message +update volume=file8 enabled=no +list volume +@# Must choose file10 +@# (no more Pool) Scratch + Append +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file9 +@# (no more Pool) Scratch + Recycle +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@sleep 10 +@# Must choose file6 +@# Used (prunable) + Pool +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file4 +@# Used (prunable) + oldest + Scratch +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +@# Must choose file7 +@# Used (prunable) + oldest + Scratch +run level=full pool=Test storage=File NightlySave yes +wait +message +list volume +quit +EOF + +run_bconsole + +awk '/Must choose/ { print $4 } ' tmp/log4.out > tmp/normal4 +awk '/Volume name.+:/ { print $3 } ' tmp/log4.out > tmp/real4 +if [ "$debug" -eq 1 ]; then + diff -ur tmp/normal4 tmp/real4 +else + diff tmp/normal4 tmp/real4 > /dev/null +fi + +dstat=`expr $? + $dstat` + # try to break the old code # in this situation, we have 1 available volume (vol50) and bacula will try to use # vol47, vol48 and vol49 and will stop without using vol50.