Title: [285875] trunk/Tools
Revision
285875
Author
[email protected]
Date
2021-11-16 11:31:42 -0800 (Tue, 16 Nov 2021)

Log Message

Make run-_javascript_-core-test and run-jsc-stress-tests support a customized identity file
https://bugs.webkit.org/show_bug.cgi?id=232453

Reviewed by Ryan Haddad.

* Scripts/run-_javascript_core-tests: Add idFilePath field for remote config.
* Scripts/run-jsc-stress-tests: Add idFilePath field for remote config.
* Scripts/webkitdirs.pm:
(determineNativeArchitecture): Provide -i option to ssh

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (285874 => 285875)


--- trunk/Tools/ChangeLog	2021-11-16 19:26:36 UTC (rev 285874)
+++ trunk/Tools/ChangeLog	2021-11-16 19:31:42 UTC (rev 285875)
@@ -1,3 +1,15 @@
+2021-11-16  Zhifei Fang  <[email protected]>
+
+        Make run-_javascript_-core-test and run-jsc-stress-tests support a customized identity file
+        https://bugs.webkit.org/show_bug.cgi?id=232453
+
+        Reviewed by Ryan Haddad.
+
+        * Scripts/run-_javascript_core-tests: Add idFilePath field for remote config.
+        * Scripts/run-jsc-stress-tests: Add idFilePath field for remote config.
+        * Scripts/webkitdirs.pm:
+        (determineNativeArchitecture): Provide -i option to ssh
+
 2021-11-16  Chris Dumez  <[email protected]>
 
         [iOS] Do not require the web browser entitlement to opt into captive portal mode

Modified: trunk/Tools/Scripts/run-_javascript_core-tests (285874 => 285875)


--- trunk/Tools/Scripts/run-_javascript_core-tests	2021-11-16 19:26:36 UTC (rev 285874)
+++ trunk/Tools/Scripts/run-_javascript_core-tests	2021-11-16 19:31:42 UTC (rev 285875)
@@ -524,12 +524,14 @@
         $remotes = $remoteConfig->{"remotes"};
     } elsif (defined $remoteConfig->{"remote"}) {
         my @split = split(':', $remoteConfig->{"remote"});
-        $remotes = [
-            {
-                "name" => "synthesized",
-                "address" => $remoteConfig->{"remote"}
-            }
-         ];
+        my $remote = {
+            "name" => "synthesized",
+            "address" => $remoteConfig->{"remote"}
+        };
+        if (exists $remoteConfig->{"idFilePath"}) {
+            $remote->{'idFilePath'} = $remoteConfig->{'idFilePath'};
+        }
+        $remotes = [$remote];
     }
 }
 

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (285874 => 285875)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2021-11-16 19:26:36 UTC (rev 285874)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2021-11-16 19:31:42 UTC (rev 285875)
@@ -51,7 +51,7 @@
     puts(Thread.current.backtrace)
 }
 
-RemoteHost = Struct.new(:name, :user, :host, :port, :remoteDirectory)
+RemoteHost = Struct.new(:name, :user, :host, :port, :remoteDirectory, :identity_file_path)
 
 THIS_SCRIPT_PATH = Pathname.new(__FILE__).realpath
 SCRIPTS_PATH = THIS_SCRIPT_PATH.dirname
@@ -325,6 +325,9 @@
         if config['remoteDirectory']
             $remoteHosts[0].remoteDirectory = config['remoteDirectory']
         end
+        if config['idFilePath']
+            $remoteHosts[0].identity_file_path = config['idFilePath']
+        end
     end
 
     # we can combine --remote and a new style config
@@ -340,6 +343,10 @@
             if remote['remoteDirectory']
                 host.remoteDirectory = remote['remoteDirectory']
             end
+            if remote['idFilePath']
+                host.identity_file_path = remote['idFilePath']
+                print('Using identity file: ' + host.identity_file_path + "\r")
+            end
             host
         }
     end
@@ -2118,7 +2125,7 @@
     raise unless $remote
 
     result = ""
-    IO.popen("ssh -o NoHostAuthenticationForLocalhost=yes -p #{remoteHost.port} #{remoteHost.user}@#{remoteHost.host} '#{cmd}'", "r") {
+    IO.popen("ssh -o NoHostAuthenticationForLocalhost=yes -p #{remoteHost.port}" + (remoteHost.identity_file_path ? " -i #{remoteHost.identity_file_path}" : "") + " #{remoteHost.user}@#{remoteHost.host} '#{cmd}'", "r") {
       | inp |
       inp.each_line {
         | line |
@@ -2256,8 +2263,8 @@
 end
 
 def copyBundleToRemote(remoteHost)
-    mysys(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes", "-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", "mkdir -p #{remoteHost.remoteDirectory}"])
-    mysys(["scp", "-o", "NoHostAuthenticationForLocalhost=yes", "-P", remoteHost.port.to_s, ($outputDir.dirname + $tarFileName).to_s, "#{remoteHost.user}@#{remoteHost.host}:#{remoteHost.remoteDirectory}"])
+    mysys(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes"] + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", "mkdir -p #{remoteHost.remoteDirectory}"])
+    mysys(["scp", "-o", "NoHostAuthenticationForLocalhost=yes"] + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-P", remoteHost.port.to_s, ($outputDir.dirname + $tarFileName).to_s, "#{remoteHost.user}@#{remoteHost.host}:#{remoteHost.remoteDirectory}"])
 end
 
 def exportBaseEnvironmentVariables(escape)
@@ -2291,7 +2298,7 @@
         remoteScript += exportBaseEnvironmentVariables(true)
         $envVars.each { |var| remoteScript += "export " << var << "\n" }
         remoteScript += "#{testRunnerCommand(remoteIndex)}\""
-        runAndMonitorTestRunnerCommand(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes", "-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", remoteScript])
+        runAndMonitorTestRunnerCommand(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes"] + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", remoteScript])
     else
         Dir.chdir($runnerDir) {
             runAndMonitorTestRunnerCommand(Shellwords.shellsplit(testRunnerCommand))
@@ -2666,8 +2673,9 @@
 def unpackBundleGnuParallel(remoteHosts)
     forEachRemote(remoteHosts, :dropOnFailure => true) {
         | _, remoteHost |
-        mysys(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes",
-               "-p", remoteHost.port.to_s,
+        mysys(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes"] + 
+               (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + 
+               ["-p", remoteHost.port.to_s,
                "#{remoteHost.user}@#{remoteHost.host}",
                "cd #{Shellwords.shellescape(remoteHost.remoteDirectory)} && rm -rf #{$outputDir.basename} && tar xzf #{$tarFileName}"])
     }

Modified: trunk/Tools/Scripts/webkitdirs.pm (285874 => 285875)


--- trunk/Tools/Scripts/webkitdirs.pm	2021-11-16 19:26:36 UTC (rev 285874)
+++ trunk/Tools/Scripts/webkitdirs.pm	2021-11-16 19:31:42 UTC (rev 285875)
@@ -373,7 +373,8 @@
             my $target = $split[0];
             my $port = 22;
             $port = $split[1] if scalar(@split) > 1;
-            $output = `ssh -o NoHostAuthenticationForLocalhost=yes -p $port $target 'uname  -m'`;
+            my $cmd = 'ssh -o NoHostAuthenticationForLocalhost=yes '. (exists $remote->{'idFilePath'} ? ('-i '.$remote->{'idFilePath'}) : '') ." -p $port $target 'uname  -m'";
+            $output = readpipe($cmd);
             last if ($? == 0);
         }
         if (length($output) == 0) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to