From b4d005eb51fb6458a4f5f9f5603cf3d6a88aee39 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Mon, 25 May 2020 09:19:26 +0000 Subject: [PATCH] new(test): read grpc config fields Co-authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- test/falco_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/falco_test.py b/test/falco_test.py index 6f7d74f7..77abb57b 100644 --- a/test/falco_test.py +++ b/test/falco_test.py @@ -195,6 +195,19 @@ class FalcoTest(Test): os.makedirs(filedir) self.outputs = outputs + self.grpc_unix_socket_path = self.params.get('grpc_unix_socket_path', '*', default='/var/run/falco.sock') + self.grpc_address = self.params.get('address', 'grpc/*', default='/var/run/falco.sock') + if self.grpc_address.startswith("unix://"): + self.is_grpc_using_unix_socket = True + self.grpc_address = self.grpc_address[len("unix://"):] + self.grpc_proto = self.params.get('proto', 'grpc/*', default='') + self.grpc_service = self.params.get('service', 'grpc/*', default='') + self.grpc_method = self.params.get('method', 'grpc/*', default='') + self.grpc_results = self.params.get('results', 'grpc/*', default='') + # todo: if string wrap in an array + if self.grpc_results == '': + self.grpc_results = [] + self.disable_tags = self.params.get('disable_tags', '*', default='') if self.disable_tags == '':