diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml index 91cdcbffe7d255..dd0b1fd242d4af 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml @@ -72,7 +72,7 @@ tests: - label: "Step 2b: TH sends StepHue command to DUT with StepMode=0x01 (up), - StepSize=60 and TransitionTime=200 (20s)" + StepSize=80 and TransitionTime=200 (20s)" PICS: CC.S.F00 && CC.S.C02.Rsp command: "StepHue" arguments: @@ -80,7 +80,7 @@ tests: - name: "StepMode" value: 1 - name: "StepSize" - value: 60 + value: 80 - name: "TransitionTime" value: 200 - name: "OptionsMask" @@ -88,56 +88,43 @@ tests: - name: "OptionsOverride" value: 0 - - label: "Wait 10s" + - label: "Wait 5s" PICS: CC.S.F00 cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 10000 + value: 5000 - - label: "Step 2c: TH reads CurrentHue attribute from DUT" + - label: "Step 2c: TH reads CurrentHue attribute from DUT" # Expects 220 (200 + 80*(5/20)) with a tolerance of +/- 3 (15% of 20), so the expected value is in the range [217, 223] PICS: CC.S.F00 && CC.S.A0000 command: "readAttribute" attribute: "CurrentHue" response: constraints: - minValue: 195 - maxValue: 254 + minValue: 217 + maxValue: 223 - - label: "Wait 10s" + - label: "Wait 15s" PICS: CC.S.F00 cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 10000 + value: 15000 - #Tolerance to be computed from the range - #Start value 230, expected value 5, 230 - 5 = 225, 225 % 15 = 34 , So 5+/-34 We need two range here as 254 is the max value - #Range will be: 230...254...0...39 - #Multiple range not supported in YAML: https://github.com/project-chip/connectedhomeip/issues/23197 + # Start value 200, expected value 25 (200 + 80*(20/20) = 280 mod 255) with a tolerance of +/- 12 (15% of 80), so the expected value is in the range [13, 37] + # Multiple range not supported in YAML: https://github.com/project-chip/connectedhomeip/issues/23197 - label: "Step 2d: TH reads CurrentHue attribute from DUT" - PICS: CC.S.F00 && CC.S.A0000 && PICS_SKIP_SAMPLE_APP - verification: | - ./chip-tool colorcontrol read current-hue 1 1 - - After another 10 seconds , Verify that CurrentHue value is 5 On TH(chip-tool) Logs and below is the sample log provided for the raspi platform - - [1649662328.012887][8447:8452] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0000 DataVersion: 4087279986 - [1649662328.012957][8447:8452] CHIP:TOO: Current hue: 5 - [1649662328.013055][8447:8452] CHIP:EM: Sending Standalone Ack for MessageCounter:8634142 on exchange 13871i - (Value can vary) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: CC.S.F00 && CC.S.A0000 + command: "readAttribute" + attribute: "CurrentHue" + response: + constraints: + minValue: 13 + maxValue: 37 - label: "Wait 5s" PICS: CC.S.F00 @@ -148,25 +135,15 @@ tests: - name: "ms" value: 5000 - #Multiple range not supported in YAML: https://github.com/project-chip/connectedhomeip/issues/23197 + # Multiple range not supported in YAML: https://github.com/project-chip/connectedhomeip/issues/23197 - label: "Step 2e: TH reads CurrentHue attribute from DUT" - PICS: CC.S.F00 && CC.S.A0000 && PICS_SKIP_SAMPLE_APP - verification: | - ./chip-tool colorcontrol read current-hue 1 1 - - After another 5 seconds , Verify that CurrentHue value is 5 On TH(chip-tool) Logs and below is the sample log provided for the raspi platform - - [1649662328.012887][8447:8452] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0300 Attribute 0x0000_0000 DataVersion: 4087279986 - [1649662328.012957][8447:8452] CHIP:TOO: Current hue: 5 - [1649662328.013055][8447:8452] CHIP:EM: Sending Standalone Ack for MessageCounter:8634142 on exchange 13871i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: CC.S.F00 && CC.S.A0000 + command: "readAttribute" + attribute: "CurrentHue" + response: + constraints: + minValue: 13 + maxValue: 37 - label: "Step 3a: TH sends MoveToHue command to DUT with Hue=50, @@ -197,7 +174,7 @@ tests: - label: "Step 3b: TH sends StepHue command to DUT with StepMode=0x03 (down), - StepSize=60 and TransitionTime=200 (20s)" + StepSize=100 and TransitionTime=200 (20s)" PICS: CC.S.F00 && CC.S.C02.Rsp command: "StepHue" arguments: @@ -205,7 +182,7 @@ tests: - name: "StepMode" value: 3 - name: "StepSize" - value: 60 + value: 100 - name: "TransitionTime" value: 200 - name: "OptionsMask" @@ -213,41 +190,41 @@ tests: - name: "OptionsOverride" value: 0 - - label: "Wait 10s" + - label: "Wait 5s" PICS: CC.S.F00 cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 10000 + value: 5000 - - label: "Step 3c: TH reads CurrentHue attribute from DUT" + - label: "Step 3c: TH reads CurrentHue attribute from DUT" # Expects 25 (50 - 100*(5/20)) with a tolerance of +/- 4 (15% of 25), so the expected value is in the range [21, 29] PICS: CC.S.F00 && CC.S.A0000 command: "readAttribute" attribute: "CurrentHue" response: constraints: - minValue: 17 - maxValue: 23 + minValue: 21 + maxValue: 29 - - label: "Wait 10s" + - label: "Wait 15s" PICS: CC.S.F00 cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 10000 + value: 15000 - - label: "Step 3d: TH reads CurrentHue attribute from DUT" + - label: "Step 3d: TH reads CurrentHue attribute from DUT" # Expects 205 (50 - 100*(20/20) = -50 mod 255) with a tolerance of +/- 15 (15% of 100), so the expected value is in the range [190, 220] PICS: CC.S.F00 && CC.S.A0000 command: "readAttribute" attribute: "CurrentHue" response: constraints: - minValue: 208 - maxValue: 255 + minValue: 190 + maxValue: 220 - label: "Wait 5s" PICS: CC.S.F00 @@ -264,8 +241,8 @@ tests: attribute: "CurrentHue" response: constraints: - minValue: 208 - maxValue: 255 + minValue: 190 + maxValue: 220 - label: "Step 4a: TH reads ColorMode attribute from DUT" PICS: CC.S.F00 && CC.S.A0008 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 1f4f1f66e906c3..481da7d2307875 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -204,7 +204,7 @@ CC.S.C41.Rsp=1 CC.S.C42.Rsp=1 CC.S.C43.Rsp=1 CC.S.C44.Rsp=1 -CC.S.F00=0 +CC.S.F00=1 CC.S.F01=1 CC.S.F02=1 CC.S.F03=1 diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index 1054463ea64489..3a6fad142c2bc6 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -676,6 +676,9 @@ class MatterTestConfig: tc_version_to_simulate: int = None tc_user_response_to_simulate: int = None + # If this is set tests will allow sending test event triggers with endpoint 0 for older devices + legacy: bool = None + class ClusterMapper: """Describe clusters/attributes using schema names.""" @@ -1289,7 +1292,7 @@ async def send_single_cmd( return result async def send_test_event_triggers(self, eventTrigger: int, enableKey: bytes = None): - """This helper function sends a test event trigger to the General Diagnostics cluster on endpoint 0 + """This helper function sends a test event trigger to the General Diagnostics cluster, If --use-legacy-test-event-trigers flag is present the endpoint will 0 The enableKey can be passed into the function, or omitted which will then use the one provided to the script via --hex-arg enableKey: @@ -1304,13 +1307,37 @@ async def send_test_event_triggers(self, eventTrigger: int, enableKey: bytes = N else: enableKey = self.matter_test_config.global_test_params['enableKey'] + # What about --endpoing != 0 and legacy = True? Right now target endpoint is set to 0 + + target_endpoint = 0 + if not self.matter_test_config.legacy and self.matter_test_config.endpoint is not None: + target_endpoint = self.matter_test_config.endpoint + + print("") + print("Target endpoint: ", target_endpoint) + print("") + + print("") + print("Event trigger: ", hex(eventTrigger)) + print("") + + eventTrigger = eventTrigger | (target_endpoint << 32) + + print("") + print("Event trigger: ", hex(eventTrigger)) + print("") + try: # GeneralDiagnostics cluster is meant to be on Endpoint 0 (Root) - await self.send_single_cmd(endpoint=0, - cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( - enableKey, - eventTrigger) - ) + general_diagnosis_result = await self.send_single_cmd(endpoint=0, + cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger( + enableKey, + eventTrigger) + ) + + print("") + logger.info(general_diagnosis_result) + print("") except InteractionModelError as e: asserts.fail( @@ -1943,6 +1970,7 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig: config.endpoint = args.endpoint # This can be None, the get_endpoint function allows the tests to supply a default config.app_pid = 0 if args.app_pid is None else args.app_pid config.fail_on_skipped_tests = args.fail_on_skipped + config.legacy = True if args.use_legacy_test_event_triggers else args.use_legacy_test_event_triggers config.controller_node_id = args.controller_node_id config.trace_to = args.trace_to @@ -1998,6 +2026,8 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig basic_group.add_argument('--app-pid', type=int, default=0, help="The PID of the app against which the test is going to run") basic_group.add_argument('--timeout', type=int, help="Test timeout in seconds") basic_group.add_argument("--PICS", help="PICS file path", type=str) + basic_group.add_argument("--use-legacy-test-event-triggers", action="store_true", default=False, + help="Send test event triggers with endpoint 0 for older devices") commission_group = parser.add_argument_group(title="Commissioning", description="Arguments to commission a node")