The reason will appear in the Activity page, thus providing easily understandable diagnostic data.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineRunBuild.pl | 9 +++++---- testbot/bin/WineRunReconfig.pl | 9 +++++---- testbot/bin/WineRunTask.pl | 9 +++++---- testbot/bin/WineRunWineTest.pl | 9 +++++---- 4 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl index c4c136595..89582a103 100755 --- a/testbot/bin/WineRunBuild.pl +++ b/testbot/bin/WineRunBuild.pl @@ -192,11 +192,12 @@ sub LogTaskError($) umask($OldUMask); }
-sub WrapUpAndExit($;$$) +sub WrapUpAndExit($;$$$) { - my ($Status, $Retry, $TimedOut) = @_; + my ($Status, $Retry, $TimedOut, $Reason) = @_; my $NewVMStatus = $Status eq 'queued' ? 'offline' : 'dirty'; - my $VMResult = $Status eq "boterror" ? "boterror" : + my $VMResult = defined $Reason ? $Reason : + $Status eq "boterror" ? "boterror" : $Status eq "queued" ? "error" : $TimedOut ? "timeout" : "";
@@ -346,7 +347,7 @@ if (!$VM->GetDomain()->IsPoweredOn()) "The VM is not powered on despite its status being 'running'.\n". "The VM has been put offline and the TestBot will try to regain\n". "access to it."); - WrapUpAndExit('queued'); + WrapUpAndExit('queued', undef, undef, 'boterror vm off'); }
if ($Step->Type ne "build") diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index 91654ea94..5c7b46bb9 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -194,12 +194,13 @@ sub LogTaskError($) umask($OldUMask); }
-sub WrapUpAndExit($;$$) +sub WrapUpAndExit($;$$$) { - my ($Status, $Retry, $TimedOut) = @_; + my ($Status, $Retry, $TimedOut, $Reason) = @_; my $NewVMStatus = $Status eq 'queued' ? 'offline' : $Status eq 'completed' ? 'idle' : 'dirty'; - my $VMResult = $Status eq "boterror" ? "boterror" : + my $VMResult = defined $Reason ? $Reason : + $Status eq "boterror" ? "boterror" : $Status eq "queued" ? "error" : $TimedOut ? "timeout" : "";
@@ -352,7 +353,7 @@ if (!$Domain->IsPoweredOn()) MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n". "So the VM has been put offline and the TestBot will try to regain\n". "access to it."); - WrapUpAndExit('queued'); + WrapUpAndExit('queued', undef, undef, 'boterror vm off'); }
if ($Step->Type ne "reconfig") diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl index 1ffd87537..81a2996bb 100755 --- a/testbot/bin/WineRunTask.pl +++ b/testbot/bin/WineRunTask.pl @@ -224,11 +224,12 @@ sub LogTaskError($) umask($OldUMask); }
-sub WrapUpAndExit($;$$$) +sub WrapUpAndExit($;$$$$) { - my ($Status, $TestFailures, $Retry, $TimedOut) = @_; + my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_; my $NewVMStatus = $Status eq 'queued' ? 'offline' : 'dirty'; - my $VMResult = $Status eq "boterror" ? "boterror" : + my $VMResult = $Reason ? $Reason : + $Status eq "boterror" ? "boterror" : $Status eq "queued" ? "error" : $TimedOut ? "timeout" : "";
@@ -407,7 +408,7 @@ if (!$Domain->IsPoweredOn()) MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n". "So the VM has been put offline and the TestBot will try to regain\n". "access to it."); - WrapUpAndExit('queued'); + WrapUpAndExit('queued', undef, undef, undef, 'boterror vm off'); }
if ($Step->Type ne "single" and $Step->Type ne "suite") diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl index c6770aa9d..beb050276 100755 --- a/testbot/bin/WineRunWineTest.pl +++ b/testbot/bin/WineRunWineTest.pl @@ -220,11 +220,12 @@ sub LogTaskError($)
my $TaskMissions;
-sub WrapUpAndExit($;$$$) +sub WrapUpAndExit($;$$$$) { - my ($Status, $TestFailures, $Retry, $TimedOut) = @_; + my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_; my $NewVMStatus = $Status eq 'queued' ? 'offline' : 'dirty'; - my $VMResult = $Status eq "boterror" ? "boterror" : + my $VMResult = defined $Reason ? $Reason : + $Status eq "boterror" ? "boterror" : $Status eq "queued" ? "error" : $TimedOut ? "timeout" : "";
@@ -407,7 +408,7 @@ if (!$Domain->IsPoweredOn()) MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n\n". "So the VM has been put offline and the TestBot will try to regain\n". "access to it."); - WrapUpAndExit('queued'); + WrapUpAndExit('queued', undef, undef, 'boterror vm off'); }
if ($Step->Type ne "suite" and $Step->Type ne "single")