Пример #1
0
            def init_tool_and_start_servers(dev):
                tool = self.GetTool(dev)
                tool.CopyFiles(dev)
                tool.SetupEnvironment()

                try:
                    # See https://crbug.com/1030827.
                    # This is a hack that may break in the future. We're relying on the
                    # fact that adb doesn't use ipv6 for it's server, and so doesn't
                    # listen on ipv6, but ssh remote forwarding does. 5037 is the port
                    # number adb uses for its server.
                    if "[::1]:5037" in subprocess.check_output(
                            "ss -o state listening 'sport = 5037'",
                            shell=True):
                        logging.error(
                            'Test Server cannot be started with a remote-forwarded adb '
                            'server. Continuing anyways, but some tests may fail.'
                        )
                        return
                except subprocess.CalledProcessError:
                    pass

                self._servers[str(dev)] = []
                if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER:
                    self._servers[str(dev)].append(
                        local_test_server_spawner.LocalTestServerSpawner(
                            ports.AllocateTestServerPort(), dev, tool))

                for s in self._servers[str(dev)]:
                    s.SetUp()
Пример #2
0
            def init_tool_and_start_servers():
                tool = self.GetTool(dev)
                tool.CopyFiles(dev)
                tool.SetupEnvironment()

                self._servers[str(dev)] = []
                if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER:
                    self._servers[str(dev)].append(
                        local_test_server_spawner.LocalTestServerSpawner(
                            ports.AllocateTestServerPort(), dev, tool))

                for s in self._servers[str(dev)]:
                    s.SetUp()
Пример #3
0
    def individual_device_set_up(dev, host_device_tuples):
      # Install test APK.
      self._delegate.Install(dev)

      # Push data dependencies.
      external_storage = dev.GetExternalStoragePath()
      host_device_tuples = [
          (h, d if d is not None else external_storage)
          for h, d in host_device_tuples]
      dev.PushChangedFiles(host_device_tuples)

      self._servers[str(dev)] = []
      if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER:
        self._servers[str(dev)].append(
            local_test_server_spawner.LocalTestServerSpawner(
                ports.AllocateTestServerPort(), dev, self.GetTool(dev)))

      for s in self._servers[str(dev)]:
        s.SetUp()
Пример #4
0
 def __init__(self, app_backend, pid, name):
     self._app_backend = app_backend
     self._pid = pid
     self._name = name
     self._local_port = ports.AllocateTestServerPort()
     self._devtools_client = None