]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-volume-tape
Fix bad slot
[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" >${cwd}/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=$SLOT1 pool=Default drive=$DRIVE1
37 label storage=DDS-4 volume=TestVolume002 slot=$SLOT2 pool=Default drive=$DRIVE1
38 update Volume=TestVolume001 MaxVolBytes=3000000 pool=Default drive=$DRIVE1
39 sql
40 select * from Storage;
41 select VolumeName,InChanger,Slot,StorageId from Media;
42
43 @#setdebug level=1000 client 
44 @#setdebug level=250 storage=DDS-4
45 run job=$JobName yes
46 wait
47 sql
48 select * from Storage;
49 select VolumeName,InChanger,Slot,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