]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - continuous/gw-setup/run.pl
Fail when measured latnecy is zero
[can-benchmark.git] / continuous / gw-setup / run.pl
index f1bfe33fcca9fddf8bde06d1f7fdd8682bec55c8..2572ef0343c2f72ab2c8f8aa3c698f92442528f3 100755 (executable)
@@ -14,7 +14,9 @@ $|=1;
 
 my $ready;
 while (<$boot>){
 
 my $ready;
 while (<$boot>){
-  last if ($ready = /Welcome to Buildroot/ || /UGW started/);
+    last if ($ready = m/Welcome to Buildroot/ ||
+                     m/UGW started/ ||
+                     m/t...a...s...k...s... ...s...t...a...r...t...e...d/); # RTEMS has bug - it sends 4 characters instead of just one
 }
 die "Boot failed" unless $ready;
 
 }
 die "Boot failed" unless $ready;
 
@@ -30,6 +32,7 @@ set -e
 source tmp-stat.txt
 for i in sent lost enobufs $(seq -f percentile%g 0 10 100); do keyval="$keyval $i=$((i))"; done
 echo "! PERF: gw_latency $avg µs $keyval ok"
 source tmp-stat.txt
 for i in sent lost enobufs $(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
 exit $r
 EOF
 
 exit $r
 EOF
 
@@ -42,11 +45,13 @@ sub kill_boot() { kill('TERM', -$pid) if defined $pid; }
 sub run_boot()
 {
     # die("No boot command") if ($#ARGV eq -1);
 sub run_boot()
 {
     # die("No boot command") if ($#ARGV eq -1);
-    my $bootcmd = "'".join("' '", @ARGV)."'";
-
-    $bootcmd ||= "$FindBin::Bin/boot";
+    my $bootcmd = scalar @ARGV ? "'".join("' '", @ARGV)."'" : "$FindBin::Bin/boot";
 
     $SIG{INT} = sub { kill_boot(); exit; };
 
     $SIG{INT} = sub { kill_boot(); exit; };
+    $SIG{HUP} = sub { kill_boot(); exit; };
+    $SIG{ALRM} = sub { kill_boot(); exit; };
+    $SIG{TERM} = sub { kill_boot(); exit; };
+    $SIG{QUIT} = sub { kill_boot(); exit; };
 
     pipe($boot, $wh) || die("pipe: $!");
     my $pid = fork() // die("fork: $!");
 
     pipe($boot, $wh) || die("pipe: $!");
     my $pid = fork() // die("fork: $!");