зеркало из https://github.com/mozilla/pjs.git
Adding tbox reporting. -mcafee
This commit is contained in:
Родитель
15f64b54b3
Коммит
236d058e2a
|
@ -12,7 +12,7 @@ my $script_dir = "/builds/tinderbox/mozilla/tools/tinderbox";
|
|||
|
||||
|
||||
# Send data to graph server via HTTP.
|
||||
require "$script_dir/reportdata.pl";
|
||||
require "$script_dir/reportdata2.pl";
|
||||
|
||||
use Sys::Hostname; # for ::hostname()
|
||||
|
||||
|
@ -69,12 +69,15 @@ sub is_http_alive() {
|
|||
# main
|
||||
{
|
||||
my $alive_time = 0; # Hours http has been up.
|
||||
|
||||
my $alive = 0;
|
||||
my $timefile = "$script_dir/http_alive_timefile.$ARGV[0]";
|
||||
|
||||
|
||||
PrintUsage() if $#ARGV == -1;
|
||||
|
||||
$alive = is_http_alive();
|
||||
|
||||
if (is_http_alive()) {
|
||||
if ($alive) {
|
||||
print "$ARGV[0] is alive\n";
|
||||
|
||||
#
|
||||
|
@ -131,6 +134,22 @@ sub is_http_alive() {
|
|||
"$alive_time",
|
||||
::hostname(),
|
||||
"http_alive",
|
||||
"$ARGV[0]")
|
||||
"$ARGV[0]");
|
||||
|
||||
my $status = "";
|
||||
if($alive) {
|
||||
$status = "success";
|
||||
} else {
|
||||
$status = "busted";
|
||||
}
|
||||
|
||||
# Hard-coded for now.
|
||||
my $graph_url = "http://tegu.mozilla.org/graph/query.cgi?tbox=$ARGV[0]&testname=http_alive&autoscale=&size=&days=&units=hours<ype=&points=&avg=&showpoint=";
|
||||
|
||||
ReportData::send_tbox_packet("tinderbox-daemon\@warp.mcom.com",
|
||||
"Talkback",
|
||||
$status,
|
||||
"TinderboxPrint:<a title=\"Hours httpd:80 has been alive.\" href=\"$graph_url\">Ta</a>",
|
||||
"$ARGV[0]",
|
||||
"$ARGV[0] HTTP Alive Test");
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ require 5.003;
|
|||
|
||||
use strict;
|
||||
|
||||
$::Version = '$Revision: 1.2 $ ';
|
||||
$::Version = '$Revision: 1.3 $ ';
|
||||
|
||||
package ReportData;
|
||||
|
||||
|
@ -52,30 +52,33 @@ sub send_results_to_server {
|
|||
|
||||
# Fake a tinderbox message.
|
||||
sub send_tbox_packet {
|
||||
#my ($server, $status, $log, $build_name) = @_;
|
||||
my ($server_email, $tree, $status,
|
||||
$log, $machine, $build_name) = @_;
|
||||
|
||||
my $foo;
|
||||
|
||||
my $now = time();
|
||||
|
||||
$foo .= <<END_PRINT;
|
||||
tinderbox: tree: Talkback
|
||||
tinderbox: tree: $tree
|
||||
tinderbox: builddate: $now
|
||||
tinderbox: status: busted
|
||||
tinderbox: build: Linux btek Depend
|
||||
tinderbox: status: $status
|
||||
tinderbox: build: $build_name
|
||||
tinderbox: errorparser: unix
|
||||
tinderbox: buildfamily: unix
|
||||
tinderbox: END
|
||||
END_PRINT
|
||||
|
||||
|
||||
$foo .= $log;
|
||||
|
||||
print "foo = \n$foo\n";
|
||||
|
||||
open MSG, ">msg.txt";
|
||||
open MSG, ">msg.$machine";
|
||||
print MSG $foo;
|
||||
close MSG;
|
||||
|
||||
system "/bin/mail tinderbox-daemon\@warp.mcom.com " . "< msg.txt";
|
||||
system "/bin/mail $server_email " . "< msg.$machine";
|
||||
|
||||
|
||||
unlink "msg.txt";
|
||||
unlink "msg.$machine";
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче