Beispiel #1
0
def start() -> None:
  """Starts all servers."""
  global _ts
  _ts = _TestingServers()

  for lang in LANGUAGES:
    response = _ts.metadata_stub(lang).GetServerInfo(
        testing_api_pb2.ServerInfoRequest())
    if lang != response.language:
      raise ValueError(
          'lang = %s != response.language = %s' % (lang, response.language))
    logging.info('server_info:\n%s', response)
Beispiel #2
0
def start(output_files_prefix: Text) -> None:
    """Starts all servers."""
    global _ts
    _ts = _TestingServers(output_files_prefix)

    versions = {}
    for lang in LANGUAGES:
        response = _ts.metadata_stub(lang).GetServerInfo(
            testing_api_pb2.ServerInfoRequest())
        if lang != response.language:
            raise ValueError('lang = %s != response.language = %s' %
                             (lang, response.language))
        if response.tink_version:
            versions[lang] = response.tink_version
        else:
            logging.warning('server in lang %s has no tink version.', lang)
    unique_versions = list(set(versions.values()))
    if not unique_versions:
        raise ValueError('tink version unknown')
    if len(unique_versions) > 1:
        raise ValueError(
            'tink_version in testing servers are inconsistent: %s' % versions)
    logging.info('Tink version: %s', unique_versions[0])
Beispiel #3
0
 def test_server_info(self):
     metadata_servicer = services.MetadataServicer()
     request = testing_api_pb2.ServerInfoRequest()
     response = metadata_servicer.GetServerInfo(request, self._ctx)
     self.assertEqual(response.language, 'python')