]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - continuous/gw-setup/run.pl
Add scripts to setup environment for automated tests
[can-benchmark.git] / continuous / gw-setup / run.pl
index d026b12fa0e3792e505a4e1366dd5e94e2b49553..04433d6bd102c51b15745b5ba206490ba75ea32e 100755 (executable)
@@ -34,7 +34,7 @@ my $status = system((qw(ssh -T glab), $latester));
 kill('TERM', -$pid);
 exit($status >> 8);
 
 kill('TERM', -$pid);
 exit($status >> 8);
 
-
+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);
@@ -42,6 +42,8 @@ sub run_boot()
 
     my $bootcmd = "$FindBin::Bin/boot";
 
 
     my $bootcmd = "$FindBin::Bin/boot";
 
+    $SIG{INT} = sub { kill_boot(); exit; };
+
     pipe($boot, $wh) || die("pipe: $!");
     my $pid = fork() // die("fork: $!");
     if ($pid == 0) {
     pipe($boot, $wh) || die("pipe: $!");
     my $pid = fork() // die("fork: $!");
     if ($pid == 0) {
@@ -56,4 +58,4 @@ sub run_boot()
     return $pid;
 }
 
     return $pid;
 }
 
-END { kill('TERM', -$pid) if defined $pid; }
+END { kill_boot(); }