build/fuchsia/net_test_server.py
def SetupTestServer(target, test_concurrency, for_package, for_realms=[]):
  """Provisions a forwarding test server and configures |target| to use it.

  Returns a Popen object for the test server process."""

  logging.debug('Starting test server.')
  # The TestLauncher can launch more jobs than the limit specified with
  # --test-launcher-jobs so the max number of spawned test servers is set to
  # twice that limit here. See https://crbug.com/913156#c19.
  spawning_server = chrome_test_server_spawner.SpawningServer(
      0, SSHPortForwarder(target), test_concurrency * 2)
  forwarded_port = common.ConnectPortForwardingTask(
      target, spawning_server.server_port)
  spawning_server.Start()

  logging.debug('Test server listening for connections (port=%d)' %
                spawning_server.server_port)
  logging.debug('Forwarded port is %d' % forwarded_port)

  with tempfile.NamedTemporaryFile(mode='w+', encoding='utf-8') as tf:
    tf.write(
        json.dumps({'spawner_url_base':
                    'http://localhost:%d' % forwarded_port}))

    tf.flush()
    target.PutFile(tf.name,
                   '/tmp/net-test-server-config',
                   for_package=for_package,
                   for_realms=for_realms)

  return spawning_server
Provisions a forwarding test server and configures |target| to use it.

  Returns a Popen object for the test server process.
Provisions a forwarding test server and configures |target| to use it.
Returns a Popen object for the test server process.
Provisions a forwarding test server and configures |target| to use it . Returns a Popen object for the test server process .
def SetupTestServer(target, test_concurrency, for_package, for_realms=[]):
  logging.debug('Starting test server.')
  spawning_server = chrome_test_server_spawner.SpawningServer(
      0, SSHPortForwarder(target), test_concurrency * 2)
  forwarded_port = common.ConnectPortForwardingTask(
      target, spawning_server.server_port)
  spawning_server.Start()
  logging.debug('Test server listening for connections (port=%d)' %
                spawning_server.server_port)
  logging.debug('Forwarded port is %d' % forwarded_port)
  with tempfile.NamedTemporaryFile(mode='w+', encoding='utf-8') as tf:
    tf.write(
        json.dumps({'spawner_url_base':
                    'http://localhost:%d' % forwarded_port}))
    tf.flush()
    target.PutFile(tf.name,
                   '/tmp/net-test-server-config',
                   for_package=for_package,
                   for_realms=for_realms)
  return spawning_server
def SetupTestServer ( target , test_concurrency , for_package , for_realms = [ ] ) : logging . debug ( 'Starting test server.' ) spawning_server = chrome_test_server_spawner . SpawningServer ( 0 , SSHPortForwarder ( target ) , test_concurrency * 2 ) forwarded_port = common . ConnectPortForwardingTask ( target , spawning_server . server_port ) spawning_server . Start ( ) logging . debug ( 'Test server listening for connections (port=%d)' % spawning_server . server_port ) logging . debug ( 'Forwarded port is %d' % forwarded_port ) with tempfile . NamedTemporaryFile ( mode = 'w+' , encoding = 'utf-8' ) as tf : tf . write ( json . dumps ( { 'spawner_url_base' : 'http://localhost:%d' % forwarded_port } ) ) tf . flush ( ) target . PutFile ( tf . name , '/tmp/net-test-server-config' , for_package = for_package , for_realms = for_realms ) return spawning_server
Provisions a forwarding test server and configures |target| to use it.
Provisions a forwarding test server and configures |target| to use it .
"""Provisions a forwarding test server and configures |target| to use it.

  Returns a Popen object for the test server process.""" # The TestLauncher can launch more jobs than the limit specified with # --test-launcher-jobs so the max number of spawned test servers is set to # twice that limit here. See https://crbug.com/913156#c19.
target
test_concurrency
for_package
for_realms