3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Verify Maximum Bandwidth FD parameter
16 scripts/copy-test-confs
18 $bperl -e 'add_attribute("$conf/bacula-fd.conf", "CommCompression", "no", "FileDaemon")'
19 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "CommCompression", "no", "Director")'
20 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "CommCompression", "no", "Storage")'
21 $bperl -e 'add_attribute("$conf/bacula-fd.conf", "MaximumBandwidthPerJob", "3MB/s", "FileDaemon")'
23 echo $cwd/build > $tmp/file-list
27 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
30 @$out ${cwd}/tmp/log1.out
31 label storage=File volume=TestVolume001
32 run level=full job=$JobName yes
40 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
44 @$out ${cwd}/tmp/log2.out
45 restore where=$tmp select all done
56 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
57 else { print "ERROR " $0 "(> 2500 && < 3500)" }}' $tmp/log1.out > $tmp/res
59 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
60 else { print "ERROR" $0 "(> 2500 && < 3500)" }}' $tmp/log2.out >> $tmp/res
62 a=`grep OK $tmp/res | wc -l`
64 print_debug "ERROR: problem with backup or restore speed on bacula-fd.conf"
69 sed 's/MaximumBandwidth.*//g' $conf/bacula-fd.conf >$conf/bacula-fd.conf.tmp
70 mv -f $conf/bacula-fd.conf.tmp $conf/bacula-fd.conf
72 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumBandwidth", "3MB/s", "Job", "$JobName")'
74 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
77 @$out ${cwd}/tmp/log1.out
78 run level=full job=$JobName yes
86 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
90 @$out ${cwd}/tmp/log2.out
91 restore where=$tmp select all done
104 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
105 else { print "ERROR" $0 "(> 2500 && < 3500)" }}' $tmp/log1.out > $tmp/res
107 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
108 else { print "ERROR" $0 "(>2500 && < 3500)" }}' $tmp/log2.out >> $tmp/res
110 a=`grep OK $tmp/res | wc -l`
111 if [ $a -ne 3 ]; then
112 print_debug "ERROR: problem with backup or restore speed on bacula-dir.conf"