X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=regress%2Ftests%2Fmigration-volume-test;h=dc951eaeb61c22ad3b2e397e8578b33f9bf81230;hb=a47d15cbcf6e8d54a7c9604b4e4ea897f7ee0056;hp=81d7a339e577fee1bf7c9c1a7e087dea052f6cc6;hpb=016d758392f5e54cdc9f82b97823dbb18a2e2595;p=bacula%2Fbacula diff --git a/regress/tests/migration-volume-test b/regress/tests/migration-volume-test index 81d7a339e5..dc951eaeb6 100755 --- a/regress/tests/migration-volume-test +++ b/regress/tests/migration-volume-test @@ -1,21 +1,21 @@ #!/bin/sh # -# Run a simple backup of the Bacula build directory then migrate it -# to another device. +# Run a backup of the Bacula build directory on two Volumes +# then migrate it to another device. # # This script uses the virtual disk autochanger # TestName="migration-volume-test" -JobName=MigrationVolSave +JobName=MigVolBackup . scripts/functions -set_debug 1 -. config.out -scripts/copy-migration-confs -scripts/prepare-two-disks scripts/cleanup -echo "${cwd}/build" >/tmp/file-list +scripts/copy-migration-confs +scripts/prepare-disk-changer +echo "${cwd}/build" >${cwd}/tmp/file-list +#cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1 +#sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf change_jobname NightlySave $JobName start_test @@ -27,29 +27,61 @@ start_test # Pool Full uses Storage=DiskChanger # Write out bconsole commands -cat <tmp/bconcmds -@output +cat <${cwd}/tmp/bconcmds +@$out /dev/null messages -@$out tmp/log1.out +@$out ${cwd}/tmp/log1.out label storage=File volume=FileVolume001 Pool=Default +label storage=File volume=FileVolume002 Pool=Default +update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0 -list volumes -@# run two jobs (both will be migrated) +@# run job=$JobName yes +wait run job=$JobName yes wait update volume=FileVolume001 VolStatus=Used -list volumes +update volume=FileVolume002 VolStatus=Used +@#list volumes +@#list jobs @# should migrate two jobs +@# setdebug level=11 dir +@echo "Run migrate-volume Job" +@#setdebug level=100 dir run job=migrate-volume yes +@sleep 5 +list jobs +llist jobid=1 +llist jobid=2 +llist jobid=3 +llist jobid=4 +llist jobid=5 +status storage=DiskChanger +wait list volumes +list jobs +llist jobid=1 +llist jobid=2 +llist jobid=3 +llist jobid=4 +llist jobid=5 +sql +select * from JobMedia where JobId=1; + +@# Now run a second Migration job, which should do nothing +run job=migrate-volume yes wait +list jobs +@# ensure we don't pickup old backup by purging volume +@# purge volume=FileVolume001 +@# purge volume=FileVolume002 +@echo "Now do a restore" messages @# @# now do a restore @# -@$out tmp/log2.out +@$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger unmark * mark * @@ -57,7 +89,6 @@ done yes wait messages -@output quit END_OF_DATA @@ -67,5 +98,4 @@ stop_bacula check_two_logs check_restore_diff -exit end_test