]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/faketape-test-changer
ebl Update dummy drive test
[bacula/bacula] / regress / tests / faketape-test-changer
1 #!/bin/sh
2 #
3 # Run backups with dummy tape driver
4 # This test setups an Autochanger with 80 slots
5 # and 5 drives (3 LTO3 and 2 LTO1)
6 #
7 # TAPE_DRIVE="$cwd/working/ach/drive0"
8 # TAPE_DRIVE1="$cwd/working/ach/drive0"
9 # AUTOCHANGER="$cwd/working/ach/conf"
10 # USE_FAKETAPE=--enable-faketape
11 # AUTOCHANGER_SCRIPT=disk-changer
12
13
14 TestName="faketape-test-changer"
15 JobName=backup
16 . scripts/functions
17
18 require_faketape
19
20 scripts/cleanup
21 scripts/copy-tape-confs
22 cp scripts/bacula-dir-faketape.conf bin/bacula-dir.conf
23 cp scripts/bacula-sd-faketape.conf bin/bacula-sd.conf
24 scripts/prepare-big-autochanger
25
26 echo "${cwd}/build" >${cwd}/tmp/file-list
27
28 start_test
29
30 when1=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+30))"`
31 clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf`
32
33 # Catalog record for cleaning tape "CLN01" successfully created.
34 # CLN01      | Cleaning
35
36 # Write out bconsole commands
37 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
38 @output /dev/null
39 messages
40 @$out ${cwd}/tmp/log1.out
41 @#setdebug level=200 storage=LTO1
42 label barcodes pool=Scratch slots=1-40 storage=LTO1 drive=3
43 yes
44 messages
45 list volumes
46 END_OF_DATA
47
48 run_bacula
49 stop_bacula
50
51 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
52 @$out ${cwd}/tmp/log2.out
53 label barcodes pool=Scratch slots=41-80 storage=LTO3 drive=0
54 yes
55 messages
56 list volumes
57 @$out ${cwd}/tmp/log3.out
58 run storage=LTO3 when="$when1" job=NightlySave  pool=Inc     yes
59 run storage=LTO3 when="$when1" job=NightlySave2 pool=Full    yes
60 run storage=LTO3 when="$when1" job=NightlySave1 pool=Default yes
61 run storage=LTO1 when="$when1" job=NightlySave  pool=Inc     yes
62 run storage=LTO1 when="$when1" job=NightlySave2 pool=Full    yes
63 run storage=LTO1 when="$when1" job=NightlySave1 pool=Default yes
64 wait
65 messages
66 END_OF_DATA
67
68 run_bacula
69 check_for_zombie_jobs storage=LTO1 client=$clientname
70 check_for_zombie_jobs storage=LTO3 client=$clientname
71
72 stop_bacula
73
74 grep 'Error: Re-read' tmp/log3.out > /dev/null
75 if test $? = 0; then
76     echo "Found Re-read errors"
77     bstat=1
78 fi
79
80 end_test
81