3 # Verify Maximum Bandwidth FD parameter
11 scripts/copy-test-confs
13 $bperl -e 'add_attribute("$conf/bacula-fd.conf", "MaximumBandwidth", "3MB/s", "FileDaemon")'
15 echo $cwd/build > $tmp/file-list
19 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
22 @$out ${cwd}/tmp/log1.out
23 label storage=File volume=TestVolume001
24 run level=full job=$JobName yes
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36 @$out ${cwd}/tmp/log2.out
37 restore where=$tmp select all done
48 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
49 else { print "ERROR" }}' $tmp/log1.out > $tmp/res
51 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
52 else { print "ERROR" }}' $tmp/log2.out >> $tmp/res
54 a=`grep OK $tmp/res | wc -l`
56 print_debug "ERROR: problem with backup or restore speed on bacula-fd.conf"
59 sed -i 's/MaximumBandwidth.*//g' $conf/bacula-fd.conf
61 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumBandwidth", "3MB/s", "Job", "$JobName")'
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
66 @$out ${cwd}/tmp/log1.out
67 run level=full job=$JobName yes
75 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
79 @$out ${cwd}/tmp/log2.out
80 restore where=$tmp select all done
93 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
94 else { print "ERROR" }}' $tmp/log1.out > $tmp/res
96 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
97 else { print "ERROR" }}' $tmp/log2.out >> $tmp/res
99 a=`grep OK $tmp/res | wc -l`
100 if [ $a -ne 3 ]; then
101 print_debug "ERROR: problem with backup or restore speed on bacula-dir.conf"