]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-offline-test
Add Allow Duplicate Jobs to copy-uncopied-test regression test for bug #1751
[bacula/bacula] / regress / tests / 2drive-offline-test
1 #!/bin/sh
2 #
3 # Set prefer mounted volumes to no to try to force use of
4 #   the drive swap code.
5 #
6 # This script uses the virtual disk autochanger and two drives
7 #
8 # It tests starting job 1, which will not complete because FD is
9 #   offline, then starting job 2, which wants to swap the volume.
10 #
11 TestName="2drive-offline"
12 JobName="2driveoffline"
13 . scripts/functions
14
15 scripts/cleanup
16 scripts/copy-2disk-drive-confs
17 scripts/prepare-disk-changer
18 CLIENT=2drive2disk
19
20 change_jobname NightlySave $JobName
21 start_test
22
23 echo "${cwd}/build" >${cwd}/tmp/file-list
24
25 # Turn off Prefer Mounted Volumes so we use 2 drives
26 outf="${cwd}/tmp/sed_tmp"
27 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
28 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
29 # Comment the next line out to write everything to one drive
30 #  otherwise, it writes the two jobs to different drives
31 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
32
33 # Write out bconsole commands
34 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
35 @$out /dev/null
36 messages
37 @$out ${cwd}/tmp/log1.out
38 label storage=tape volume=TestVolume001 slot=2 Pool=Default drive=0
39 label storage=tape volume=TestVolume002 slot=1 Pool=Default drive=1
40 status storage=tape
41 setdebug level=120 storage=tape
42 run job=Offline level=Full yes
43 @sleep 2
44 run job=$JobName level=Full yes
45 status storage=tape
46 wait
47 list volumes
48 list jobs
49 status storage=tape
50 messages
51 quit
52 END_OF_DATA
53
54 run_bacula
55
56 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
57 @$out /dev/null
58 messages
59 @# now do a restore
60 @#
61 @$out ${cwd}/tmp/log2.out
62 @#unmount storage=tape drive=0
63 @#unmount storage=tape drive=1
64 @#mount storage=tape slot=1 drive=0
65 @#mount storage=tape slot=2 drive=1
66 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
67 yes
68 wait
69 messages
70 quit
71 END_OF_DATA
72
73 run_bconsole
74 check_for_zombie_jobs storage=tape
75 stop_bacula
76
77 check_two_logs
78 check_restore_diff
79
80 end_test