Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineRunTask.pl | 4 ++-- testbot/bin/WineRunWineTest.pl | 4 ++-- testbot/lib/WineTestBot/Utils.pm | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl index d987df7df..df9fcad0e 100755 --- a/testbot/bin/WineRunTask.pl +++ b/testbot/bin/WineRunTask.pl @@ -467,8 +467,8 @@ elsif ($Step->Type eq "suite") $Script .= "$FileName "; if (defined($WebHostName)) { - my $StepTask = 100 * $StepNo + $TaskNo; - $Script .= "-u "http://$WebHostName/JobDetails.pl?Key=$JobId&s$StepTask=1#k$StepTask%5C" "; + my $URL = GetTaskURL($JobId, $StepNo, $TaskNo, 1); + $Script .= "-u ". BatchQuote(MakeSecureURL($URL)) ." "; } my $Tag = $VM->Type ne "win64" ? "" : $Step->FileType eq "exe64" ? "64" : "32"; $Tag = BuildTag($VM->Name, $Tag); diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl index 514c57cda..79d7519de 100755 --- a/testbot/bin/WineRunWineTest.pl +++ b/testbot/bin/WineRunWineTest.pl @@ -443,8 +443,8 @@ if ($Step->Type eq "suite") $Script .= "--winetest ". ShQuote($Task->Missions) ." $BaseTag "; if (defined $WebHostName) { - my $StepTask = 100 * $StepNo + $TaskNo; - $Script .= "-u "http://$WebHostName/JobDetails.pl?Key=$JobId&s$StepTask=1#k$StepTask%5C" "; + my $URL = GetTaskURL($JobId, $StepNo, $TaskNo, 1); + $Script .= "-u ". ShQuote(MakeSecureURL($URL)) ." "; } my $Info = $VM->Description ? $VM->Description : ""; if ($VM->Details) diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm index 63e8f5328..e8ba5162d 100644 --- a/testbot/lib/WineTestBot/Utils.pm +++ b/testbot/lib/WineTestBot/Utils.pm @@ -27,7 +27,7 @@ WineTestBot::Utils - Utility functions =cut
use Exporter 'import'; -our @EXPORT = qw(SecureConnection MakeSecureURL GenerateRandomString +our @EXPORT = qw(SecureConnection MakeSecureURL GetTaskURL GenerateRandomString OpenNewFile CreateNewFile CreateNewLink CreateNewDir GetMTime DurationToString BuildEMailRecipient IsValidFileName BuildTag SanitizeTag LocaleName NotifyAdministrator @@ -55,6 +55,16 @@ sub MakeSecureURL($) return $Protocol . ($ENV{"HTTP_HOST"} || $WebHostName) . $URL; }
+sub GetTaskURL($$$;$$) +{ + my ($JobId, $StepNo, $TaskNo, $ShowScreenshot, $ShowLog) = @_; + my $StepTask = 100 * $StepNo + $TaskNo; + my $URL = "/JobDetails.pl?Key=$JobId"; + $URL .= "&s$StepTask=1" if ($ShowScreenshot); + $URL .= "&f$StepTask=$ShowLog" if ($ShowLog); + return "$URL#k$StepTask"; +} + sub DurationToString($;$) { my ($Secs, $Raw) = @_;