From c16c4197b7203ede403166c91ea4bf4d4e8797bb Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 24 Aug 2023 17:04:33 +0200 Subject: [PATCH] [CI] Add keepSubscriptions supports to matter_yamltests (#28780) --- .../matter_chip_tool_adapter/encoder.py | 2 ++ scripts/py_matter_yamltests/matter_yamltests/parser.py | 5 +++++ scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py | 1 + 3 files changed, 8 insertions(+) diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index e57bfe29b6af76..7a3735e213e049 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -284,6 +284,8 @@ def __get_arguments(self, request): arguments, request.min_interval, "min-interval") arguments = self.__maybe_add( arguments, request.max_interval, "max-interval") + arguments = self.__maybe_add( + arguments, request.keep_subscriptions, "keepSubscriptions") arguments = self.__maybe_add(arguments, request.timed_interaction_timeout_ms, "timedInteractionTimeoutMs") arguments = self.__maybe_add( diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index 07090679fd9dbb..ef597d22f2e72f 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -199,6 +199,7 @@ def __init__(self, test: dict, config: dict, definitions: SpecDefinitions, pics_ self.fabric_filtered = _value_or_none(test, 'fabricFiltered') self.min_interval = _value_or_none(test, 'minInterval') self.max_interval = _value_or_none(test, 'maxInterval') + self.keep_subscriptions = _value_or_none(test, 'keepSubscriptions') self.timed_interaction_timeout_ms = _value_or_none( test, 'timedInteractionTimeoutMs') self.timeout = _value_or_none(test, 'timeout') @@ -659,6 +660,10 @@ def min_interval(self): def max_interval(self): return self._test.max_interval + @property + def keep_subscriptions(self): + return self._test.keep_subscriptions + @property def timed_interaction_timeout_ms(self): return self._test.timed_interaction_timeout_ms diff --git a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py index ecdc7af209acbe..efc6adcea2b41a 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py +++ b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py @@ -106,6 +106,7 @@ def __check_test_step(self, config: dict, content): 'saveResponseAs': str, 'minInterval': int, 'maxInterval': int, + 'keepSubscriptions': bool, 'timeout': int, 'timedInteractionTimeoutMs': int, 'dataVersion': (list, int, str), # Can be a variable