Skip to content

Add nfc-onnetwork pairing mode#296

Draft
OlivierGre wants to merge 2 commits intoproject-chip:v2.15-developfrom
OlivierGre:add_nfc_on_network
Draft

Add nfc-onnetwork pairing mode#296
OlivierGre wants to merge 2 commits intoproject-chip:v2.15-developfrom
OlivierGre:add_nfc_on_network

Conversation

@OlivierGre
Copy link
Contributor

@OlivierGre OlivierGre commented Feb 19, 2026

Add nfc-onnetwork pairing mode. It will allow to test Ethernet devices supporting NFC commissioning

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @OlivierGre, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the test harness's capabilities by integrating new pairing modes, particularly NFC-onnetwork, and enhancing the flexibility of test execution through a new CLI endpoint. It streamlines project management with import/export functionalities and introduces dynamic test exclusion via DMP files. A major refactoring of Python test collection handling improves performance and maintainability, while new logging features enhance visibility into container operations and test execution progress.

Highlights

  • NFC-onnetwork Pairing Mode: Added support for NFC-onnetwork pairing, expanding the available commissioning methods for DUTs.
  • CLI Test Execution Enhancements: Introduced a new '/cli' endpoint for creating test run executions, allowing for dynamic project creation/updates, and temporary per-execution configuration overrides directly from the command line.
  • Project Import/Export Functionality: Added API endpoints to export and import complete project configurations, facilitating easier project management and sharing of test setups.
  • DMP Test Skip Integration: Implemented functionality to upload and process 'dmp-test-skip.xml' files, enabling dynamic exclusion of tests based on project configuration and platform certification requirements.
  • Python Test Collection Refactoring: Overhauled the discovery and parsing of Python test collections, moving to a pre-generation of test information into JSON files and asynchronous initialization during application startup for improved performance and modularity.
  • Docker Command Logging & File Operations: Added logging of equivalent shell commands for Docker API operations (run, kill, rm, cp) to enhance debuggability, and introduced utilities for copying files to and from Docker containers.
  • Real-time Python Test Logging: Introduced a configuration option ('ENABLE_REALTIME_PYTHON_TEST_LOGS') to enable incremental, step-by-step logging for Python tests, providing more immediate feedback during execution.
  • WebSocket & WebRTC Enhancements: Expanded WebSocket capabilities with new endpoints for video streaming and WebRTC signaling, supporting advanced interactive testing scenarios.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added entries for generated files such as 'admin_storage.json', 'output_logs/', and Python test info JSON files.
  • .version_information
    • Updated the version information to 'v2.15-beta2.1+spring2026'.
  • Dockerfile
    • Upgraded the Node.js setup from version 18.x to 20.x.
  • alembic/versions/e6153267b741_add_execution_config_to_test_run_execution.py
    • Added a new Alembic migration script to introduce an 'execution_config' JSON column to the 'testrunexecution' table.
  • app/api/api_v1/endpoints/projects.py
    • Refactored the 'upload_pics' endpoint to handle both PICS and 'dmp-test-skip.xml' files.
    • Added new API endpoints for exporting and importing project configurations.
    • Generalized the internal function for updating mutable JSON fields in project configurations.
  • app/api/api_v1/endpoints/test_run_executions.py
    • Introduced a new '/cli' endpoint for creating test run executions with advanced configuration options.
    • Added an endpoint to rename existing test run executions.
    • Implemented a new endpoint to retrieve ChipServer node ID and generate manual pairing codes.
    • Enhanced the 'read_test_run_executions' endpoint with 'sort_order' and 'limit=0' functionality.
  • app/api/api_v1/sockets/web_sockets.py
    • Introduced new WebSocket endpoints for video streaming and WebRTC signaling (controller and peer).
    • Modified existing WebSocket connection handling to use a more structured 'WebSocketConnection' object.
  • app/constants/shared_constants.py
    • Added a new file defining shared enums for test states, message types, message keys, and DUT pairing modes, including new NFC and Thread modes.
  • app/constants/websockets_constants.py
    • Refactored by moving common enums to 'shared_constants.py' and adding WebSocket type definitions and UDP socket constants.
  • app/container_manager/container_manager.py
    • Added logging of equivalent shell commands for Docker API operations (run, kill, rm) when container logging is enabled.
    • Implemented new methods for copying files to and from Docker containers.
  • app/container_manager/docker_shell_commands.py
    • Added a new file providing utility functions to generate shell command equivalents for Docker API operations.
  • app/core/config.py
    • Added new configuration settings: 'ENABLE_REALTIME_PYTHON_TEST_LOGS' and 'ENABLE_CONTAINER_LOGS'.
  • app/crud/crud_project.py
    • Added a 'get_by_name' method to retrieve a project by its name.
  • app/crud/crud_test_run_execution.py
    • Enhanced the 'get_multi' method with 'sort_order' parameter and support for returning all results when 'limit' is 0.
  • app/main.py
    • Implemented an asynchronous startup event to initialize Python test collections.
  • app/models/init.py
    • Updated 'TestStateEnum' to be imported from 'app.constants.shared_constants'.
  • app/models/test_case_execution.py
    • Updated 'TestStateEnum' import path.
  • app/models/test_enums.py
    • Removed this file as its content ('TestStateEnum') was moved to 'app/constants/shared_constants.py'.
  • app/models/test_run_execution.py
    • Added an 'execution_config' JSON column to store per-execution configuration overrides.
    • Updated type hints from 'Optional[T]' to 'T | None'.
  • app/models/test_step_execution.py
    • Updated 'TestStateEnum' import path.
  • app/models/test_suite_execution.py
    • Updated 'TestStateEnum' import path.
  • app/pics_applicable_test_cases.py
    • Refactored 'applicable_test_cases_list' to 'applicable_test_cases_set' to support platform certification PICS and DMP test skipping.
    • Introduced new helper functions and error handling for platform test files.
  • app/schemas/init.py
    • Imported 'ChipServerInfo' schema.
  • app/schemas/chip_server_info.py
    • Added a new schema for ChipServer information, including node ID and manual pairing code.
  • app/schemas/grouped_test_run_execution_logs.py
    • Updated 'TestStateEnum' import path.
  • app/schemas/test_case_execution.py
    • Updated 'TestStateEnum' import path.
  • app/schemas/test_environment_config.py
    • Added 'ba_host' and 'ba_port' fields to 'ThreadAutoConfig'.
  • app/schemas/test_harness_backend_version.py
    • Added 'sdk_docker_tag' field to the backend version schema.
  • app/schemas/test_run_execution.py
    • Added 'execution_config' to 'TestRunExecutionBase' and introduced a new 'TestRunExecutionUpdate' schema.
    • Updated type hints from 'Optional[T]' to 'T | None'.
  • app/schemas/test_step_execution.py
    • Updated 'TestStateEnum' import path.
  • app/schemas/test_suite_execution.py
    • Updated 'TestStateEnum' import path.
  • app/singleton.py
    • Improved type hinting for the 'Singleton' metaclass.
  • app/socket_connection_manager.py
    • Refactored to manage different WebSocket connection types (MAIN, VIDEO, WEBRTC_CONTROLLER, WEBRTC_PEER).
    • Implemented methods for relaying UDP video frames and handling WebRTC signaling.
  • app/test_engine/models/manual_test_case.py
    • Added new prompt methods for stream verification and text input with response.
  • app/test_engine/models/test_case.py
    • Modified the 'config' property to prioritize 'execution_config' from 'TestRunExecution'.
  • app/test_engine/models/test_run.py
    • Modified the 'config' property to prioritize 'execution_config' from 'TestRunExecution'.
  • app/test_engine/models/test_step.py
    • Updated 'TestStateEnum' import path.
  • app/test_engine/models/test_suite.py
    • Modified the 'config' property to prioritize 'execution_config' from 'TestRunExecution'.
  • app/test_engine/test_collection_discovery.py
    • Changed iteration order for 'emptied_collections' to reversed to prevent index issues during deletion.
  • app/test_engine/test_db_observer.py
    • Updated 'TestStateEnum' import path.
  • app/test_engine/test_runner.py
    • Added logging of 'Project config' and 'Project PICS' at the start of a test run.
  • app/test_engine/test_script_manager.py
    • Refactored Python test discovery and initialization to be asynchronous and container-aware, using a new 'test_manager.py' module.
  • app/test_engine/test_ui_observer.py
    • Updated enum import paths to 'app.constants.shared_constants'.
  • app/tests/init.py
    • Added 'sdk_container_mock' import for testing purposes.
  • app/tests/api/api_v1/test_projects.py
    • Added new tests for project import/export, DMP test skip upload, and various PICS upload scenarios.
    • Updated existing tests to reflect changes in DUT config validation and PICS handling.
  • app/tests/api/api_v1/test_test_run_executions.py
    • Added extensive new tests for the CLI test execution endpoint, covering project creation, updates, and configuration overrides.
    • Introduced tests for renaming test run executions and for the 'limit=0' functionality in 'read_test_run_executions'.
  • app/tests/api/api_v1/test_test_run_executions_import_export.py
    • Updated 'TestStateEnum' import path.
  • app/tests/api/api_v1/test_test_run_executions_log.py
    • Introduced a 'process_log_messages' helper and updated log assertions to handle multi-line log entries and empty lines.
  • app/tests/conftest.py
    • Implemented synchronous Python test initialization with JSON mocking for test environments.
    • Added new fixtures for mocking JSON loading and using a real SDK container.
  • app/tests/crud/test_test_run_execution.py
    • Added tests for updating test run executions and for sorting/limiting results in 'get_multi_with_stats'.
  • app/tests/sdk_container_mock.py
    • Added a new file to provide a mock implementation of 'SDKContainer' for testing.
  • app/tests/socket_connection_manager/test_socket_connection_manager.py
    • Updated tests to use 'WebSocketConnection' objects and reflect changes in enum import paths.
  • app/tests/test_engine/test_db_observer.py
    • Updated 'TestStateEnum' import path.
  • app/tests/test_engine/test_runner.py
    • Updated 'TestStateEnum' import path.
  • app/tests/test_engine/test_runner_abort_testing.py
    • Updated 'TestStateEnum' import path.
  • app/tests/test_engine/test_runner_exceptions.py
    • Updated 'TestStateEnum' import path.
  • app/tests/test_engine/test_ui_observer.py
    • Updated enum import paths to 'app.constants.shared_constants'.
  • app/tests/user_prompts/test_options_select_user_prompts.py
    • Updated enum import paths and 'socket_connection_manager.received_message' parameter name.
  • app/tests/user_prompts/test_text_input_user_prompts.py
    • Updated enum import paths and 'socket_connection_manager.received_message' parameter name.
  • app/tests/user_prompts/test_user_prompt_manager.py
    • Updated enum import paths.
  • app/tests/utils/test_case_execution.py
    • Updated 'TestStateEnum' import path.
  • app/tests/utils/test_run_execution.py
    • Updated 'TestStateEnum' import path.
  • app/tests/utils/test_step_execution.py
    • Updated 'TestStateEnum' import path.
  • app/tests/utils/test_suite_execution.py
    • Updated 'TestStateEnum' import path.
  • app/tests/version/test_read_test_harness_backend_version.py
    • Refactored version reading tests to use temporary files and assert 'sdk_docker_tag'.
    • Added new tests for SDK version information consistency.
  • app/utils.py
    • Added new constants 'DMP_TEST_SKIP_FILENAME', 'DMP_TEST_SKIP_CONFIG_NODE' and a 'parse_dmp_file' function for XML parsing.
  • app/version.py
    • Added 'sdk_docker_tag' to the backend version information and related helper functions.
  • cspell.json
    • Updated the cspell dictionary with new words and ignored paths.
  • custom_python
    • Added a new path configuration file.
  • custom_yaml
    • Added a new path configuration file.
  • test_collections/matter/config.py
    • Updated 'SDK_DOCKER_TAG' and 'SDK_SHA' values.
  • test_collections/matter/default_project.config
    • Added 'ba_host' and 'ba_port' to the default Thread network configuration.
  • test_collections/matter/platform-cert/README.md
    • Added a README file for platform certification test lists.
  • test_collections/matter/platform-cert/generated-platform-cert-test-list.json
    • Added a JSON file listing platform certification test cases.
  • test_collections/matter/python_tests
    • Updated the subproject commit.
  • test_collections/matter/scripts/OTBR/otbr_start.sh
    • Enhanced the script to accept options for interface and variant, and updated Thread network parameters to be dynamic.
  • test_collections/matter/scripts/update-paa-certs.sh
    • Improved certification folder management by introducing a 'recreate_dir_with_ownership' function.
  • test_collections/matter/scripts/update-sample-apps.sh
    • Updated Docker volume mounts and copy commands for sample applications.
  • test_collections/matter/sdk_tests/python_tests_ignore.txt
    • Added a new file to list Python test files to ignore.
  • test_collections/matter/sdk_tests/python_tests_include.txt
    • Added a new file to list Python test files to include.
  • test_collections/matter/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh
    • Updated sparse checkout paths and modified the wheel building process to create a 'chipyaml' package.
  • test_collections/matter/sdk_tests/support/chip/chip_server.py
    • Added functionality to generate manual pairing codes using chip-tool and improved server exit handling with a timeout mechanism.
  • test_collections/matter/sdk_tests/support/constants.py
    • Added a new file defining 'USER_ACTIONS' for manual test steps.
  • test_collections/matter/sdk_tests/support/performance_tests/models/performance_tests_hooks_proxy.py
    • Updated import path for 'TestRunnerHooks'.
  • test_collections/matter/sdk_tests/support/performance_tests/models/test_case.py
    • Updated command arguments for performance tests, changing '--interactions' to '--iterations'.
  • test_collections/matter/sdk_tests/support/performance_tests/models/test_suite.py
    • Simplified 'public_id' generation for performance test suites.
  • test_collections/matter/sdk_tests/support/performance_tests/scripts/sdk/TC_COMMISSIONING_1_0.py
    • Updated imports and modified the test to use dynamic iterations based on user parameters.
  • test_collections/matter/sdk_tests/support/performance_tests/sdk_performance_tests.py
    • Refactored to use constants for stress test collection and suite names.
  • test_collections/matter/sdk_tests/support/performance_tests/utils.py
    • Added new constants for stress test collection, suite, path, and folder.
  • test_collections/matter/sdk_tests/support/python_testing/init.py
    • Refactored Python test collection initialization to be managed by 'test_manager.py' and updated imports.
  • test_collections/matter/sdk_tests/support/python_testing/list_python_tests_classes.py
    • Added a new file for discovering Python test classes, generating JSON info, and handling ignore/include lists.
  • test_collections/matter/sdk_tests/support/python_testing/models/python_test_models.py
    • Updated comments for 'PythonTestType' enum.
  • test_collections/matter/sdk_tests/support/python_testing/models/python_test_parser.py
    • Refactored to parse pre-generated JSON files for Python test information instead of direct AST parsing.
    • Updated test name extraction and changed error logging to warnings for parsing issues.
  • test_collections/matter/sdk_tests/support/python_testing/models/python_testing_hooks_proxy.py
    • Updated import path for 'TestRunnerHooks'.
    • Added new prompt types for video, image, two-way talk, and push AV stream verification.
  • test_collections/matter/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py
    • Updated the path for 'DOCKER_RPC_PYTHON_TESTING_PATH' to reflect changes in the SDK's testing infrastructure.
  • test_collections/matter/sdk_tests/support/python_testing/models/test_case.py
    • Implemented real-time and batch logging for Python test output.
    • Added support for new prompt types (video, image, two-way talk, push AV stream verification) and enhanced commissioning logic.
    • Modified the 'config' property to prioritize 'execution_config'.
  • test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py
    • Enhanced commissioning logic to handle new NFC and Thread pairing modes and reuse existing commissioning data.
    • Added logic to disable 'polkit' for NFC/Thread pairing modes.
  • test_collections/matter/sdk_tests/support/python_testing/models/utils.py
    • Refactored commissioning utilities, including admin storage file handling and new pairing mode arguments.
    • Added functions for logging test output and determining if new commissioning is needed.
  • test_collections/matter/sdk_tests/support/python_testing/sdk_python_tests.py
    • Updated to use pre-generated JSON files for Python test definitions and added version suffixes for custom test suites.
  • test_collections/matter/sdk_tests/support/python_testing/test_manager.py
    • Added a new file to manage asynchronous Python test collection initialization and JSON file generation.
  • test_collections/matter/sdk_tests/support/tests/matter/test_test_environment_config.py
    • Added new tests for Thread Border Agent parameters, QR/manual code conflicts, and missing DUT config fields.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_list_python_tests_classes.py
    • Added a new test file for validating Python test filename patterns and the functionality of ignore/include lists.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_python_parser.py
    • Refactored to read Python test information from a JSON file.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_python_script/python_tests_info.json
    • Added a sample JSON file containing Python test information.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_case.py
    • Added new tests for DUT commissioning error handling and legacy Python test case commissioning logic.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_suite.py
    • Added tests for commissioning suite setup failure and new commissioning scenarios.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py
    • Updated test fixtures and assertions to reflect changes in Python test collection parsing.
  • test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py
    • Added new tests for 'generate_command_arguments' covering NFC-onnetwork, NFC-Thread, and parametrized WiFi pairing modes.
  • test_collections/matter/sdk_tests/support/tests/test_sdk_container.py
    • Updated tests to use the 'real_sdk_container' fixture and adjusted 'test_send_command_without_starting' for mocked exceptions.
  • test_collections/matter/sdk_tests/support/tests/utils/utils.py
    • Added new default config fixtures for Thread Border Agent parameters.
  • test_collections/matter/sdk_tests/support/yaml_tests/matter_yaml_runner.py
    • Updated imports to 'matter.yamltests' and 'chipyaml.adapters.chiptool'.
    • Added new NFC and Thread pairing modes and simplified pairing result logic.
  • test_collections/matter/sdk_tests/support/yaml_tests/models/chip_suite.py
    • Implemented new NFC and Thread pairing modes and associated logic.
    • Added logic to disable 'polkit' for NFC pairing modes and to remove 'admin_storage.json' on setup.
  • test_collections/matter/sdk_tests/support/yaml_tests/models/chip_test.py
    • Added support for extended prompt timeouts and new prompt types (stream verification, text input).
  • test_collections/matter/sdk_tests/support/yaml_tests/models/test_case.py
    • Updated test case factory and manual step handling to support new user actions and custom suffixes.
  • test_collections/matter/sdk_tests/support/yaml_tests/models/test_suite.py
    • Added logic to remove 'admin_storage.json' on setup and simplified 'public_id' generation.
  • test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_parser.py
    • Updated the logic for categorizing semi-automated tests to include new user action commands.
  • test_collections/matter/sdk_tests/support/yaml_tests/sdk_yaml_tests.py
    • Added version suffixes for custom YAML test suites.
  • test_collections/matter/test_environment_config.py
    • Added 'ba_host' and 'ba_port' to 'ThreadExternalConfig' and 'enhanced_setup_flow' to 'DutConfig'.
    • Implemented validation for Thread pairing mode requiring Border Agent parameters.
    • Added validation for 'qr-code' and 'manual-code' exclusivity.
Activity
  • The pull request was created by OlivierGre.
  • A new Alembic migration script was added, indicating database schema changes.
  • Multiple new files were introduced, suggesting new features and significant refactoring.
  • Existing files were extensively modified across various components, including API endpoints, WebSocket handling, container management, and test collection logic.
  • New and updated test files were included to cover the newly implemented functionalities and refactorings.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@rquidute rquidute changed the base branch from main to v2.15-develop February 19, 2026 14:21
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a new NFC-on-network pairing mode, which includes adding the new mode to the DutPairingModeEnum, updating test suite configurations to recognize this new mode, and implementing corresponding test cases and pairing functions. The changes appear to be functionally correct and well-tested, ensuring the new pairing mode is properly integrated into the existing framework.

@OlivierGre OlivierGre requested a review from rquidute February 23, 2026 14:35
Copy link
Contributor

@antonio-amjr antonio-amjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Olivier,

Can you verify the following concern below?
Thanks.

Comment on lines +128 to +135
assert [
"--trace-to json:log",
"--commissioning-method nfc-on-network",
"--discriminator 123",
"--passcode 1234",
"--paa-trust-store-path /paa-root-certs",
"--storage_path /root/admin_storage.json",
] == arguments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Unit Test passing?
I made a recent change at the utils.py file that verify if a NFC pairing mode is being used, ignoring the discriminator and the passcode in case positive (please refer to the "NFC_PAIRING_MODES" variable).

I thought that the assert should not have both --discriminator and --passcode in the NFC case.
Can you take a look @OlivierGre?

@OlivierGre OlivierGre marked this pull request as draft February 24, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants