]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/next-vol-bug-7302
Big backport from Enterprise
[bacula/bacula] / regress / tests / next-vol-bug-7302
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # This should expose bug #7302
7 #
8 # This script uses the virtual disk autochanger and 30 drives
9 #
10 TestName="next-vol-bug-7302"
11 JobName="backup"
12 . scripts/functions
13
14 scripts/cleanup
15 scripts/copy-2disk-tape-confs
16 CLIENT=2drive2disk
17
18 echo "${cwd}/build" >${cwd}/tmp/file-list
19 change_jobname NightlySave $JobName
20 start_test
21
22 # Turn on automatic label
23 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "LabelFormat", "vol", "Pool")'
24 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "LabelMedia", "yes", "Device")'
25
26 # Allow only one job per volume
27 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumVolumeJobs", "1", "Pool")'
28 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "MaximumConcurrentJobs", "1", "Device")'
29
30 # turn off spooling
31 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "SpoolData", "no", "Job")'
32
33 # Create 30 drives for autochanger tape
34 for i in `seq 2 40`; do
35     $bperl -e 'extract_resource("$conf/bacula-sd.conf", "Device", "Drive-0")' | \
36         sed "s/Drive-0/Drive-$i/" >> $conf/bacula-sd.conf
37 done
38
39 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "Device", join(",", map { "Drive-$_" } 0..30), "Autochanger", "tape")' 
40
41 # Write out bconsole commands
42 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
43 @out /dev/null
44 messages
45 @$out ${cwd}/tmp/log1.out
46 @#setdebug level=100 client=$CLIENT
47 setbandwidth client limit="2000 kb/s"
48 run job=$JobName level=Full Pool=Default yes
49 run job=$JobName level=Full Pool=Default yes
50 run job=$JobName level=Full Pool=Default yes
51 run job=$JobName level=Full Pool=Default yes
52 run job=$JobName level=Full Pool=Default yes
53 run job=$JobName level=Full Pool=Default yes
54 run job=$JobName level=Full Pool=Default yes
55 run job=$JobName level=Full Pool=Default yes
56 run job=$JobName level=Full Pool=Default yes
57 run job=$JobName level=Full Pool=Default yes
58 run job=$JobName level=Full Pool=Default yes
59 run job=$JobName level=Full Pool=Default yes
60 run job=$JobName level=Full Pool=Default yes
61 run job=$JobName level=Full Pool=Default yes
62 run job=$JobName level=Full Pool=Default yes
63 run job=$JobName level=Full Pool=Default yes
64 run job=$JobName level=Full Pool=Default yes
65 run job=$JobName level=Full Pool=Default yes
66 run job=$JobName level=Full Pool=Default yes
67 run job=$JobName level=Full Pool=Default yes
68 run job=$JobName level=Full Pool=Default yes
69 run job=$JobName level=Full Pool=Default yes
70 run job=$JobName level=Full Pool=Default yes
71 run job=$JobName level=Full Pool=Default yes
72 run job=$JobName level=Full Pool=Default yes
73 run job=$JobName level=Full Pool=Default yes
74 run job=$JobName level=Full Pool=Default yes
75 run job=$JobName level=Full Pool=Default yes
76 run job=$JobName level=Full Pool=Default yes
77 run job=$JobName level=Full Pool=Default yes
78 run job=$JobName level=Full Pool=Default yes
79 run job=$JobName level=Full Pool=Default yes
80 run job=$JobName level=Full Pool=Default yes
81 run job=$JobName level=Full Pool=Default yes
82 run job=$JobName level=Full Pool=Default yes
83 run job=$JobName level=Full Pool=Default yes
84 run job=$JobName level=Full Pool=Default yes
85 run job=$JobName level=Full Pool=Default yes
86 run job=$JobName level=Full Pool=Default yes
87 run job=$JobName level=Full Pool=Default yes
88 run job=$JobName level=Full Pool=Default yes
89 run job=$JobName level=Full Pool=Default yes
90 run job=$JobName level=Full Pool=Default yes
91 run job=$JobName level=Full Pool=Default yes
92 @sleep 2
93 list volumes
94 messages
95 @sleep 20
96 messages
97 @sleep 20
98 messages
99 status storage=tape
100 status dir
101 list volumes
102 setbandwidth client limit="100000000 kb/s"
103 wait
104 messages
105 list volumes
106 quit
107 END_OF_DATA
108
109 # exit
110
111 run_bacula
112
113 check_for_zombie_jobs storage=tape
114 stop_bacula
115
116 touch $tmp/log2.out
117 check_two_logs
118
119 end_test