3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Test various nextpool options for copy/migration
8 TestName="next-pool-test"
13 cp -f ${rscripts}/bacula-dir-2media-virtual.conf ${conf}/bacula-dir.conf
14 cp -f ${rscripts}/bacula-sd-2media-virtual.conf ${conf}/bacula-sd.conf
15 cp -f ${rscripts}/test-bacula-fd.conf ${conf}/bacula-fd.conf
16 cp -f ${rscripts}/test-console.conf ${conf}/bconsole.conf
18 echo "$cwd/build/src/dird" >${cwd}/tmp/file-list
20 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "Label Media", "Yes", "Device")'
21 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Label Format", "Vol-", "Pool")'
23 # create where the SD is putting volumes
26 # The 3rd drive doesn't have the right type
27 sed 's/disk1/disk/' $conf/bacula-sd.conf > 1
28 cp -f 1 $conf/bacula-sd.conf
32 cat <<END_OF_DATA >${tmp}/bconcmds
40 @# Looking for: FullCopy
41 run job=copy-job jobid=1
46 @# Looking for: Special
47 run job=copy-job jobid=1
55 @# Looking for: Special
56 run job=copy-job jobid=1 nextpool=Special
61 run job=copy-job-next-pool jobid=1
66 run job=copy-job-next-pool nextpool=FullCopy jobid=1
74 check_for_zombie_jobs storage=Virtual
78 # Pool: Default (From Job resource)
79 # NextPool: FullCopy (From Job Pool's NextPool resource)
80 # Read Storage: Virtual (From Job resource)
81 # Write Storage: Virtual (From Job Pool's NextPool resource)
84 # Read Pool: "Default" (From Job resource)
85 # Read Storage: "Virtual" (From Job resource)
86 # Write Pool: "FullCopy" (From Job Pool's NextPool resource)
87 # Write Storage: "Virtual" (From Job Pool's NextPool resource)
89 grep "NextPool: FullCopy (From Job Pool's NextPool resource)" $tmp/log3.out > /dev/null
91 print_debug "ERROR: Bad NextPool in $tmp/log3.out, should be FullCopy"
95 grep "Write Storage: Virtual (From Job Pool" $tmp/log3.out > /dev/null
97 print_debug "ERROR: Bad Write Storage in $tmp/log3.out, should be Virtual"
101 grep 'Write Pool: "FullCopy"' $tmp/log3.out > /dev/null
103 print_debug "ERROR: Bad Write Pool in $tmp/log3.out, should be FullCopy"
108 # Pool: Default (From Job resource)
109 # NextPool: Special (From User input)
110 # Read Storage: Virtual (From Job resource)
111 # Write Storage: Virtual (From User input)
113 # Read Pool: "Default" (From Job resource)
114 # Read Storage: "Virtual" (From Job resource)
115 # Write Pool: "Special" (From User input)
116 # Write Storage: "Virtual" (From User input)
118 grep "NextPool: Special (From User input)" $tmp/log4.out > /dev/null
120 print_debug "ERROR: Bad NextPool in $tmp/log4.out, should find Special"
124 grep "Write Storage: Virtual2 (From User input)" $tmp/log4.out > /dev/null
126 print_debug "ERROR: Bad Write Storage in $tmp/log4.out, should be Virtual"
130 grep 'Write Pool: "Special"' $tmp/log4.out > /dev/null
132 print_debug "ERROR: Bad Write Pool in $tmp/log4.out, should be Special"
137 # Pool: Default (From Job resource)
138 # NextPool: Special (From Command input)
139 # Read Storage: Virtual (From Job resource)
140 # Write Storage: Virtual2 (From Command input)
142 # Read Pool: "Default" (From Job resource)
143 # Read Storage: "Virtual" (From Job resource)
144 # Write Pool: "Special" (From Command input)
145 # Write Storage: "Virtual2" (From Command input)
147 grep "NextPool: Special (From Command input)" $tmp/log5.out > /dev/null
149 print_debug "ERROR: Bad NextPool in $tmp/log5.out, should find Special"
153 grep "Write Storage: Virtual2 (From Command input)" $tmp/log5.out > /dev/null
155 print_debug "ERROR: Bad Write Storage in $tmp/log5.out, should be Virtual"
159 grep 'Write Pool: "Special"' $tmp/log5.out > /dev/null
161 print_debug "ERROR: Bad Write Pool in $tmp/log5.out, should be Special"
167 # Pool: Default (From Job resource)
168 # NextPool: Special (From Job resource)
169 # Write Pool: "Special" (From Job resource)
171 grep "NextPool: Special (From Job resource)" $tmp/log6.out > /dev/null
173 print_debug "ERROR: Bad NextPool in $tmp/log6.out, should find Special"
177 grep 'Write Pool: "Special" (From Job resource)' $tmp/log6.out > /dev/null
179 print_debug "ERROR: Bad NextPool in $tmp/log6.out, should find Special"
184 # NextPool: FullCopy (From command line)
185 # Write Pool: "FullCopy" (From command line)
187 grep "NextPool: FullCopy (From Command input)" $tmp/log7.out > /dev/null
189 print_debug "ERROR: Bad NextPool in $tmp/log7.out, should find Special"
193 grep 'Write Pool: "FullCopy" (From Command input)' $tmp/log7.out > /dev/null
195 print_debug "ERROR: Bad NextPool in $tmp/log7.out, should find Special"