]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-2job-test
Commit libdbi changes
[bacula/bacula] / regress / tests / 2drive-2job-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 TestName="2drive-2job"
9 JobName="2drive2job"
10 . scripts/functions
11
12 scripts/cleanup
13 scripts/copy-2disk-drive-confs
14 scripts/prepare-two-disks
15
16 change_jobname NightlySave $JobName
17 start_test
18
19 echo "${cwd}/build" >${cwd}/tmp/file-list
20
21 # Turn off Prefer Mounted Volumes so we use 2 drives
22 outf="${cwd}/tmp/sed_tmp"
23 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
24 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
25 # Comment the next line out to write everything to one drive
26 #  otherwise, it writes the two jobs to different drives
27 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
28
29 # Write out bconsole commands
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
31 @output /dev/null
32 messages
33 @$out ${cwd}/tmp/log1.out
34 label storage=DDS-4 volume=TestVolume001 slot=2 Pool=Default drive=0
35 label storage=DDS-4 volume=TestVolume002 slot=1 Pool=Default drive=1
36 status storage=DDS-4
37 @#unmount storage=DDS-4 drive=0
38 @#unmount storage=DDS-4 drive=1
39 @#mount storage=DDS-4 slot=2 drive=0
40 @#mount storage=DDS-4 slot=1 drive=1
41 status storage=DDS-4
42 setdebug level=120 storage=DDS-4
43 run job=$JobName level=Full yes
44 @sleep 2
45 run job=$JobName level=Full yes
46 status storage=DDS-4
47 wait
48 list volumes
49 list jobs
50 status storage=DDS-4
51 messages
52 quit
53 END_OF_DATA
54
55 run_bacula
56
57 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
58 @$out /dev/null
59 messages
60 @# now do a restore
61 @#
62 @$out ${cwd}/tmp/log2.out
63 @#unmount storage=DDS-4 drive=0
64 @#unmount storage=DDS-4 drive=1
65 @#mount storage=DDS-4 slot=1 drive=0
66 @#mount storage=DDS-4 slot=2 drive=1
67 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
68 yes
69 wait
70 messages
71 @$out
72 quit
73 END_OF_DATA
74
75 run_bconsole
76 check_for_zombie_jobs storage=DDS-4
77 stop_bacula
78
79 check_two_logs
80 check_restore_diff
81
82 end_test