From: Kern Sibbald Date: Mon, 6 Aug 2007 15:57:24 +0000 (+0000) Subject: Make test for restore of two Vols of different Media Type X-Git-Tag: Release-7.0.0~5894 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e47168b7d94a30e3d696610c1e716f9f96fd36e4;p=bacula%2Fbacula Make test for restore of two Vols of different Media Type git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5292 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/bacula-dir-2d.conf.in b/regress/scripts/bacula-dir-2d.conf.in new file mode 100644 index 0000000000..2347532558 --- /dev/null +++ b/regress/scripts/bacula-dir-2d.conf.in @@ -0,0 +1,179 @@ +# +# Default Bacula Director Configuration file +# +# The only thing that MUST be changed is to add one or more +# file or directory names in the Include directive of the +# FileSet resource. +# +# For Bacula release 2.1.x +# +# Special conf for testing two tape drives with two different +# Media. +# + +Director { # define myself + Name = @hostname@-dir + DIRport = 8101 # where we listen for UA connections + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + Maximum Concurrent Jobs = 4 + Password = "dir-pw" + Messages = Daemon +} + +# +# Define the main nightly save backup job +# By default, this job will back up to disk in /tmp +Job { + Name = "NightlySave" + Type = Backup + Client=@hostname@-fd + FileSet="Full Set" + Storage = DDS-4 + Messages = Standard + Pool = Default + Write Bootstrap = "@working_dir@/NightlySave.bsr" + Maximum Concurrent Jobs = 4 + SpoolData = yes +# Prefer Mounted Volumes = no +} + +# Standard Restore template, to be changed by Console program +Job { + Name = "RestoreFiles" + Type = Restore + Client=@hostname@-fd + FileSet="Full Set" + Storage = DDS-4 + Messages = Standard + Pool = Default + Where = /tmp/bacula-restores +} + + +# List of files to be backed up +FileSet { + Name = "Full Set" + Include { Options { signature=MD5 } + File = ${cwd}/scripts/tls-bacula-fd sed -f ${out} ${cwd}/scripts/tls-bacula-sd.conf.in >${cwd}/scripts/tls-bacula-sd.conf sed -f ${out} ${cwd}/scripts/tls-bacula-dir.conf.in >${cwd}/scripts/tls-bacula-dir.conf +sed -f ${out} ${cwd}/scripts/bacula-fd-2d.conf.in >${cwd}/scripts/bacula-fd-2d.conf +sed -f ${out} ${cwd}/scripts/bacula-sd-2d.conf.in >${cwd}/scripts/bacula-sd-2d.conf +sed -f ${out} ${cwd}/scripts/bacula-dir-2d.conf.in >${cwd}/scripts/bacula-dir-2d.conf +sed -f ${out} ${cwd}/scripts/bconsole-2d.conf.in >${cwd}/scripts/bconsole-2d.conf + + cp ${cwd}/bin/bacula-sd.conf /tmp/bac$$ sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf chmod 777 ${cwd}/scripts/cleanup-*tape ${cwd}/scripts/cleanup-*drive ${cwd}/scripts/prepare-two-tapes diff --git a/regress/tests/incremental-2media-tape b/regress/tests/incremental-2media-tape new file mode 100755 index 0000000000..3bfe5c5251 --- /dev/null +++ b/regress/tests/incremental-2media-tape @@ -0,0 +1,89 @@ +#!/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 two different tape drives. +# +TestName="incremental-2media-tape" +JobName=Inc2mediaTape +. scripts/functions + + +scripts/cleanup +# Get conf files +/bin/cp -f scripts/bacula-dir-2d.conf bin/bacula-dir.conf +/bin/cp -f scripts/bacula-sd-2d.conf bin/bacula-sd.conf +/bin/cp -f scripts/bacula-fd-2d.conf bin/bacula-fd.conf +/bin/cp -f scripts/bconsole-2d.conf bin/bconsole.conf + +# get proper SD tape definitions +cp -f scripts/linux_tape_options bin/tape_options +if test x`uname` = xFreeBSD ; then + cp -f scripts/freebsd_tape_options bin/tape_options +fi + +mt -f /dev/nst0 rewind +mt -f /dev/nst0 weof +mt -f /dev/nst1 rewind +mt -f /dev/nst1 weof + +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=DLT80 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=DLT80 +run level=Incremental job=$JobName storage=DLT80 yes +wait +list volumes +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=DLT80 +stop_bacula + +check_two_logs +check_restore_diff + +end_test