]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Test if the restarted job is using the correct pool
authorEric Bollengier <eric@baculasystems.com>
Wed, 12 Dec 2018 09:53:26 +0000 (10:53 +0100)
committerKern Sibbald <kern@sibbald.com>
Wed, 12 Dec 2018 11:13:24 +0000 (12:13 +0100)
regress/tests/restart-job-test

index c1ead85e2e9cf70ba6ddc3733da4f377117117dc..e4f10c4a9999f0d3a8b6600432ad97b8b31261de 100755 (executable)
@@ -21,19 +21,32 @@ echo "${cwd}/build" >${cwd}/tmp/file-list
 change_jobname NightlySave $JobName
 start_test
 
+cat <<EOF >> $conf/bacula-dir.conf
+Pool {
+  Name = PoolA
+  Pool Type = Backup
+  Recycle = yes                       # Bacula can automatically recycle Volumes
+  AutoPrune = yes                     # Prune expired volumes
+  Volume Retention = 365d             # one year
+  Label Format = "Vol"
+  Maximum Volume Bytes = 30MB
+}
+EOF
+
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @output /dev/null
 messages
 @$out ${cwd}/tmp/log1.out
 setdebug level=0 trace=0 hangup=596 client
 @#setdebug level=20 dir
-label storage=File volume=TestVolume001 slot=1 drive=0
-run job=$JobName yes
+run job=$JobName yes pool=PoolA
 wait
 messages
 sql
 select * from JobMedia where JobId=1;
 
+@$out $tmp/log3.out
+list pools
 quit
 END_OF_DATA
 
@@ -59,6 +72,19 @@ run_bconsole
 scripts/check_for_zombie_jobs storage=File
 stop_bacula
 
+nb=`awk '/Default/ { print $6 }' $tmp/log3.out`
+if [ "$nb" -ne 0  ]; then
+    print_debug "ERROR: volumes should come from PoolA in $tmp/log3.out"
+    estat=1
+fi
+
+nb=`awk '/PoolA/ { print $6 }' $tmp/log3.out`
+if [ "$nb" -lt 1  ]; then
+    print_debug "ERROR: volumes should go to PoolA in $tmp/log3.out"
+    estat=1
+fi
+
+
 check_two_logs
 check_restore_diff
 end_test