1# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2import grpc 3 4import common_pb2 as common__pb2 5 6 7class CommonStub(object): 8 """Common lab services implemented on top of the wiring APIs. 9 10 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL 11 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 12 "OPTIONAL" in this document are to be interpreted as described in 13 RFC 2119. 14 15 All clients SHOULD pass the gRPC metadata key request_trace_id with one 16 value. The value is a unique string that is associated with the method call 17 in metrics. Clients that do not pass request_trace_id MAY be rejected so that 18 they can be fixed. 19 """ 20 21 def __init__(self, channel): 22 """Constructor. 23 24 Args: 25 channel: A grpc.Channel. 26 """ 27 self.ExecDutCommand = channel.unary_stream( 28 '/chromiumos.config.api.test.tls.Common/ExecDutCommand', 29 request_serializer=common__pb2.ExecDutCommandRequest.SerializeToString, 30 response_deserializer=common__pb2.ExecDutCommandResponse.FromString, 31 ) 32 33 34class CommonServicer(object): 35 """Common lab services implemented on top of the wiring APIs. 36 37 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL 38 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 39 "OPTIONAL" in this document are to be interpreted as described in 40 RFC 2119. 41 42 All clients SHOULD pass the gRPC metadata key request_trace_id with one 43 value. The value is a unique string that is associated with the method call 44 in metrics. Clients that do not pass request_trace_id MAY be rejected so that 45 they can be fixed. 46 """ 47 48 def ExecDutCommand(self, request, context): 49 """ExecDutCommand runs a command on a DUT. 50 51 The working directory is /. 52 A tty is not spawned for the command. 53 The user and group is root. 54 All signals have their default dispositions and are not masked. 55 The umask is set to 0. 56 57 The environment contains: 58 59 TERM=dumb 60 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin 61 LANG=en_US.UTF-8 62 USER=root 63 HOME=/root 64 65 The environment MAY also contain SSH client variables. 66 The environment SHALL NOT contain variables not mentioned above. 67 68 If the stream is interrupted, the implementation MAY attempt to 69 stop the command by sending SIGINT, SIGHUP, SIGTERM, or SIGKILL. 70 """ 71 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 72 context.set_details('Method not implemented!') 73 raise NotImplementedError('Method not implemented!') 74 75 76def add_CommonServicer_to_server(servicer, server): 77 rpc_method_handlers = { 78 'ExecDutCommand': grpc.unary_stream_rpc_method_handler( 79 servicer.ExecDutCommand, 80 request_deserializer=common__pb2.ExecDutCommandRequest.FromString, 81 response_serializer=common__pb2.ExecDutCommandResponse.SerializeToString, 82 ), 83 } 84 generic_handler = grpc.method_handlers_generic_handler( 85 'chromiumos.config.api.test.tls.Common', rpc_method_handlers) 86 server.add_generic_rpc_handlers((generic_handler,)) 87