]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-tape
ebl remove sed s///i for freebsd and solaris
[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 @#setdebug level=1000 client 
42 run job=$JobName yes
43 wait
44 messages
45 quit
46 END_OF_DATA
47
48 run_bacula
49 check_for_zombie_jobs storage=DDS-4
50 stop_bacula
51
52 mt -f ${TAPE_DRIVE} rewind
53 mtx -f ${AUTOCHANGER} unload
54 sleep 15
55
56 cat <<END_OF_DATA >tmp/bconcmds
57 @$out /dev/null
58 messages
59 @# 
60 @# now do a restore
61 @#
62 @$out tmp/log2.out
63 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
64 yes
65 wait
66 messages
67 @$out
68 quit
69 END_OF_DATA
70
71 run_bacula
72 check_for_zombie_jobs storage=DDS-4
73 stop_bacula
74
75 check_two_logs
76 check_restore_diff
77 end_test