#!/bin/sh # # This script uses the virtual disk autochanger # TestName="multi-storage-test" JobName=backup . scripts/functions scripts/cleanup scripts/copy-2disk-confs scripts/prepare-disk-changer perl -ne ' if (/^Storage {/) { $in=1; $nb++; } if (/^}/) { $in=0 } if (/Address / && $in) {$_ = "Address = 127.0.0.$nb\n"; } print; ' $conf/bacula-dir.conf > $tmp/1 cp $tmp/1 $conf/bacula-dir.conf disable_pluguins echo "${cwd}/tmp/build" >${cwd}/tmp/file-list if test ! -d ${cwd}/tmp/build ; then mkdir ${cwd}/tmp/build fi cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list cd ${cwd} change_jobname $JobName start_test # Write out bconsole commands cat <${cwd}/tmp/bconcmds @$out /dev/null messages @$out ${cwd}/tmp/log1.out label storage=DDS-4 volume=TestVolume001 Pool=Default slot=1 drive=0 label storage=File volume=TestVolume002 Pool=Default run job=$JobName storage=DDS-4 yes wait messages quit END_OF_DATA run_bacula echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt cat <${cwd}/tmp/bconcmds @$out /dev/null messages @$out ${cwd}/tmp/log1.out @# Force Incremental on the second Volume run level=Incremental storage=File job=$JobName yes wait messages @# @# now do a restore @# @$out ${cwd}/tmp/log2.out setdebug trace=1 level=110 client setdebug trace=1 level=110 director 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_tmp_build_diff # # This script seems to more or less randomly fail, so we # add extra code here to produce a "dump" in the event of # an error. # if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then cat ${cwd}/tmp/log1.out echo " " cat ${cwd}/tmp/log2.out echo " " diff -r ${cwd}/tmp/build ${cwd}/tmp/bacula-restores${cwd}/tmp/build fi end_test