]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-swap-test
regress: Add test that mixes mssql and systemstate
[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-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 @$out /dev/null
33 messages
34 @$out ${cwd}/tmp/log1.out
35 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
36 label storage=tape volume=TestVolume002 slot=2 Pool=Default drive=1
37 status storage=tape
38 @#setdebug level=120 storage=tape
39 run job=$JobName level=Full yes
40 @sleep 2
41 run job=$JobName level=Full yes
42 wait
43 list volumes
44 list jobs
45 update volume=TestVolume001 maxvolbytes=40123123
46 setdebug level=150 storage=tape
47 run job=$JobName level=Full yes
48 wait
49 list volumes
50 list jobs
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 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_bconsole
71 check_for_zombie_jobs storage=tape
72 stop_bacula
73
74 check_two_logs
75 check_restore_diff
76
77 end_test