]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - continuous/gw-setup/run.pl
run.pl: Better error messages
[can-benchmark.git] / continuous / gw-setup / run.pl
index f9de8f2a4902216d5888a534d4567b6952236c8e..e27a68277d7d08c25abb84e1814b8416a7bc3a92 100755 (executable)
@@ -11,22 +11,22 @@ system("cat > $S99; chmod +x $S99") unless -t STDIN;
 # Boot the gateway
 # die("No boot command") if ($#ARGV eq -1);
 my $bootcmd = scalar @ARGV ? "'".join("' '", @ARGV)."'" : "$FindBin::Bin/boot";
-$exp = Expect->spawn($bootcmd);
+$exp = Expect->spawn($bootcmd) or die "Cannot spawn $bootcmd: $!";
 $exp->expect(120,
             'Welcome to Buildroot',
             'UGW started',
             '-re', 't...a...s...k...s... ...s...t...a...r...t...e...d') # RTEMS has bug - it sends 4 characters instead of just one
-    or die "Cannot spawn $bootcmd: $!";
+    or die("Boot failed");
 
 # Measure latencies
 my $latester=<<'EOF';
-set -x
+set -e
 rm -f tmp-stat.txt
 echo "Starting latester"
-sudo ifdown eth0
+sudo /sbin/ifdown eth0
 sudo ~/bin/latester -d can0 -d can1 -d can2 -c 3200 -q --oneattime -n tmp
 r=$?
-sudo ifup eth0
+sudo /sbin/ifup eth0
 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
@@ -36,5 +36,5 @@ exit $r
 EOF
 
 my $status = system((qw(ssh -T glab), $latester));
-$exp->soft_close();
+$exp->close();
 exit($status >> 8);