]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/big-virtual-changer-test
regress: Add test that mixes mssql and systemstate
[bacula/bacula] / regress / tests / big-virtual-changer-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory. Create three
4 #   tapes, each in a different pool, then run two jobs both of which
5 #   want the disk that is not loaded.  Note, they both have     
6 #   prefers non-mounted tapes.  This should expose bug #801
7 #
8 #  This test the SD Virtual autochanger feature.  It is a disk based
9 #    "autochanger", but does not use any changer script.
10 #
11 TestName="big-virtual-changer"
12 JobName="bigvirtualchanger"
13 . scripts/functions
14
15 scripts/cleanup
16 scripts/copy-2disk-drive-confs
17 scripts/prepare-disk-changer
18
19 CLIENT=2drive2disk
20
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22 echo "${cwd}/build" >>${cwd}/tmp/file-list
23 echo "${cwd}/build" >>${cwd}/tmp/file-list
24 echo "${cwd}/build" >>${cwd}/tmp/file-list
25 echo "${cwd}/build" >>${cwd}/tmp/file-list
26 echo "${cwd}/build" >>${cwd}/tmp/file-list
27 #change_jobname Virtual $JobName
28 start_test
29
30 # Turn off Prefer Mounted Volumes so we use 2 drives
31 outf="${cwd}/tmp/sed_tmp"
32 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
33 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
34 # Comment the next line out to write everything to one drive
35 #  otherwise, it writes the two jobs to different drives
36 #sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
37
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 @$out /dev/null
41 messages
42 @$out ${cwd}/tmp/log1.out
43 setdebug level=10 storage=Virtual
44 @#setdebug level=200 client=$CLIENT 
45 label storage=Virtual volume=TestVolume001 slot=1 Pool=Default drive=0
46 label storage=Virtual volume=TestVolume002 slot=2 Pool=Full    drive=0
47 label storage=Virtual volume=TestVolume003 slot=3 Pool=Inc     drive=1
48 label storage=Virtual volume=TestVolume004 slot=4 Pool=Default drive=0
49 status storage=Virtual
50 run job=Virtual level=Full Pool=Default yes
51 run job=Virtual level=Full Pool=Default yes
52 run job=Virtual level=Full Pool=Default yes
53 run job=Virtual level=Full Pool=Default yes
54 run job=Virtual level=Full Pool=Default yes
55 run job=Virtual level=Full Pool=Default yes
56 run job=Virtual level=Full Pool=Default yes
57 run job=Virtual level=Full Pool=Default yes
58 run job=Virtual level=Full Pool=Default yes
59 status storage=Virtual
60 status client
61 @sleep 1
62 status storage=Virtual
63 status client
64 @sleep 1
65 status storage=Virtual
66 status client
67 @sleep 1
68 status storage=Virtual
69 status client
70 @sleep 1
71 status storage=Virtual
72 status client
73 @sleep 1
74 status storage=Virtual
75 status client
76 @sleep 1
77 status storage=Virtual
78 status client
79 @sleep 1
80 status storage=Virtual
81 status client
82 @sleep 1
83 status storage=Virtual
84 status client
85 @sleep 1
86 status storage=Virtual
87 status client
88 @sleep 1
89 status storage=Virtual
90 status client
91 @sleep 1
92 status storage=Virtual
93 status client
94 @sleep 1
95 status storage=Virtual
96 status client
97 @sleep 5
98 status storage=Virtual
99 status client
100 list volumes
101 wait
102 list volumes
103 list jobs
104 status storage=Virtual
105 status client
106 messages
107 quit
108 END_OF_DATA
109
110 # exit
111
112 run_bacula
113 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
114 @$out /dev/null
115 messages
116 @# 
117 @# now do a restore
118 @#
119 @$out ${cwd}/tmp/log2.out
120 restore where=${cwd}/tmp/bacula-restores select all storage=Virtual done
121 yes
122 wait
123 messages
124 quit
125 END_OF_DATA
126
127 run_bconsole
128
129 check_for_zombie_jobs storage=Virtual
130 stop_bacula
131
132 check_two_logs
133 check_restore_diff
134
135 end_test