From 2c56cfb6f9e9fa6c85cb3eddceb036200697f835 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 17 Oct 2014 15:44:11 +0200 Subject: [PATCH] Improve continuous tests runner - Do not run ifup scripts. They restart openssh server and if this happens too often, systemd marks it as failed. - Output newly added out_of_range statistics - Use bc to compare floating point "$avg" - otherwise, there is a warning. Also use herestring syntax (<<<) available in bash and zsh. --- continuous/gw-setup/run.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/continuous/gw-setup/run.pl b/continuous/gw-setup/run.pl index f31fd55..713f044 100755 --- a/continuous/gw-setup/run.pl +++ b/continuous/gw-setup/run.pl @@ -21,16 +21,17 @@ $exp->expect(120, # Measure latencies my $latester = ' set -e -rm -f tmp-stat.txt echo "Starting latester" -sudo /sbin/ifdown eth0 +rm -f tmp-stat.txt +sudo /sbin/ifdown --no-scripts eth0 r=0 sudo ~/bin/latester -d can0 -d can1 -d can2 -c 3200 -q --oneattime -n tmp || r=$? -sudo /sbin/ifup eth0 +sudo /sbin/ifup --no-scripts eth0 source tmp-stat.txt -for i in sent lost enobufs $(seq -f percentile%g 0 10 100); do keyval="$keyval $i=$((i))"; done +unset keyval +for i in sent lost enobufs out_of_range_below out_of_range_above $(seq -f percentile%g 0 10 100); do keyval="$keyval $i=$((i))"; done echo "! PERF: gw_latency $avg µs $keyval ok" -test $avg -eq 0 && exit 1 +if [ $(bc -l <<< "$avg == 0") -eq 1 ]; then exit 1; fi exit $r '; -- 2.39.2