[PSM interop] Set hostname in initial metdata for Python server (#29289)

* [PSM interp] Set hostname in initial metdata for Python servers

* DO-NOT-MERGE: hijact psm-security-python for one test case

* Revert "DO-NOT-MERGE: hijact psm-security-python for one test case"

This reverts commit 17b8af9ab9.

* Metadata is a tuple of tuple not a tuple
pull/29299/head
Lidi Zheng 3 years ago committed by GitHub
parent b9ca51ef52
commit 7ea775f607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py

@ -59,10 +59,12 @@ class TestService(test_pb2_grpc.TestServiceServicer):
def EmptyCall(self, _: empty_pb2.Empty,
context: grpc.ServicerContext) -> empty_pb2.Empty:
context.send_initial_metadata((('hostname', self._hostname),))
return empty_pb2.Empty()
def UnaryCall(self, request: messages_pb2.SimpleRequest,
context: grpc.ServicerContext) -> messages_pb2.SimpleResponse:
context.send_initial_metadata((('hostname', self._hostname),))
response = messages_pb2.SimpleResponse()
response.server_id = self._server_id
response.hostname = self._hostname

Loading…
Cancel
Save