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