3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Verify Maximum Bandwidth FD parameter
14 # This test does not work
19 scripts/copy-test-confs
21 $bperl -e 'add_attribute("$conf/bacula-fd.conf", "CommCompression", "no", "FileDaemon")'
22 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "CommCompression", "no", "Director")'
23 $bperl -e 'add_attribute("$conf/bacula-sd.conf", "CommCompression", "no", "Storage")'
24 $bperl -e 'add_attribute("$conf/bacula-fd.conf", "MaximumBandwidthPerJob", "3MB/s", "FileDaemon")'
26 echo $cwd/build > $tmp/file-list
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out ${cwd}/tmp/log1.out
34 label storage=File volume=TestVolume001
35 run level=full job=$JobName yes
43 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
47 @$out ${cwd}/tmp/log2.out
48 restore where=$tmp select all done
59 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
60 else { print "ERROR " $0 "(> 2500 && < 3500)" }}' $tmp/log1.out > $tmp/res
62 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
63 else { print "ERROR" $0 "(> 2500 && < 3500)" }}' $tmp/log2.out >> $tmp/res
65 a=`grep OK $tmp/res | wc -l`
67 print_debug "ERROR: problem with backup or restore speed on bacula-fd.conf"
72 sed 's/MaximumBandwidth.*//g' $conf/bacula-fd.conf >$conf/bacula-fd.conf.tmp
73 mv -f $conf/bacula-fd.conf.tmp $conf/bacula-fd.conf
75 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumBandwidth", "3MB/s", "Job", "$JobName")'
77 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
80 @$out ${cwd}/tmp/log1.out
81 run level=full job=$JobName yes
89 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
93 @$out ${cwd}/tmp/log2.out
94 restore where=$tmp select all done
107 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
108 else { print "ERROR" $0 "(> 2500 && < 3500)" }}' $tmp/log1.out > $tmp/res
110 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
111 else { print "ERROR" $0 "(>2500 && < 3500)" }}' $tmp/log2.out >> $tmp/res
113 a=`grep OK $tmp/res | wc -l`
114 if [ $a -ne 3 ]; then
115 print_debug "ERROR: problem with backup or restore speed on bacula-dir.conf"