]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-swap-test
Ensure correct client specified when checking for zombies
[bacula/bacula] / regress / tests / 2drive-swap-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-swap"
9 JobName="2drive-swap"
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=1 Pool=Default drive=0
35 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
36 status storage=DDS-4
37 @#setdebug level=120 storage=DDS-4
38 run job=$JobName level=Full yes
39 @sleep 2
40 run job=$JobName level=Full yes
41 wait
42 list volumes
43 list jobs
44 update volume=TestVolume001 maxvolbytes=40123123
45 setdebug level=150 storage=DDS-4
46 run job=$JobName level=Full yes
47 wait
48 list volumes
49 list jobs
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 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_bconsole
71 check_for_zombie_jobs storage=DDS-4
72 stop_bacula
73
74 check_two_logs
75 check_restore_diff
76
77 end_test