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