From da2a8453dfbdecc2516758c87e53c3d98784be44 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 20 Sep 2007 12:56:20 +0000 Subject: [PATCH] Enhance 6 vol test add ANSI tape label test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5607 91ce42f0-d328-0410-95d8-f526ca767f89 --- regress/all-non-root-tape-tests | 1 + regress/scripts/ansi-sd-tape.conf.in | 55 +++++++++ regress/scripts/do_sed | 2 + regress/scripts/testb-bacula-dir.conf.in | 151 +++++++++++++++++++++++ regress/tests/ansi-label-tape | 91 ++++++++++++++ regress/tests/six-vol-test | 5 + 6 files changed, 305 insertions(+) create mode 100644 regress/scripts/ansi-sd-tape.conf.in create mode 100644 regress/scripts/testb-bacula-dir.conf.in create mode 100755 regress/tests/ansi-label-tape diff --git a/regress/all-non-root-tape-tests b/regress/all-non-root-tape-tests index 68feb8c575..708aa8389d 100755 --- a/regress/all-non-root-tape-tests +++ b/regress/all-non-root-tape-tests @@ -10,6 +10,7 @@ echo " " echo " " >>test.out echo "Start all non-root tape tests" echo "Start all non-root tape tests" >>test.out +nice tests/ansi-label-tape nice tests/backup-bacula-tape nice tests/btape-fill-tape nice tests/fixed-block-size-tape diff --git a/regress/scripts/ansi-sd-tape.conf.in b/regress/scripts/ansi-sd-tape.conf.in new file mode 100644 index 0000000000..598a8a4330 --- /dev/null +++ b/regress/scripts/ansi-sd-tape.conf.in @@ -0,0 +1,55 @@ +# +# Default Bacula Storage Daemon Configuration file +# +# For Bacula release 2.2 +# +# You may need to change the name of your tape drive +# on the "Archive Device" directive in the Device +# resource. If you change the Name and/or the +# "Media Type" in the Device resource, please ensure +# that dird.conf has corresponding changes. +# + +Storage { # definition of myself + Name = @hostname@-sd + SDPort = 8103 # Director's port + WorkingDirectory = "@working_dir@" + Pid Directory = "@piddir@" + Subsys Directory = "@subsysdir@" +} + +# +# List Directors who are permitted to contact Storage daemon +# +Director { + Name = @hostname@-dir + Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" +} + +# +# Devices supported by this Storage daemon +# To connect, the Director's bacula-dir.conf must have the +# same Name and MediaType. +# + +Device { + Name = DDS-4 # + Media Type = DDS-4 + Archive Device = @tape_drive@ + AutomaticMount = yes; # when device opened, read it + AlwaysOpen = yes; + RemovableMedia = yes; + @@sbindir@/tape_options +# Maximum File Size = 1000000 +# MaximumVolumeSize = 400M + Label Type = ansi +} + +# +# Send all messages to the Director, +# mount messages also are sent to the email address +# +Messages { + Name = Standard + director = @hostname@-dir = all, !terminate +} diff --git a/regress/scripts/do_sed b/regress/scripts/do_sed index b502715ffa..34ea62eb94 100755 --- a/regress/scripts/do_sed +++ b/regress/scripts/do_sed @@ -39,6 +39,7 @@ sed -f ${out} ${cwd}/scripts/bacula-dir.conf.regexwhere.in >${cwd}/scripts/bacul sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxtime.in >${cwd}/scripts/bacula-dir.conf.maxtime sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf +sed -f ${out} ${cwd}/scripts/testb-bacula-dir.conf.in >${cwd}/scripts/testb-bacula-dir.conf sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf @@ -48,6 +49,7 @@ sed -f ${out} ${cwd}/scripts/bacula-dir-fifo.conf.in >${cwd}/scripts/bacula-dir- sed -f ${out} ${cwd}/scripts/bacula-dir-migration.conf.in >${cwd}/scripts/bacula-dir-migration.conf sed -f ${out} ${cwd}/scripts/win32-bacula-dir-tape.conf.in >${cwd}/scripts/win32-bacula-dir-tape.conf sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf +sed -f ${out} ${cwd}/scripts/ansi-sd-tape.conf.in >${cwd}/scripts/ansi-sd-tape.conf sed -f ${out} ${cwd}/scripts/bacula-sd-fifo.conf.in >${cwd}/scripts/bacula-sd-fifo.conf sed -f ${out} ${cwd}/scripts/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf sed -f ${out} ${cwd}/scripts/bacula-sd-migration.conf.in >${cwd}/scripts/bacula-sd-migration.conf diff --git a/regress/scripts/testb-bacula-dir.conf.in b/regress/scripts/testb-bacula-dir.conf.in new file mode 100644 index 0000000000..b0cc28b2ce --- /dev/null +++ b/regress/scripts/testb-bacula-dir.conf.in @@ -0,0 +1,151 @@ +# +# TestA Bacula Director Configuration file +# +# For Bacula release 2.2.x +# + +Director { # define myself + Name = @hostname@-dir + DIRport = 8101 # where we listen for UA connections + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + SubSysDirectory = "@subsysdir@" + Maximum Concurrent Jobs = 20 + Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password + Messages = Standard +} + + +Job { + Name = "MultiVol" + Type = Backup + Client=@hostname@-fd + Level = Full + FileSet="Full Set" + Storage = File + Messages = Standard + Write Bootstrap = "@working_dir@/SmallVols.bsr" + Pool = SmallVols + SpoolData = yes + Maximum Concurrent Jobs = 20 +} + + +Job { + Name = "VerifyVolume" + Type = Verify + Level = VolumeToCatalog + Client=@hostname@-fd + FileSet="Full Set" + Storage = File + Messages = Standard + Pool = Default + Write Bootstrap = "@working_dir@/NightlySave.bsr" +} + + + +# Standard Restore template, to be changed by Console program +Job { + Name = "RestoreFiles" + Type = Restore + Client=@hostname@-fd + FileSet="Full Set" + Storage = File + Messages = Standard + Pool = Default + Where = /tmp/bacula-restores +} + + +# List of files to be backed up +FileSet { + Name = "Full Set" + Include { Options { signature=SHA1 } + File =/tmp/file-list + +change_jobname NightlySave $JobName +start_test + +# Write out bconsole commands +cat <tmp/bconcmds +@output /dev/null +messages +@$out tmp/log1.out +@#setdebug level=200 storage=DDS-4 +label storage=DDS-4 volume=Vol001 slot=0 pool=Default +purge volume=Vol001 +relabel pool=Default storage=DDS-4 oldVolume=Vol001 volume=Vol002 slot=0 +purge volume=Vol002 +relabel pool=Default storage=DDS-4 oldVolume=Vol002 volume=Vol001 slot=0 +run job=$JobName yes +status storage=DDS-4 +@sleep 1 +wait +messages +@# +@# now do a restore +@# +@$out tmp/log2.out +restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done +yes +wait +list volumes +messages +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +# +# Now do a second backup after making a few changes +# +touch ${cwd}/build/src/dird/*.c +echo "test test" > ${cwd}/build/src/dird/xxx + +cat <tmp/bconcmds +@$out /dev/null +messages +@$out tmp/log1.out +list volumes +setdebug level=300 storage=DDS-4 +run job=$JobName yes +wait +list volumes +messages +@# +@# now do a second restore +@# +@$out tmp/log2.out +list volumes +restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done +yes +wait +list volumes +messages +@$out +quit +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=DDS-4 +stop_bacula + +check_two_logs +check_restore_diff +end_test diff --git a/regress/tests/six-vol-test b/regress/tests/six-vol-test index dad407b115..04694d2c0b 100755 --- a/regress/tests/six-vol-test +++ b/regress/tests/six-vol-test @@ -14,6 +14,7 @@ fi scripts/cleanup scripts/copy-testa-confs +/bin/cp -f scripts/testb-bacula-dir.conf bin/bacula-dir.conf echo "${cwd}/tmp/largefile" >/tmp/file-list # Create 56MB file with random data echo "Creating a 56MB file with random data ..." @@ -28,6 +29,10 @@ cat <tmp/bconcmds messages @$out tmp/log1.out run job=$JobName storage=File yes +run job=$JobName storage=File yes +run job=$JobName storage=File yes +run job=$JobName storage=File yes +run job=$JobName storage=File yes wait list volumes messages -- 2.39.5