]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Add test for new Max Bandwidth test feature
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 24 Nov 2010 21:08:21 +0000 (22:08 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 14:21:58 +0000 (15:21 +0100)
regress/tests/maxbw-test [new file with mode: 0755]

diff --git a/regress/tests/maxbw-test b/regress/tests/maxbw-test
new file mode 100755 (executable)
index 0000000..d67face
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# Verify Maximum Bandwidth FD parameter
+#
+
+TestName="maxbw-test"
+JobName=NightlySave
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+
+$bperl -e 'add_attribute("$conf/bacula-fd.conf", "MaximumBandwidth", "3MB/s", "FileDaemon")'
+
+echo $cwd/build > $tmp/file-list
+
+start_test
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+label storage=File volume=TestVolume001
+run job=$JobName yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@# 
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=$tmp select all done
+yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+check_two_logs
+
+stop_bacula
+
+awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" } 
+               else { print "ERROR" }}' $tmp/log1.out > $tmp/res
+
+awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" } 
+               else { print "ERROR" }}' $tmp/log2.out >> $tmp/res
+
+a=`grep OK $tmp/res | wc -l`
+if [ $a -ne 2 ]; then
+    print_debug "ERROR: problem with backup or restore speed"
+fi
+
+
+
+end_test