]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/manual-two-vol-tape
Rename manual tape test
[bacula/bacula] / regress / tests / manual-two-vol-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 load_other_slot $slot
78
79 cat <<END_OF_DATA >tmp/bconcmds
80 @$out tmp/log1.out
81 mount storage=DDS-4
82 @# backup should continue
83 wait
84 @# 
85 @# now do a restore
86 @#
87 @#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
88 @#yes
89 wait
90 list volumes
91 messages
92 @$out
93 quit
94 END_OF_DATA
95
96 # run second half of backup + restore
97 run_bconsole
98
99 touch tmp/log2.out
100  
101 check_for_zombie_jobs storage=DDS-4
102 stop_bacula
103
104 check_two_logs
105 #check_restore_diff
106 dstat=0   # no diff
107 rstat=0   # no restore
108 end_test