]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-tape
ebl Fix #955 bug which was introduce with regexwhere relocation.
[bacula/bacula] / regress / tests / two-volume-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory 
4 #  to two tapes where the maximum tape file size is set to 1M
5 #  Note, this test simulates the tape filling and writing to
6 #   the next tape.
7 #
8 TestName="two-volume-tape"
9 JobName=twovoltape
10 . scripts/functions
11
12 if test x${AUTOCHANGER} = x/dev/null ; then
13    echo "two-volume-tape test skipped. No autochanger."
14    exit
15 fi
16
17 scripts/cleanup
18 scripts/copy-2tape-confs
19 scripts/prepare-two-tapes
20  
21 echo "${cwd}/build" >/tmp/file-list
22
23 outf="tmp/sed_tmp"
24 echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
25 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
26 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
27
28 change_jobname $JobName
29 start_test
30
31 # Write out bconsole commands
32 cat <<END_OF_DATA >tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out tmp/log1.out
36 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Default drive=0
37 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Default drive=0
38 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=0
39 sql
40 select * from Storage;
41 select VolumeName,InChanger,StorageId from Media;
42
43 @#setdebug level=1000 client 
44 run job=$JobName yes
45 wait
46 sql
47 select * from Storage;
48 select VolumeName,InChanger,StorageId from Media;
49
50 messages
51 quit
52 END_OF_DATA
53
54 run_bacula
55 check_for_zombie_jobs storage=DDS-4
56 stop_bacula
57
58 mt -f ${TAPE_DRIVE} rewind
59 mtx -f ${AUTOCHANGER} unload
60 sleep 15
61
62 cat <<END_OF_DATA >tmp/bconcmds
63 @$out /dev/null
64 messages
65 @# 
66 @# now do a restore
67 @#
68 @$out tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
70 yes
71 wait
72 messages
73 @$out
74 quit
75 END_OF_DATA
76
77 run_bacula
78 check_for_zombie_jobs storage=DDS-4
79 stop_bacula
80
81 check_two_logs
82 check_restore_diff
83 end_test