]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Test Job maximum bandwidth parameter
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 11:42:20 +0000 (12:42 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 25 Nov 2010 14:21:59 +0000 (15:21 +0100)
regress/tests/maxbw-test

index d67facee3dc2ea55c0ed3e92729e117e5e2c6a42..6b9ea6a72f5e086f391e2435555ef08adbfe9690 100755 (executable)
@@ -21,7 +21,7 @@ cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 messages
 @$out ${cwd}/tmp/log1.out
 label storage=File volume=TestVolume001
-run job=$JobName yes
+run level=full job=$JobName yes
 wait
 messages
 quit
@@ -43,8 +43,6 @@ END_OF_DATA
 
 run_bconsole
 
-check_two_logs
-
 stop_bacula
 
 awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" } 
@@ -55,9 +53,52 @@ awk '/Rate:/ { if ($2 > 2500 && $2 < 3500) { print "OK" }
 
 a=`grep OK $tmp/res | wc -l`
 if [ $a -ne 2 ]; then
-    print_debug "ERROR: problem with backup or restore speed"
+    print_debug "ERROR: problem with backup or restore speed on bacula-fd.conf"
 fi
 
+sed -i 's/MaximumBandwidth.*//g' $conf/bacula-fd.conf
+
+$bperl -e 'add_attribute("$conf/bacula-dir.conf", "MaximumBandwidth", "3MB/s", "Job", "$JobName")'
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@$out /dev/null
+messages
+@$out ${cwd}/tmp/log1.out
+run level=full 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
+
+stop_bacula
+
+check_two_logs
+
+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 3 ]; then
+    print_debug "ERROR: problem with backup or restore speed on bacula-dir.conf"
+fi
 
 end_test