From: Eric Bollengier Date: Sun, 11 May 2008 11:59:17 +0000 (+0000) Subject: ebl Add faketape test X-Git-Tag: Release-3.0.0~1451 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=71c02c1b9affbad314095499ef398c068dbe93c6;p=bacula%2Fbacula ebl Add faketape test git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6945 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/regress/scripts/bacula-dir-faketape.conf.in b/regress/scripts/bacula-dir-faketape.conf.in index 79049d4c16..38d9763a1f 100644 --- a/regress/scripts/bacula-dir-faketape.conf.in +++ b/regress/scripts/bacula-dir-faketape.conf.in @@ -81,7 +81,7 @@ Job { Type = Restore Client=@hostname@-fd FileSet="Full Set" - Storage = LTO + Storage = LTO1 Messages = Standard Pool = Default Where = @tmpdir@/bacula-restores @@ -118,7 +118,7 @@ Client { File Retention = 30d # 30 days Job Retention = 180d # six months AutoPrune = yes # Prune expired Jobs/Files - Maximum Concurrent Jobs = 4 + Maximum Concurrent Jobs = 10 } # Client (File Services) to backup @@ -131,7 +131,7 @@ Client { File Retention = 30d # 30 days Job Retention = 180d # six months AutoPrune = yes # Prune expired Jobs/Files - Maximum Concurrent Jobs = 4 + Maximum Concurrent Jobs = 10 } # Client (File Services) to backup @@ -144,7 +144,7 @@ Client { File Retention = 30d # 30 days Job Retention = 180d # six months AutoPrune = yes # Prune expired Jobs/Files - Maximum Concurrent Jobs = 4 + Maximum Concurrent Jobs = 10 } # Client (File Services) to backup @@ -157,7 +157,7 @@ Client { File Retention = 30d # 30 days Job Retention = 180d # six months AutoPrune = yes # Prune expired Jobs/Files - Maximum Concurrent Jobs = 4 + Maximum Concurrent Jobs = 10 } # Client (File Services) to backup @@ -170,7 +170,7 @@ Client { File Retention = 30d # 30 days Job Retention = 180d # six months AutoPrune = yes # Prune expired Jobs/Files - Maximum Concurrent Jobs = 4 + Maximum Concurrent Jobs = 10 } @@ -196,18 +196,6 @@ Storage { Maximum Concurrent Jobs = 50 } -# define all LTO drives -Storage { - Name = LTO - Address = @hostname@ - SDPort = @sdport@ - Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" - Device = LTO - Autochanger = yes - Maximum Concurrent Jobs = 50 -} - - ################################################################ # WARNING: Bacula doesn't support this kind of configuration # This is for testing purpose only !!!!!!!!!!!! @@ -219,6 +207,7 @@ Storage { SDPort = @sdport@ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" Device = LTO3_0 + Media Type = LTO3 Autochanger = yes Maximum Concurrent Jobs = 5 } @@ -229,6 +218,7 @@ Storage { SDPort = @sdport@ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" Device = LTO3_1 + Media Type = LTO3 Autochanger = yes Maximum Concurrent Jobs = 5 } @@ -239,6 +229,7 @@ Storage { SDPort = @sdport@ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" Device = LTO3_2 + Media Type = LTO3 Autochanger = yes Maximum Concurrent Jobs = 5 } @@ -249,6 +240,7 @@ Storage { SDPort = @sdport@ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" Device = LTO1_3 + Media Type = LTO1 Autochanger = yes Maximum Concurrent Jobs = 5 } @@ -259,6 +251,7 @@ Storage { SDPort = @sdport@ Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" Device = LTO1_4 + Media Type = LTO1 Autochanger = yes Maximum Concurrent Jobs = 5 } @@ -272,7 +265,7 @@ Storage { 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 + Maximum Concurrent Jobs = 10 } # Generic catalog service @@ -326,6 +319,14 @@ Pool { Volume Retention = 365d # one year } +Pool { + Name = Diff + Pool Type = Backup + Recycle = yes # Bacula can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365d # one year +} + Pool { Name = Scratch Pool Type = Backup @@ -333,4 +334,5 @@ Pool { AutoPrune = yes # Prune expired volumes Volume Retention = 365d # one year Recycle Pool = Scratch # recycle back here + Cleaning Prefix = CLN } diff --git a/regress/scripts/bacula-sd-faketape.conf.in b/regress/scripts/bacula-sd-faketape.conf.in index c06d227691..fe459b2b28 100644 --- a/regress/scripts/bacula-sd-faketape.conf.in +++ b/regress/scripts/bacula-sd-faketape.conf.in @@ -46,7 +46,7 @@ Device { Maximum File Size = 10M Maximum Job Spool Size = 10M Spool Directory = @working_dir@ - + Device Type = Tape } Device { @@ -62,6 +62,7 @@ Device { Maximum File Size = 10M Maximum Job Spool Size = 10M Spool Directory = @working_dir@ + Device Type = Tape } @@ -79,6 +80,7 @@ Device { Auto Select = no Maximum Job Spool Size = 10M Spool Directory = @working_dir@ + Device Type = Tape } @@ -95,6 +97,7 @@ Device { Maximum File Size = 10M Maximum Job Spool Size = 10M Spool Directory = @working_dir@ + Device Type = Tape } @@ -111,6 +114,7 @@ Device { Maximum File Size = 10M Maximum Job Spool Size = 10M Spool Directory = @working_dir@ + Device Type = Tape } diff --git a/regress/scripts/functions b/regress/scripts/functions index c544183f17..dbbc8e734e 100644 --- a/regress/scripts/functions +++ b/regress/scripts/functions @@ -55,6 +55,13 @@ if test x${AUTOCHANGER} = x/dev/null ; then fi } +require_faketape() +{ +if test x${USE_FAKETAPE} = x ; then + echo "$TestName test needs the faketape driver." + exit 1 +fi +} skip_if_no_autochanger() { diff --git a/regress/scripts/prepare-big-autochanger.in b/regress/scripts/prepare-big-autochanger.in index 735ee036f9..97dadf7abc 100644 --- a/regress/scripts/prepare-big-autochanger.in +++ b/regress/scripts/prepare-big-autochanger.in @@ -6,27 +6,37 @@ . scripts/functions # check if user wants to run this test -if test x$USE_FAKETAPE == x; then +if test x$USE_FAKETAPE = x; then exit 1 fi adir=@working_dir@/ach -mkdir $adir +mkdir $adir 2> /dev/null +rm -f $adir/log $adir/barcodes $adir/slot* $adir/drive* 2> /dev/null # create the autochanger configuration file cat > $adir/conf <> $adir/barcodes cp /dev/null $adir/slot$i done +# make a cleaning tape +echo 76:CLN01 >> $adir/barcodes +cp /dev/null $adir/slot76 + +# keep other empty +for i in `seq 77 79`; do + echo $i: >> $adir/barcodes +done + diff --git a/regress/tests/faketape-test-changer b/regress/tests/faketape-test-changer new file mode 100755 index 0000000000..ca8070eaa6 --- /dev/null +++ b/regress/tests/faketape-test-changer @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Run backups with dummy tape driver +# This test setups an Autochanger with 80 slots +# and 5 drives (3 LTO3 and 2 LTO1) +# +# TAPE_DRIVE="$cwd/working/fake/drive0" +# TAPE_DRIVE1="$cwd/working/fake/drive0" +# AUTOCHANGER="$cwd/working/fake/conf" +# USE_FAKETAPE=--enable-faketape +# AUTOCHANGER_SCRIPT=disk-changer +# + +TestName="faketape-test-changer" +JobName=backup +. scripts/functions + +require_faketape + +scripts/cleanup +scripts/copy-tape-confs +cp scripts/bacula-dir-faketape.conf bin/bacula-dir.conf +cp scripts/bacula-sd-faketape.conf bin/bacula-sd.conf +scripts/prepare-big-autochanger + +echo "${cwd}/build" >${cwd}/tmp/file-list + +start_test + +when1=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+30))"` +clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf` + +# Catalog record for cleaning tape "CLN01" successfully created. +# CLN01 | Cleaning + +# Write out bconsole commands +cat <${cwd}/tmp/bconcmds +@output /dev/null +messages +@$out ${cwd}/tmp/log1.out +@#setdebug level=200 storage=LTO1 +label barcodes pool=Scratch slots=1-40 storage=LTO1 drive=3 +yes +label barcodes pool=Scratch slots=41-80 storage=LTO3 drive=0 +yes +messages +list volumes +messages +@$out ${cwd}/tmp/log2.out +run storage=LTO3 when="$when1" job=NightlySave pool=Inc yes +run storage=LTO3 when="$when1" job=NightlySave2 pool=Full yes +run storage=LTO3 when="$when1" job=NightlySave1 pool=Default yes +run storage=LTO1 when="$when1" job=NightlySave pool=Inc yes +run storage=LTO1 when="$when1" job=NightlySave2 pool=Full yes +run storage=LTO1 when="$when1" job=NightlySave1 pool=Default yes +wait +messages +END_OF_DATA + +run_bacula +check_for_zombie_jobs storage=LTO1 client=$clientname +check_for_zombie_jobs storage=LTO3 client=$clientname + +export dstat=1 +export bstat=1 +export rstat=1 + +stop_bacula + +end_test +