]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bad-label-changer
Rename manual tape test
[bacula/bacula] / regress / tests / bad-label-changer
1 #!/bin/sh
2 #
3 # Label two tapes, write to the first, then recycle it and destroy
4 #  the header.  Bacula should discover that, mark the tape in 
5 #  error and continue onto the second tape.
6 #
7 TestName="bad-label-changer"
8 JobName=badlabelchanger
9 . scripts/functions
10
11 require_tape_drive
12 require_autochanger
13
14 scripts/cleanup
15 scripts/copy-2tape-confs
16 scripts/prepare-two-tapes
17  
18 echo "${cwd}/build" >${cwd}/tmp/file-list
19
20 outf="tmp/sed_tmp"
21 echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
22 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
23 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
24
25 change_jobname $JobName
26 start_test
27
28 # Write out bconsole commands
29 cat <<END_OF_DATA >tmp/bconcmds
30 @$out /dev/null
31 messages
32 @$out tmp/log1.out
33 label storage=DDS-4 volume=TestVolume002 slot=$SLOT2 pool=Default drive=$DRIVE1
34 label storage=DDS-4 volume=TestVolume001 slot=$SLOT1 pool=Default drive=$DRIVE1
35 @#setdebug level=10 client=$CLIENT 
36 setdebug level=150 storage=DDS-4
37 run job=$JobName yes
38 wait
39 purge volume=TestVolume001
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45 check_for_zombie_jobs storage=DDS-4
46 stop_bacula
47
48 # Overwrite TestVolume001 label
49 init_drive ${TAPE_DRIVE}
50
51 cat <<END_OF_DATA >tmp/bconcmds
52 @$out /dev/null
53 messages
54 list volumes
55 run job=$JobName level=Full storage=DDS-4 yes
56 wait
57 messages
58 @# 
59 @# now do a restore
60 @#
61 @$out tmp/log2.out
62 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
63 yes
64 wait
65 messages
66 @$out
67 quit
68 END_OF_DATA
69
70 run_bacula
71 check_for_zombie_jobs storage=DDS-4
72 stop_bacula
73
74 check_two_logs
75 check_restore_diff
76 end_test