tools/fuchsia/comparative_tester/comparative_tester.py
def TransferDependencies(self, out_dir: str, host: str):
    """Transfer the dependencies of this target to the machine to execute the
    test.

    Args:
      out_dir (str): The output directory to find the dependencies in.
      host (str): The IP address of the host to receive the dependencies.
    """

    gn_desc = ["gn", "desc", out_dir, self._target, "runtime_deps"]
    out = RunCommand(
        gn_desc, "Failed to get dependencies of target {}".format(self._target))

    paths = []
    for line in out.split("\n"):
      if line == "":
        continue
      line = out_dir + "/" + line.strip()
      line = os.path.abspath(line)
      paths.append(line)
    common = os.path.commonpath(paths)
    paths = [os.path.relpath(path, common) for path in paths]

    archive_name = self._name + ".tar.gz"
    # Compress the dependencies of the test.
    command = ["tar", "-czf", archive_name] + paths
    if self._filter_file != "":
      command.append(self._filter_file)
    RunCommand(
        command,
        "{} dependency compression failed".format(self._target),
    )
    # Make sure the containing directory exists on the host, for easy cleanup.
    RunCommand(["ssh", host, "mkdir -p {}".format(self._name)],
               "Failed to create directory on host for {}".format(self._target))
    # Transfer the test deps to the host.
    RunCommand(
        [
            "scp", archive_name, "{}:{}/{}".format(host, self._name,
                                                   archive_name)
        ],
        "{} dependency transfer failed".format(self._target),
    )
    # Decompress the dependencies once they're on the host.
    RunCommand(
        [
            "ssh", host, "tar -xzf {0}/{1} -C {0}".format(
                self._name, archive_name)
        ],
        "{} dependency decompression failed".format(self._target),
    )
    # Clean up the local copy of the archive that is no longer needed.
    RunCommand(
        ["rm", archive_name],
        "{} dependency archive cleanup failed".format(self._target),
    )
Transfer the dependencies of this target to the machine to execute the
    test.

    Args:
      out_dir (str): The output directory to find the dependencies in.
      host (str): The IP address of the host to receive the dependencies.
    
Transfer the dependencies of this target to the machine to execute the
test.
Transfer the dependencies of this target to the machine to execute the test .
def TransferDependencies(self, out_dir: str, host: str):
    gn_desc = ["gn", "desc", out_dir, self._target, "runtime_deps"]
    out = RunCommand(
        gn_desc, "Failed to get dependencies of target {}".format(self._target))
    paths = []
    for line in out.split("\n"):
      if line == "":
        continue
      line = out_dir + "/" + line.strip()
      line = os.path.abspath(line)
      paths.append(line)
    common = os.path.commonpath(paths)
    paths = [os.path.relpath(path, common) for path in paths]
    archive_name = self._name + ".tar.gz"
    command = ["tar", "-czf", archive_name] + paths
    if self._filter_file != "":
      command.append(self._filter_file)
    RunCommand(
        command,
        "{} dependency compression failed".format(self._target),
    )
    RunCommand(["ssh", host, "mkdir -p {}".format(self._name)],
               "Failed to create directory on host for {}".format(self._target))
    RunCommand(
        [
            "scp", archive_name, "{}:{}/{}".format(host, self._name,
                                                   archive_name)
        ],
        "{} dependency transfer failed".format(self._target),
    )
    RunCommand(
        [
            "ssh", host, "tar -xzf {0}/{1} -C {0}".format(
                self._name, archive_name)
        ],
        "{} dependency decompression failed".format(self._target),
    )
    RunCommand(
        ["rm", archive_name],
        "{} dependency archive cleanup failed".format(self._target),
    )
def TransferDependencies ( self , out_dir : str , host : str ) : gn_desc = [ "gn" , "desc" , out_dir , self . _target , "runtime_deps" ] out = RunCommand ( gn_desc , "Failed to get dependencies of target {}" . format ( self . _target ) ) paths = [ ] for line in out . split ( "\n" ) : if line == "" : continue line = out_dir + "/" + line . strip ( ) line = os . path . abspath ( line ) paths . append ( line ) common = os . path . commonpath ( paths ) paths = [ os . path . relpath ( path , common ) for path in paths ] archive_name = self . _name + ".tar.gz" command = [ "tar" , "-czf" , archive_name ] + paths if self . _filter_file != "" : command . append ( self . _filter_file ) RunCommand ( command , "{} dependency compression failed" . format ( self . _target ) , ) RunCommand ( [ "ssh" , host , "mkdir -p {}" . format ( self . _name ) ] , "Failed to create directory on host for {}" . format ( self . _target ) ) RunCommand ( [ "scp" , archive_name , "{}:{}/{}" . format ( host , self . _name , archive_name ) ] , "{} dependency transfer failed" . format ( self . _target ) , ) RunCommand ( [ "ssh" , host , "tar -xzf {0}/{1} -C {0}" . format ( self . _name , archive_name ) ] , "{} dependency decompression failed" . format ( self . _target ) , ) RunCommand ( [ "rm" , archive_name ] , "{} dependency archive cleanup failed" . format ( self . _target ) , )
Transfer the dependencies of this target to the machine to execute the
test.
Transfer the dependencies of this target to the machine to execute the test .
"""Transfer the dependencies of this target to the machine to execute the
    test.

    Args:
      out_dir (str): The output directory to find the dependencies in.
      host (str): The IP address of the host to receive the dependencies.
    """ # Compress the dependencies of the test. # Make sure the containing directory exists on the host, for easy cleanup. # Transfer the test deps to the host. # Decompress the dependencies once they're on the host. # Clean up the local copy of the archive that is no longer needed.
self
out_dir
str
The output directory to find the dependencies in.
The output directory to find the dependencies in .
host
str
The IP address of the host to receive the dependencies.
The IP address of the host to receive the dependencies .