Commit adabb1b4 authored by Timothy Stack's avatar Timothy Stack
Browse files

Run loghole in the other exit paths when linktest fails.

parent b31c0e8d
......@@ -299,12 +299,17 @@ sub notify()
my $logname = undef;
my $isopen;
my $filespec = "";
my $errbody = "";
TBExptGetLogFile($pid, $eid, \$logname, \$isopen);
if (defined($logname)) {
$filespec = "\n\nfile://$logname\n";
}
if (-e $errlog) {
$errbody = `/bin/cat $errlog`;
}
SENDMAIL($TBOPS,
"Linktest Failure: $pid/$eid",
"Failure in linktest (level $lev); ".
......@@ -313,7 +318,7 @@ sub notify()
" $TBBASE/spewlogfile.php3?pid=${pid}&eid=${eid}\n".
"$filespec\n".
"\n".
`/bin/cat $errlog`,
$errbody,
"$user_name <$user_email>");
}
......
......@@ -252,6 +252,8 @@ sub handler($)
else {
print "*** Linktest has been aborted\n";
}
&run_loghole;
exit(1);
}
......@@ -284,6 +286,8 @@ if (($child_pid = fork())) {
$exitval = $?;
alarm 0;
if ($exitval) {
&run_loghole;
exit($exitval >> 8);
}
exit(&analyze());
......@@ -363,14 +367,7 @@ sub analyze {
return 0
if (! @dir_contents);
my $ltlogs = "/proj/$pid/exp/$eid/tbdata/ltlogs";
print "Downloading logs...\n";
system("rm -rf $ltlogs");
system("mkdir -p $ltlogs");
system("$LOGHOLE -e $pid/$eid sync -n -l $ltlogs -r /var/emulab/logs ".
"> $ltlogs/loghole.out 2>&1");
&run_loghole;
print "***************************************************************\n";
print "***************** Linktest Error Reports **********************\n";
......@@ -433,6 +430,17 @@ sub kill_linktest_run {
}
}
sub run_loghole {
my $ltlogs = "/proj/$pid/exp/$eid/tbdata/ltlogs";
print "Downloading logs...\n";
system("rm -rf $ltlogs");
system("mkdir -p $ltlogs");
system("$LOGHOLE -e $pid/$eid sync -n -l $ltlogs -r /var/emulab/logs ".
"> $ltlogs/loghole.out 2>&1");
}
sub TBTimeStamp {
return POSIX::strftime("%H:%M:%S", localtime());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment