]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/bad-label-changer
Eliminate DDS-4 in favor of tape + create btape-test-changer 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=tape volume=TestVolume002 slot=$SLOT2 pool=Default drive=$DRIVE1
34 label storage=tape volume=TestVolume001 slot=$SLOT1 pool=Default drive=$DRIVE1
35 list volumes
36 @#setdebug level=10 client=$CLIENT 
37 setdebug level=150 storage=tape
38 run job=$JobName yes
39 wait
40 purge volume=TestVolume001
41 messages
42 quit
43 END_OF_DATA
44
45 run_bacula
46 check_for_zombie_jobs storage=tape
47 stop_bacula
48
49 # Overwrite TestVolume001 label
50 init_drive ${TAPE_DRIVE}
51
52 cat <<END_OF_DATA >tmp/bconcmds
53 @$out /dev/null
54 messages
55 list volumes
56 run job=$JobName level=Full storage=tape yes
57 wait
58 messages
59 @# 
60 @# now do a restore
61 @#
62 @$out tmp/log2.out
63 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
64 yes
65 wait
66 messages
67 quit
68 END_OF_DATA
69
70 run_bacula
71 check_for_zombie_jobs storage=tape
72 stop_bacula
73
74 check_two_logs
75 check_restore_diff
76 end_test