Require port and server_port interop flags

Also sort arguments to ArgumentParser.add_argument in idiomatic order.
pull/13406/head
Nathaniel Manista 7 years ago
parent 366e23b604
commit 254cb369a6
  1. 31
      src/python/grpcio_tests/tests/interop/client.py
  2. 7
      src/python/grpcio_tests/tests/interop/server.py

@ -29,37 +29,40 @@ def _args():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument( parser.add_argument(
'--server_host', '--server_host',
help='the host to which to connect', default="localhost",
type=str, type=str,
default="localhost") help='the host to which to connect')
parser.add_argument( parser.add_argument(
'--server_port', help='the port to which to connect', type=int) '--server_port',
type=int,
required=True,
help='the port to which to connect')
parser.add_argument( parser.add_argument(
'--test_case', '--test_case',
help='the test case to execute', default='large_unary',
type=str, type=str,
default="large_unary") help='the test case to execute')
parser.add_argument( parser.add_argument(
'--use_tls', '--use_tls',
help='require a secure connection',
default=False, default=False,
type=resources.parse_bool) type=resources.parse_bool,
help='require a secure connection')
parser.add_argument( parser.add_argument(
'--use_test_ca', '--use_test_ca',
help='replace platform root CAs with ca.pem',
default=False, default=False,
type=resources.parse_bool) type=resources.parse_bool,
help='replace platform root CAs with ca.pem')
parser.add_argument( parser.add_argument(
'--server_host_override', '--server_host_override',
default="foo.test.google.fr", default="foo.test.google.fr",
help='the server host to which to claim to connect', type=str,
type=str) help='the server host to which to claim to connect')
parser.add_argument( parser.add_argument(
'--oauth_scope', help='scope for OAuth tokens', type=str) '--oauth_scope', type=str, help='scope for OAuth tokens')
parser.add_argument( parser.add_argument(
'--default_service_account', '--default_service_account',
help='email address of the default service account', type=str,
type=str) help='email address of the default service account')
return parser.parse_args() return parser.parse_args()

@ -29,12 +29,13 @@ _ONE_DAY_IN_SECONDS = 60 * 60 * 24
def serve(): def serve():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--port', help='the port on which to serve', type=int) parser.add_argument(
'--port', type=int, required=True, help='the port on which to serve')
parser.add_argument( parser.add_argument(
'--use_tls', '--use_tls',
help='require a secure connection',
default=False, default=False,
type=resources.parse_bool) type=resources.parse_bool,
help='require a secure connection')
args = parser.parse_args() args = parser.parse_args()
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))

Loading…
Cancel
Save