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