[tools] testbot: The last GetTaskURL() parameter is in fact a log name.

Francois Gouget fgouget at codeweavers.com
Mon Apr 4 11:14:25 CDT 2022


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
The TestBot has had multiple logs for a long time now so it cannot be a 
simple boolean. Also it's not used right now but it will be (for the 
failure blacklisting) so it cannot just be removed.

Finally the log names are pretty clean so they could be used without 
escaping. However the policy is to escape all strings, in part to 
protect against future evolutions.
---
 testbot/lib/WineTestBot/Utils.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm
index d93a938d3..13529c323 100644
--- a/testbot/lib/WineTestBot/Utils.pm
+++ b/testbot/lib/WineTestBot/Utils.pm
@@ -34,6 +34,7 @@ our @EXPORT = qw(SecureConnection MakeSecureURL GetTaskURL GenerateRandomString
                  BatchQuote ShQuote ShArgv2Cmd);
 
 use Fcntl qw(O_CREAT O_EXCL O_WRONLY);
+use URI::Escape;
 
 use WineTestBot::Config;
 
@@ -84,11 +85,11 @@ sub MakeSecureURL($)
 
 sub GetTaskURL($$$;$$)
 {
-  my ($JobId, $StepNo, $TaskNo, $ShowScreenshot, $ShowLog) = @_;
+  my ($JobId, $StepNo, $TaskNo, $ShowScreenshot, $LogName) = @_;
   my $StepTask = 100 * $StepNo + $TaskNo;
   my $URL = "/JobDetails.pl?Key=$JobId";
   $URL .= "&s$StepTask=1" if ($ShowScreenshot);
-  $URL .= "&f$StepTask=$ShowLog" if ($ShowLog);
+  $URL .= "&f$StepTask=". uri_escape($LogName) if ($LogName);
   return "$URL#k$StepTask";
 }
 
-- 
2.30.2



More information about the wine-devel mailing list