diff --git a/app/tests/api/api_v1/test_projects.py b/app/tests/api/api_v1/test_projects.py index 82c4c98c..7961a136 100644 --- a/app/tests/api/api_v1/test_projects.py +++ b/app/tests/api/api_v1/test_projects.py @@ -157,7 +157,7 @@ def test_create_project_invalid_dut_config(client: TestClient) -> None: "detail": "The informed configuration has one or more invalid properties. " "Exception message: The field invalid_arg is not a valid dut_config " "configuration: ['discriminator', 'setup_code', 'pairing_mode', " - "'chip_timeout', 'chip_use_paa_certs', 'trace_log']" + "'chip_timeout', 'chip_use_paa_certs', 'trace_log', 'enhanced_setup_flow']" }, expected_keys=["detail"], ) @@ -261,7 +261,7 @@ def test_update_project_invalid_dut_config(client: TestClient, db: Session) -> N "detail": "The informed configuration has one or more invalid properties. " "Exception message: The field invalid_arg is not a valid dut_config " "configuration: ['discriminator', 'setup_code', 'pairing_mode', " - "'chip_timeout', 'chip_use_paa_certs', 'trace_log']" + "'chip_timeout', 'chip_use_paa_certs', 'trace_log', 'enhanced_setup_flow']" }, expected_keys=["detail"], ) diff --git a/test_collections/matter/sdk_tests/support/python_testing/models/utils.py b/test_collections/matter/sdk_tests/support/python_testing/models/utils.py index 73484663..ecdaa993 100644 --- a/test_collections/matter/sdk_tests/support/python_testing/models/utils.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2023-2024 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,7 +55,19 @@ async def generate_command_arguments( if dut_config.trace_log: arguments.append("--trace-to json:log") - if not omit_commissioning_method: + if dut_config.enhanced_setup_flow: + arguments.append("--require-tc-acknowledgements 1") + arguments.append( + f"--tc-acknowledgements {dut_config.enhanced_setup_flow.tc_user_response}" + ) + arguments.append( + f"--tc-acknowledgements-version {dut_config.enhanced_setup_flow.tc_version}" + ) + + if omit_commissioning_method: + arguments.append(f"--in-test-commissioning-method {pairing_mode}") + + else: arguments.append(f"--commissioning-method {pairing_mode}") if pairing_mode == DutPairingModeEnum.BLE_WIFI: diff --git a/test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py index ea62144e..e88f350b 100644 --- a/test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py @@ -333,6 +333,7 @@ async def test_generate_command_arguments_omit_comissioning_method() -> None: assert [ "--trace-to json:log", + "--in-test-commissioning-method on-network", "--discriminator 456", "--passcode 8765", ] == arguments diff --git a/test_collections/matter/test_environment_config.py b/test_collections/matter/test_environment_config.py index 5e34a410..76a01ba0 100644 --- a/test_collections/matter/test_environment_config.py +++ b/test_collections/matter/test_environment_config.py @@ -46,6 +46,11 @@ class NetworkConfig(BaseModel): thread: Union[ThreadAutoConfig, ThreadExternalConfig] +class EnhancedSetupFlowConfig(BaseModel): + tc_version: int + tc_user_response: int + + class DutConfig(BaseModel): discriminator: str setup_code: str @@ -53,6 +58,7 @@ class DutConfig(BaseModel): chip_timeout: Optional[str] chip_use_paa_certs: bool = False trace_log: bool = True + enhanced_setup_flow: Optional[EnhancedSetupFlowConfig] = None class TestEnvironmentConfigMatter(TestEnvironmentConfig): @@ -96,9 +102,11 @@ def validate_model(self, dict_model: dict) -> None: f" {valid_properties}" ) - # All DutConfig fields but chip_timeout are mandatory + # All DutConfig fields but chip_timeout and enhanced_setup_flow are + # mandatory mandatory_fields = valid_properties.copy() mandatory_fields.remove("chip_timeout") + mandatory_fields.remove("enhanced_setup_flow") for field in mandatory_fields: if field not in dut_config: raise TestEnvironmentConfigMatterError(