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