]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/two-vol-manual-tape
Update two-vol-manual-tape
[bacula/bacula] / regress / tests / two-vol-manual-tape
1 #!/bin/sh
2 #
3 # Run a job with a limited tape size so that the tape fills up.
4 #  Then manually unload the tape and load a new one, label
5 #  it.
6 #
7 TestName="two-vol-manual-tape"
8 JobName=twovolmanualtape
9 . scripts/functions
10
11 require_tape_drive
12 require_autochanger
13
14 scripts/cleanup
15 scripts/copy-tape-confs
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17 MTX=$AUTOCHANGER_SCRIPT
18
19 # Sleep longer if real tape
20 if [ x${USE_VTAPE} = xyes ] ; then
21    sleep=20 
22 else
23    sleep=90
24 fi
25
26 slot=0
27 export slot
28
29 # TODO -- check this
30 init_slot $TAPE_DRIVE $SLOT1
31 init_slot $TAPE_DRIVE $SLOT2
32
33 load_slot1
34
35 init_drive ${TAPE_DRIVE}
36
37 change_jobname $JobName
38 start_test
39
40 # Label second volume
41 cat <<END_OF_DATA >tmp/bconcmds
42 @out /dev/null
43 messages
44 @$out tmp/log1.out
45 label storage=DDS-4 volume=TestVolume002 slot=0 pool=Default drive=0
46 unmount storage=DDS-4
47 quit
48 END_OF_DATA
49
50 run_bacula
51
52 # Load slot2
53 load_other_slot $slot
54 init_drive ${TAPE_DRIVE}
55
56 # label first volume, and run first half of job
57 cat <<END_OF_DATA >tmp/bconcmds
58 @$out tmp/log1.out
59 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
60 update Volume=TestVolume001 MaxVolBytes=500000 pool=Default drive=0
61 list volumes
62 setdebug level=150 storage=DDS-4
63 run job=$JobName yes
64 @# This sleep must be long enough for the first tape to fill (4MB)
65 @#  otherwise the following mtx-changer commands will fail
66 @sleep $sleep
67 list volumes
68 unmount storage=DDS-4
69 list volumes
70 status storage=DDS-4
71 messages
72 quit
73 END_OF_DATA
74
75 run_bconsole
76
77
78 load_other_slot $slot
79 init_drive ${TAPE_DRIVE}
80
81 cat <<END_OF_DATA >tmp/bconcmds
82 mount storage=DDS-4
83 @# backup should continue
84 wait
85 @# 
86 @# now do a restore
87 @#
88 @#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
89 @#yes
90 wait
91 list volumes
92 messages
93 @$out
94 quit
95 END_OF_DATA
96
97 # run second half of backup + restore
98 run_bconsole
99
100 touch tmp/log2.out
101  
102 check_for_zombie_jobs storage=DDS-4
103 stop_bacula
104
105 check_two_logs
106 #check_restore_diff
107 dstat=0   # no diff
108 rstat=0   # no restore
109 end_test