diff --git a/bin/tests/b9tsummary.pl b/bin/tests/b9tsummary.pl index e01baefac2..6d6b561089 100755 --- a/bin/tests/b9tsummary.pl +++ b/bin/tests/b9tsummary.pl @@ -80,6 +80,10 @@ $Nobp = 0; # number of test problems $Ntprobs = 0; +# flag to signal bad test journal format +$BadTest = 0; +$BadTestReason = ""; + # # name of host serving the bind9 reports # @@ -133,21 +137,26 @@ foreach $entry (@entries) { $when = `date`; chop $when; -printf("\n"); -printf("\n"); -printf("bind9 status %s\n", $when); -printf("\n"); -printf("\n"); -printf("\n"); -printf("

\n"); -printf("

\n"); +#printf("\n"); +#printf("\n"); +#printf("bind9 status %s\n", $when); +#printf("\n"); +#printf("\n"); +#printf("\n"); +#printf("

\n"); +#printf("

\n"); + +printf("\n"); +printf("\n"); +printf("\n"); + printf("

\n"); printf("\n"); printf("\t\n"); printf("\t\n", $when); printf("\t\n"); printf("\t\n"); -printf("\t\t\n"); printf("\t\t\n"); printf("\t\t\n"); printf("\t\t\n"); @@ -166,10 +175,15 @@ foreach $host (sort @hosts) { # output end of page # +printf("\n"); printf("
 
bind9 status %s
 
host\n"); +printf("\t\thostbuild statusfatal/othertest status
\n"); -printf("
\n"); -printf("\n"); -printf("\n"); +printf("\n"); +printf("\n"); + +#printf("\n"); +#printf("\n"); +#printf("\n"); +#printf("\n"); close(DEBUG) if ($Debug); @@ -192,9 +206,11 @@ sub doHost { # # scan the build and test results files for problems # + $Nfbp = 0; $Nobp = 0; $Ntprobs = 0; + $BadTest = 0; %buildprobs = &buildCheck("$hostpath") if (-r "$hostpath/$BuildFile"); %testprobs = &testCheck("$hostpath") if (-r "$hostpath/$TestFile"); @@ -216,8 +232,11 @@ sub doHost { $bstatus = "ok"; } - if ($Nfbp) { - $tstatus = "not available"; + if ($BadTest) { + $tstatus = "not available ($BadTestReason)"; + } + elsif ($bstatus =~ /not available|broken/) { + $tstatus = "not available (no results)"; } elsif ($Ntprobs) { $tstatus = "broken"; @@ -226,6 +245,8 @@ sub doHost { $tstatus = "ok"; } + printf(DEBUG "Host %s STATUS: bstatus %s, tstatus %s, badtest %d, reason %s\n", $hostid, $bstatus, $tstatus, $BadTest, $BadTestReason) if ($Debug); + printf("\t\n"); printf("\t\t%s\n", $hostid); if ($bstatus =~ /not available/) { @@ -378,8 +399,7 @@ sub testCheck { local($hostpath) = @_; local($funcname, $anum, $atext); local(%probs); - - $Ntprobs = 0; + local($intest, $intestcase, $inassert, $ininfo, $inresult); # initialize the well known test problems array if (-f "$hostpath/$WktpFile") { @@ -393,18 +413,61 @@ sub testCheck { close(XXX); } + if (! -r "$hostpath/$TestFile") { + $BadTest = 1; + $BadTestReason = "no journal file"; + printf(DEBUG "No test journal at %s\n", "$hostpath/$TestFile") if ($Debug); + return; + } + + $intest = 0; + open(XXX, "< $hostpath/$TestFile"); + while () { + next if ($_ !~ /^(S|I|T|A|R):/); + $intest = 1 if (/^S:(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/); + if (/^T:([^:]*):([^:]*):/) { + if ($intest == 0) { + $BadTest = 1; + $BadTestReason = "T"; + } $funcname = $1; $anum = $2; + + $intestcase = 1; + $inassert = 0; + $ininfo = 0; + $inresult = 0; + next; } if (/^A:(.*)$/) { + if (($intestcase == 0) || ($inresult == 1)) { + $BadTest = 1; + $BadTestReason = "A"; + } + $inassert = 1; $atext = 1; next; } + if (/^I:(.*)$/) { + if ($inassert == 0) { + $BadTest = 1; + $BadTestReason = "I"; + } + $ininfo = 1; + next; + } if (/^R:(.*)$/) { + if (($intestcase == 0) || ($inassert == 0)) { + $BadTest = 1; + $BadTestReason = "R"; + } + $inresult = 1; + $intestcase = 0; + $result = $1; if ($result =~ /FAIL|UNRESOLVED|UNINITIATED/) { # @@ -414,9 +477,14 @@ sub testCheck { $probs{"$funcname:$anum"} = $result; ++$Ntprobs; } + next; } } close(XXX); + if ($intest == 0) { + $BadTest = 1; + $BadTestReason = "no results"; + } return(%probs); } @@ -426,8 +494,12 @@ sub wbpf { local(@messageset, $message); open(XXX, "> $B9HostPath/$hostid/$BuildProblemsFile"); - printf(XXX "\n\n"); - printf(XXX "\n"); +# printf(XXX "\n\n"); +# printf(XXX "\n"); + +# printf("\n"); +# printf("\n"); + printf(XXX "bind9 %s build problems by filename\n", $hostid); printf(XXX "\n\n"); @@ -449,7 +521,8 @@ sub wbpf { $lastfilename = $filename; } - printf(XXX "\n\n"); +# printf(XXX "\n\n"); +# printf("\n"); close(XXX); }