From 1dde985b0578fb24d63031846cfbac4799615f43 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 1 Jun 2007 21:09:11 +0000 Subject: [PATCH] Update tests git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4964 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/all-non-root-tests | 2 + regress/scripts/bacula-dir-migration.conf.in | 2 +- regress/scripts/bacula-dir-tape.conf.in | 13 ++++ regress/scripts/bacula-sd-2disk.conf.in | 11 +++ regress/scripts/bacula-sd-migration.conf.in | 2 +- regress/scripts/functions | 4 +- regress/tests/incremental-2media | 74 ++++++++++++++++++++ regress/tests/migration-job-test | 2 + regress/tests/three-pool-test | 6 +- 9 files changed, 110 insertions(+), 6 deletions(-) create mode 100755 regress/tests/incremental-2media diff --git a/regress/all-non-root-tests b/regress/all-non-root-tests index e574f715af..40f33f3897 100755 --- a/regress/all-non-root-tests +++ b/regress/all-non-root-tests @@ -57,6 +57,8 @@ nice tests/incremental-2disk nice tests/2drive-incremental-2disk nice tests/scratch-pool-test nice tests/2drive-concurrent-test +nice tests/incremental-2media +nice tests/three-pool-test echo " " echo "Test results" cat test.out diff --git a/regress/scripts/bacula-dir-migration.conf.in b/regress/scripts/bacula-dir-migration.conf.in index 0adf7cdd34..41385283fd 100644 --- a/regress/scripts/bacula-dir-migration.conf.in +++ b/regress/scripts/bacula-dir-migration.conf.in @@ -154,7 +154,7 @@ Storage { SDPort = 8103 Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon Device = DiskChanger # must be same as Device in Storage daemon - Media Type = DiskChanger # must be same as MediaType in Storage daemon + Media Type = DiskChangerMedia # must be same as MediaType in Storage daemon Maximum Concurrent Jobs = 4 Autochanger = yes } diff --git a/regress/scripts/bacula-dir-tape.conf.in b/regress/scripts/bacula-dir-tape.conf.in index c40556c8f0..f629355929 100644 --- a/regress/scripts/bacula-dir-tape.conf.in +++ b/regress/scripts/bacula-dir-tape.conf.in @@ -158,6 +158,19 @@ Storage { } +# Definition of File storage device +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here + SDPort = 8103 + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon + Device = FileStorage # must be same as Device in Storage daemon + Media Type = FileMedia # must be same as MediaType in Storage daemon + Maximum Concurrent Jobs = 4 +} + + + # Generic catalog service Catalog { Name = MyCatalog diff --git a/regress/scripts/bacula-sd-2disk.conf.in b/regress/scripts/bacula-sd-2disk.conf.in index 5a1d8d88a2..109d83a2ce 100644 --- a/regress/scripts/bacula-sd-2disk.conf.in +++ b/regress/scripts/bacula-sd-2disk.conf.in @@ -51,6 +51,17 @@ Device { # Maximum File Size = 1000000 } +Device { + Name = FileStorage + Media Type = FileMedia + Archive Device = @tmpdir@ + LabelMedia = yes; # lets Bacula label unlabeled media + Random Access = Yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; +} + # # Send all messages to the Director, diff --git a/regress/scripts/bacula-sd-migration.conf.in b/regress/scripts/bacula-sd-migration.conf.in index db45c6bcb8..f58cd4b528 100644 --- a/regress/scripts/bacula-sd-migration.conf.in +++ b/regress/scripts/bacula-sd-migration.conf.in @@ -41,7 +41,7 @@ Autochanger { Device { Name = Drive-0 # Device Type = File - Media Type = DiskChanger + Media Type = DiskChangerMedia Archive Device = @disk_drive@/drive0 AutomaticMount = yes; # when device opened, read it Autochanger = yes diff --git a/regress/scripts/functions b/regress/scripts/functions index e63cf3d7c2..fa674c42e0 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -114,7 +114,7 @@ end_test() if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then echo " " echo " " - echo " !!!!! $TestName Bacula source failed!!! !!!!! " + echo " !!!!! $TestName failed!!! !!!!! " echo " !!!!! $TestName failed!!! !!!!! " >>test.out if [ $bstat != 0 -o $rstat != 0 ] ; then echo " !!!!! Bad Job termination status !!!!! " @@ -125,7 +125,7 @@ end_test() fi echo " " else - echo " ===== $TestName Bacula source OK `date +%R:%S` ===== " + echo " ===== $TestName OK `date +%R:%S` ===== " echo " ===== $TestName OK `date +%R:%S` ===== " >>test.out if test "$debug" -eq 0 ; then scripts/cleanup diff --git a/regress/tests/incremental-2media b/regress/tests/incremental-2media new file mode 100755 index 0000000000..c476b16819 --- /dev/null +++ b/regress/tests/incremental-2media @@ -0,0 +1,74 @@ +#!/bin/sh +# +# Run a simple backup of the Bacula build directory then create some +# new files, do an Incremental onto a different medium +# and then restore everything. +# +# This script uses the virtual disk autochanger +# +TestName="incremental-2media" +JobName=Inc2media +. scripts/functions + +. config.out + +scripts/cleanup +scripts/copy-2disk-confs +scripts/prepare-two-disks +echo "${cwd}/build" >/tmp/file-list + +change_jobname $JobName +start_test + +# Write out bconsole commands +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log1.out +label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0 +label storage=File volume=TestVolume002 Pool=Default +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bacula + +echo "Backup 1 done" +# make some files for the incremental to pick up +touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o +touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o + +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log1.out +@# Force Incremental on the second Volume +update volume=TestVolume001 VolStatus=Used +setdebug level=51 storage=File +run level=Incremental job=$JobName storage=File yes +wait +messages +@# +@# now do a restore +@# +@$out tmp/log2.out +setdebug level=51 storage=DDS-4 +restore where=${cwd}/tmp/bacula-restores select all done +yes +wait +messages +@$out +quit +END_OF_DATA + +run_bconsole + +check_for_zombie_jobs storage=File +stop_bacula + +check_two_logs +check_restore_diff + +end_test diff --git a/regress/tests/migration-job-test b/regress/tests/migration-job-test index ab979daf84..d50d49748e 100755 --- a/regress/tests/migration-job-test +++ b/regress/tests/migration-job-test @@ -41,6 +41,7 @@ list jobs list volumes @#setdebug level=100 dir @# should migrate two jobs +setdebug level=51 storage=DiskChanger run job=migrate-job yes wait messages @@ -52,6 +53,7 @@ wait @# now do a restore @# @$out tmp/log2.out +list volumes restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger unmark * mark * diff --git a/regress/tests/three-pool-test b/regress/tests/three-pool-test index 2442773a1b..11f040e59d 100755 --- a/regress/tests/three-pool-test +++ b/regress/tests/three-pool-test @@ -33,7 +33,7 @@ cat <tmp/bconcmds @output /dev/null messages @$out tmp/log1.out -@#setdebug level=150 storage=DDS-4 +setdebug level=51 storage=DDS-4 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Full drive=0 label storage=DDS-4 volume=TestVolume003 slot=3 Pool=Inc drive=1 @@ -73,9 +73,11 @@ quit END_OF_DATA run_bconsole + check_for_zombie_jobs storage=DDS-4 stop_bacula + check_two_logs -check_restore_tmp_build_diff +check_restore_diff end_test -- 2.39.5