Skip to content

[dhcp_relay] Add dhcp6relay runtime reconfiguration tests - #25589

Open
AnantKishorSharma wants to merge 1 commit into
sonic-net:masterfrom
AnantKishorSharma:dhcp6relay-dynamic-config
Open

[dhcp_relay] Add dhcp6relay runtime reconfiguration tests#25589
AnantKishorSharma wants to merge 1 commit into
sonic-net:masterfrom
AnantKishorSharma:dhcp6relay-dynamic-config

Conversation

@AnantKishorSharma

@AnantKishorSharma AnantKishorSharma commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Why I did it

Add functional coverage for the SONiC-native dhcp6relay applying DHCP_RELAY configuration at runtime, without a dhcp_relay container restart (sonic-net/sonic-dhcp-relay#116).

How I did it

tests/dhcp_relay/test_dhcpv6_relay_runtime_config.py (topology t0/m0/mx/t0-2vlans, device_type vs) — 4 tests driven entirely through CONFIG_DB:

  • test_dhcp6relay_starts_without_dhcpv6_servers
  • test_dhcp6relay_runtime_ipv6_added_after_start
  • test_dhcp6relay_runtime_server_change_no_restart
  • test_dhcp6relay_runtime_relay_removed_no_restart

Each asserts the relay applies the change at runtime (the Add/Update/Remove relay config ... at runtime syslog), the process PID is unchanged, and the legacy need restart container to take effect log is not emitted.

How to verify it

On a qfx5200 t0 testbed with the dhcp6relay change deployed:

  • non-Dual-ToR: 4 passed
  • Dual-ToR: 4 passed

Companion PRs: sonic-net/sonic-dhcp-relay#116 (core) · sonic-net/sonic-buildimage sonic-net/sonic-buildimage#28042 · sonic-net/SONiC sonic-net/SONiC#2402 (HLD)

CI note — impacted-area-kvmtest failures are expected here

These tests assert the runtime-reconfig behavior from sonic-net/sonic-dhcp-relay#116,
which isn't in the vs image yet (baseline dhcp6relay still restarts and emits
need restart container to take effect), so the *_no_restart cases correctly fail.

Comment thread tests/dhcp_relay/test_dhcpv6_relay_runtime_config.py Fixed
@AnantKishorSharma
AnantKishorSharma force-pushed the dhcp6relay-dynamic-config branch from 6f012d7 to b71c612 Compare June 23, 2026 08:54
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AnantKishorSharma
AnantKishorSharma marked this pull request as ready for review June 23, 2026 08:58
@AnantKishorSharma

Copy link
Copy Markdown
Contributor Author

/azpw retry

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AnantKishorSharma

AnantKishorSharma commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

CI status — expected red until the companion PRs are in the image

The impacted-area-kvmtest-t0 / t0-2vlans failures on this PR are
dhcp_relay/test_dhcpv6_relay_runtime_config.py ||| 2 failed, and they are
expected for this PR in isolation — not a test defect.

These tests exercise the SONiC-native dhcp6relay runtime reconfiguration
path (applying DHCP_RELAY changes through CONFIG_DB with no dhcp_relay
container restart). That behavior is delivered by the companion PRs, which are
not yet merged:

@AnantKishorSharma
AnantKishorSharma force-pushed the dhcp6relay-dynamic-config branch from b71c612 to f3a1a83 Compare July 13, 2026 20:05
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Add sonic-mgmt tests that dhcp6relay applies configuration at runtime
without restarting the dhcp_relay container:

- starts when no dhcpv6_servers are configured
- adds a relay instance when a VLAN gets an IPv6 address at runtime, and
  removes it when that address is removed
- applies dhcpv6_server changes in place (PID unchanged, no
  "need restart container" log)

Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
@AnantKishorSharma
AnantKishorSharma force-pushed the dhcp6relay-dynamic-config branch from f3a1a83 to 6cd746c Compare July 13, 2026 20:33
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AnantKishorSharma

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1163914:

✅Stage Test:

  • Job impacted-area-kvmtest-t0-2vlans by Elastictest: retried.
  • Job impacted-area-kvmtest-t0 by Elastictest: retried.

@AnantKishorSharma

Copy link
Copy Markdown
Contributor Author

/azpw retry

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1163914:

✅Stage Test:

  • Job impacted-area-kvmtest-t0 by Elastictest: retried.
  • Job impacted-area-kvmtest-t0-2vlans by Elastictest: retried.

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.

3 participants