Skip to content

Enable SRP server on OTBR container startup - #342

Merged
rquidute merged 2 commits into
project-chip:v2.16-developfrom
khodya:srp-enable
Aug 11, 2026
Merged

Enable SRP server on OTBR container startup#342
rquidute merged 2 commits into
project-chip:v2.16-developfrom
khodya:srp-enable

Conversation

@khodya

@khodya khodya commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Explicitly enable the OpenThread SRP server when the OTBR container starts, instead of relying on RoutingManager's auto-enable heuristic.

Problem
  • Both OTBR startup paths (otbr_start.sh and ThreadBorderRouter.form_thread_topology() in otbr_manager.py) form the Thread topology (dataset ... commit active, ifconfig up, thread start, netdata register) but never issue srp server enable.
  • The nrfconnect/otbr image relies on OpenThread's SRP server auto-enable mode, which only flips the server on once RoutingManager finishes its initial policy evaluation on the infra interface. In this environment (Docker with --network host on a Raspberry Pi host), that evaluation does not reliably complete, so the SRP server stays disabled indefinitely.
  • Consequence observed on TC-CNET-4.12 step 7 (switching the DUT to a second Thread network hosted by a second OTBR): the DUT successfully joins the new Thread partition, but since the SRP server on that OTBR is disabled, the DUT's SRP client never registers its _matter._tcp host, so nothing is published for the test harness's mDNS/SRP query. wait_for_srp_update() polls for 180s and times out with TestFailure: Unable to find device, even though Thread connectivity itself is healthy.
  • ot-ctl netdata show on the affected OTBR container confirmed the DNS/SRP service entry (service data 0x5d) was absent from Network Data until the server was enabled manually via ot-ctl srp server enable.
Solution
  • Added srp server enable right after netdata register in both OTBR startup flows:
    • test_collections/matter/scripts/OTBR/otbr_start.sh (BR_PARAMS list, shell/manual path).
    • test_collections/matter/sdk_tests/support/otbr_manager/otbr_manager.py (ThreadBorderRouter.form_thread_topology(), harness-managed path).
  • This makes SRP server activation deterministic at topology formation time instead of depending on auto-enable succeeding on the host's infra interface. The setting persists across later dataset set active / thread start calls made when switching Thread datasets mid-test, so it only needs to be set once per container lifetime.
  • The repo already had a manual workaround script (otbr_srp_restart.sh doing srp server disable + srp server enable), but it was not wired into any startup path — this change makes the fix automatic.

Testing

  • Manually reproduced the failure: ran TC_CNET_4_12.py against a two-OTBR Thread setup; step 7 failed with Unable to find device while ot-ctl netdata show on the second OTBR showed no 0x5d DNS/SRP service entry.
  • Confirmed ot-ctl srp server enable on the affected container immediately publishes the 0x5d service entry in Network Data and allows the DUT's SRP registration to be discovered.
  • No automated test added: this change only affects the local OTBR container bring-up scripts used by the certification harness/manual test setup, not a code path with its own unit tests.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enables the SRP (Service Registration Protocol) server during the OpenThread Border Router (OTBR) initialization. It adds the "srp server enable" command to both the OTBR startup script and the Python-based OTBR manager during thread topology formation. I have no feedback to provide as there are no review comments.

@cecille
cecille requested a review from greens July 20, 2026 20:08
@rquidute
rquidute requested a review from antonio-amjr July 20, 2026 21:40

@greens greens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we know why RoutingManager's policy evaluation doesn't reliably complete?

@khodya

khodya commented Jul 21, 2026

Copy link
Copy Markdown
Author

Do we know why RoutingManager's policy evaluation doesn't reliably complete?

No, this is something that requires investigation, probably by tracing the RoutingManager logs.

@mergify

mergify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@khodya

khodya commented Jul 21, 2026

Copy link
Copy Markdown
Author

I don't have access to tick the box to merge this PR.

@khodya

khodya commented Jul 21, 2026

Copy link
Copy Markdown
Author

@Mergifyio queue

@mergify

mergify Bot commented Jul 21, 2026

Copy link
Copy Markdown

queue

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

@rquidute
rquidute changed the base branch from main to v2.16-develop July 22, 2026 12:50
@rquidute

rquidute commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Hi @khodya, I changed the target branch to the one used in v1.7. Let me know if we can proceed with merging into this branch

@rquidute
rquidute merged commit bd725d3 into project-chip:v2.16-develop Aug 11, 2026
8 of 9 checks passed
@rquidute

Copy link
Copy Markdown
Contributor

Merged into v2.16-develop branch (Matter v1.7 version)

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.

5 participants