From: Kern Sibbald Date: Sat, 16 Aug 2008 08:53:11 +0000 (+0000) Subject: Update X-Git-Tag: Release-3.0.0~1084 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af6eebb63585f551c8dd9d6649bf8e3d594c86ba;p=bacula%2Fbacula Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7482 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/prepare-disk-changer b/regress/scripts/prepare-disk-changer new file mode 100755 index 0000000000..d0cce463ac --- /dev/null +++ b/regress/scripts/prepare-disk-changer @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Create fresh virtual disk changer directory +# +rm -rf tmp/disk-changer +mkdir tmp/disk-changer +# Create 10 slots +for i in 1 2 3 4 5 6 7 8 9 10 ; do + touch tmp/disk-changer/slot$i +done diff --git a/regress/scripts/prepare-two-disks b/regress/scripts/prepare-two-disks deleted file mode 100755 index d0cce463ac..0000000000 --- a/regress/scripts/prepare-two-disks +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Create fresh virtual disk changer directory -# -rm -rf tmp/disk-changer -mkdir tmp/disk-changer -# Create 10 slots -for i in 1 2 3 4 5 6 7 8 9 10 ; do - touch tmp/disk-changer/slot$i -done diff --git a/regress/tests/2drive-2disk b/regress/tests/2drive-2disk index ae84936dbf..67450591db 100755 --- a/regress/tests/2drive-2disk +++ b/regress/tests/2drive-2disk @@ -11,7 +11,7 @@ JobName="2drive2disk" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk diff --git a/regress/tests/2drive-2job-test b/regress/tests/2drive-2job-test index 89a8c2cb47..fd3b19a004 100755 --- a/regress/tests/2drive-2job-test +++ b/regress/tests/2drive-2job-test @@ -11,7 +11,7 @@ JobName="2drive2job" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk change_jobname NightlySave $JobName diff --git a/regress/tests/2drive-3pool-test b/regress/tests/2drive-3pool-test index 5bc6259f56..6a7d91bbd9 100755 --- a/regress/tests/2drive-3pool-test +++ b/regress/tests/2drive-3pool-test @@ -13,7 +13,7 @@ JobName="2dr3pooldisk" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk echo "${cwd}/build" >${cwd}/tmp/file-list diff --git a/regress/tests/2drive-concurrent-test b/regress/tests/2drive-concurrent-test index 44f5bd07a9..038b9ad396 100755 --- a/regress/tests/2drive-concurrent-test +++ b/regress/tests/2drive-concurrent-test @@ -11,7 +11,7 @@ JobName=Four-concurrent-jobs scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk echo "${cwd}/build" >${cwd}/tmp/file-list diff --git a/regress/tests/2drive-incremental-2disk b/regress/tests/2drive-incremental-2disk index 334d578380..43863d8b78 100755 --- a/regress/tests/2drive-incremental-2disk +++ b/regress/tests/2drive-incremental-2disk @@ -11,7 +11,7 @@ JobName="2drive2disk" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk change_jobname localhost-fd $JobName diff --git a/regress/tests/2drive-offline-test b/regress/tests/2drive-offline-test index 3f16b9adef..93c63918b8 100755 --- a/regress/tests/2drive-offline-test +++ b/regress/tests/2drive-offline-test @@ -14,7 +14,7 @@ JobName="2driveoffline" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk change_jobname NightlySave $JobName diff --git a/regress/tests/2drive-swap-test b/regress/tests/2drive-swap-test index 33d446543b..d96f6e8b16 100755 --- a/regress/tests/2drive-swap-test +++ b/regress/tests/2drive-swap-test @@ -11,7 +11,7 @@ JobName="2drive-swap" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk change_jobname NightlySave $JobName diff --git a/regress/tests/fast-two-pool-test b/regress/tests/fast-two-pool-test index 3087733b96..dc9101a3ae 100755 --- a/regress/tests/fast-two-pool-test +++ b/regress/tests/fast-two-pool-test @@ -15,7 +15,7 @@ JobName=Fast-two-pool scripts/cleanup scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer # Make a relatively large backup set 5 x source code directory # Reduced to 1 for portable diff --git a/regress/tests/incremental-2disk b/regress/tests/incremental-2disk index 63098bcd9b..1c1efb4c00 100755 --- a/regress/tests/incremental-2disk +++ b/regress/tests/incremental-2disk @@ -18,7 +18,7 @@ cd bin cd .. scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then diff --git a/regress/tests/incremental-2media b/regress/tests/incremental-2media index d8ef6b15e7..ba7a5373eb 100755 --- a/regress/tests/incremental-2media +++ b/regress/tests/incremental-2media @@ -13,7 +13,7 @@ JobName=Inc2media scripts/cleanup scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname $JobName diff --git a/regress/tests/migration-job-test b/regress/tests/migration-job-test index ac0ea2b979..2fc38a8509 100755 --- a/regress/tests/migration-job-test +++ b/regress/tests/migration-job-test @@ -12,7 +12,7 @@ JobName=MigrationJobSave scripts/cleanup scripts/copy-migration-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname NightlySave $JobName diff --git a/regress/tests/migration-jobspan-test b/regress/tests/migration-jobspan-test index 6910dde4bd..f62bd936e4 100755 --- a/regress/tests/migration-jobspan-test +++ b/regress/tests/migration-jobspan-test @@ -14,7 +14,7 @@ JobName=MigrationJobSpanSave scripts/cleanup scripts/copy-migration-confs -scripts/prepare-two-disks +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 diff --git a/regress/tests/migration-occupancy-test b/regress/tests/migration-occupancy-test index 5f19481677..21a0d48ecc 100755 --- a/regress/tests/migration-occupancy-test +++ b/regress/tests/migration-occupancy-test @@ -12,7 +12,7 @@ JobName=MigrationJobSave scripts/cleanup scripts/copy-migration-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname NightlySave $JobName diff --git a/regress/tests/migration-time-test b/regress/tests/migration-time-test index 96e968bb02..a1846e447d 100755 --- a/regress/tests/migration-time-test +++ b/regress/tests/migration-time-test @@ -12,7 +12,7 @@ JobName=MigrationJobSave scripts/cleanup scripts/copy-migration-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname NightlySave $JobName diff --git a/regress/tests/migration-volume-test b/regress/tests/migration-volume-test index 2d5e57885c..13f7e67196 100755 --- a/regress/tests/migration-volume-test +++ b/regress/tests/migration-volume-test @@ -12,7 +12,7 @@ JobName=MigVolBackup scripts/cleanup scripts/copy-migration-confs -scripts/prepare-two-disks +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 diff --git a/regress/tests/scratch-pool-test b/regress/tests/scratch-pool-test index 47a8cb96e8..11016ff4ed 100755 --- a/regress/tests/scratch-pool-test +++ b/regress/tests/scratch-pool-test @@ -22,7 +22,7 @@ fi cwd=`pwd` scripts/cleanup scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list diff --git a/regress/tests/three-pool-recycle-test b/regress/tests/three-pool-recycle-test index 57790ce9e6..0069935c67 100755 --- a/regress/tests/three-pool-recycle-test +++ b/regress/tests/three-pool-recycle-test @@ -16,7 +16,7 @@ JobName=Three-pool-recycle cwd=`pwd` scripts/cleanup scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer # remove Client Run Before Job cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1 diff --git a/regress/tests/three-pool-test b/regress/tests/three-pool-test index ba4597f376..2eaf7d0c48 100755 --- a/regress/tests/three-pool-test +++ b/regress/tests/three-pool-test @@ -13,7 +13,7 @@ JobName="threepooldisk" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk echo "${cwd}/build" >${cwd}/tmp/file-list diff --git a/regress/tests/two-pool-test b/regress/tests/two-pool-test index b5d235ae19..b0a48ec645 100755 --- a/regress/tests/two-pool-test +++ b/regress/tests/two-pool-test @@ -16,7 +16,7 @@ JobName=Two-pool cwd=`pwd` scripts/cleanup scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer # Make a relatively large backup set 5 x source code directory # Reduced to 1 for portable diff --git a/regress/tests/two-volume-test b/regress/tests/two-volume-test index 920beb57ac..84a4228d3e 100755 --- a/regress/tests/two-volume-test +++ b/regress/tests/two-volume-test @@ -14,7 +14,7 @@ JobName=TwoVolume cwd=`pwd` scripts/cleanup scripts/copy-2disk-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list diff --git a/regress/tests/virtual-backup-test b/regress/tests/virtual-backup-test index 1ff14eac49..700f2c1c6c 100755 --- a/regress/tests/virtual-backup-test +++ b/regress/tests/virtual-backup-test @@ -12,7 +12,7 @@ JobName=Vbackup scripts/cleanup scripts/copy-migration-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer echo "${cwd}/build" >${cwd}/tmp/file-list change_jobname NightlySave $JobName @@ -55,7 +55,7 @@ messages list jobs list volumes @# -@# now do a restore +@# now do a normal restore of normal backups @# @$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select @@ -73,7 +73,7 @@ messages list volumes list jobs @# -@# now do a restore +@# now do a restore of the consolidated Full @# @$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger @@ -82,36 +82,6 @@ mark * done yes wait -update Volume=ChangerVolume002 -11 -Default -list volumes -list jobs -messages -@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'" -run job=$JobName level=Incremental yes -wait -messages -list jobs -list volumes -@# Now do another Consolidation -setdebug level=150 storage=DiskChanger -run job=$JobName level=VirtualFull yes -wait -messages -list volumes -list jobs -@# -@# now do a restore -@# -@$out ${cwd}/tmp/log2.out -setdebug level=0 storage=DiskChanger -restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger -unmark * -mark * -done -yes -wait list volumes list jobs messages diff --git a/regress/tests/virtual-backup2-test b/regress/tests/virtual-backup2-test new file mode 100755 index 0000000000..0a0029d703 --- /dev/null +++ b/regress/tests/virtual-backup2-test @@ -0,0 +1,129 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then do a virtual +# backup to another device. +# +# This script uses the virtual disk autochanger +# +TestName="virtual-backup-test" +JobName=Vbackup +. scripts/functions + + +scripts/cleanup +scripts/copy-migration-confs +scripts/prepare-disk-changer +echo "${cwd}/build" >${cwd}/tmp/file-list + +change_jobname NightlySave $JobName +start_test + +# +# Note, we first backup into Pool Default, +# then Migrate into Pool Full. +# Pool Default forced to use Storage=DiskChanger +# Pool Full uses Storage=DiskChanger + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@output +messages +@$out ${cwd}/tmp/log1.out +setdebug level=150 storage=DiskChanger +label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0 +label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0 +label storage=DiskChanger volume=ChangerVolume003 slot=3 Pool=Full drive=0 +setdebug level=0 storage=DiskChanger +@# run several jobs +run job=$JobName level=Full yes +wait +messages +list jobs +@exec "sh -c 'touch ${cwd}/build/src/dird/*.c'" +run job=$JobName level=Incremental storage=DiskChanger yes +wait +messages +list jobs +@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'" +run job=$JobName level=Differential storage=DiskChanger yes +wait +messages +list jobs +@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'" +run job=$JobName level=Incremental storage=DiskChanger yes +wait +messages +list jobs +list volumes +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select +unmark * +mark * +done +yes +list volumes +@#setdebug level=100 dir +@# should Consolidate Full, Differential and Incremental +@#setdebug level=51 storage=DiskChanger +run job=$JobName level=VirtualFull storage=DiskChanger yes +wait +messages +list volumes +list jobs +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger +unmark * +mark * +done +yes +wait +update Volume=ChangerVolume002 +11 +Default +list volumes +list jobs +messages +@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'" +run job=$JobName level=Incremental storage=DiskChanger yes +wait +messages +list jobs +list volumes +@# Now do another Consolidation +setdebug level=150 storage=DiskChanger +run job=$JobName level=VirtualFull storage=DiskChanger yes +wait +messages +list volumes +list jobs +@# +@# now do a restore +@# +@$out ${cwd}/tmp/log2.out +setdebug level=0 storage=DiskChanger +restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger +unmark * +mark * +done +yes +wait +list volumes +list jobs +messages +@output +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +check_restore_diff +end_test diff --git a/regress/tests/virtual-changer-test b/regress/tests/virtual-changer-test index 5e53437492..30a371bf8a 100755 --- a/regress/tests/virtual-changer-test +++ b/regress/tests/virtual-changer-test @@ -13,7 +13,7 @@ JobName="virtualchangerdisk" scripts/cleanup scripts/copy-2disk-drive-confs -scripts/prepare-two-disks +scripts/prepare-disk-changer CLIENT=2drive2disk