grpc create session can now specify id, updated all session proto to use SessionState for state, added suite for session testing for grpc

This commit is contained in:
bharnden 2019-03-22 13:45:53 -07:00
parent 3498a59ed5
commit 1f3e72e014
5 changed files with 130 additions and 11 deletions

View file

@ -44,8 +44,9 @@ class CoreGrpcClient(object):
self.stub = None
self.channel = None
def create_session(self):
return self.stub.CreateSession(core_pb2.CreateSessionRequest())
def create_session(self, _id=None):
request = core_pb2.CreateSessionRequest(id=_id)
return self.stub.CreateSession(request)
def delete_session(self, _id):
request = core_pb2.DeleteSessionRequest()

View file

@ -256,7 +256,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
def CreateSession(self, request, context):
logging.debug("create session: %s", request)
session = self.coreemu.create_session()
session = self.coreemu.create_session(request.id)
session.set_state(EventTypes.DEFINITION_STATE)
# default set session location