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