Add Test Framework Support for IPv6-only Management Network#22407
Closed
opcoder0 wants to merge 12 commits intosonic-net:masterfrom
Closed
Add Test Framework Support for IPv6-only Management Network#22407opcoder0 wants to merge 12 commits intosonic-net:masterfrom
opcoder0 wants to merge 12 commits intosonic-net:masterfrom
Conversation
This change introduces the --ipv6-only-mgmt flag for testbed-cli.sh to configure DUTs with IPv6-only management interfaces, eliminating IPv4 from the management network. Key changes: - testbed-cli.sh: Add --ipv6-only-mgmt flag for gen-mg, deploy-mg, test-mg - config_sonic_basedon_testbed.yml: Handle IPv6-only minigraph deployment with proper async handling for management IP transition - minigraph_dpg.j2, minigraph_dpg_asic.j2: Conditionally include IPv4/IPv6 management interfaces based on use_ipv6_mgmt flag - group_vars/*/ipv6.yml: IPv6 service configurations (NTP, DNS, syslog) - setup-ntp-server.sh: Docker-based Chrony NTP server for local time sync - pr_test_template.yml: Add CI jobs for IPv6-only management testing - Documentation updates for setup and troubleshooting The local NTP server (fec0::ffff:afa:2) ensures reliable time synchronization when external IPv6 NTP servers are unreachable. Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Remove unused ipv6.yml file from vm_host Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Changes required to get sanity check and pretests to pass in an IPv6 only mgmt environment. - Add -6 to run_tests.sh to run tests in IPv6 only mgmt setup - Add --ipv6_only_mgmt option to conftest - Modify base.py init method to detect IPv6 only mgmt setup and initialize mgmt_ip accordingly - Modify checks.py and reboot.py to use IPv6 address for pings Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
…e instead Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
wangxin
reviewed
Feb 24, 2026
|
|
||
| # Module-level flag for IPv6-only management mode. | ||
| # This is set by the ipv6_only_mgmt_enabled fixture in conftest.py | ||
| _ipv6_only_mgmt_enabled = False |
Collaborator
There was a problem hiding this comment.
Is there a way to avoid using global variable?
wangxin
reviewed
Feb 24, 2026
| logger.info("check if dut is pingable") | ||
| localhost.shell(f"ping -c 5 {duthost.mgmt_ip}", module_ignore_errors=True) | ||
| # Use ping6 for IPv6 addresses, ping for IPv4 | ||
| ping_cmd = "ping6" if ":" in str(duthost.mgmt_ip) else "ping" |
Collaborator
There was a problem hiding this comment.
It is better to use is_ipv6_address defined in tests.common.utilities to check if it is IPv6 address here.
Contributor
Author
|
Re-opened new PR after some additional internal tests and bug fixing. #23292 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
This PR adds test framework support for running SONiC tests in IPv6-only management network environments. When enabled, the test framework uses IPv6 addresses for DUT management connectivity and skips IPv4-specific sanity checks.
This complements the existing --ipv6-only-mgmt support in testbed-cli.sh (#22310) by adding the necessary test infrastructure changes.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
Pretest needs to work in an IPv6 only management environment. The PR contains changes to invoke tests in such an environment and pretest checks.
How did you do it?
Changes include
run_tests.sh: Add -6 flag for IPv6-only management mode; fix pretest/posttest by adding . path argument
conftest.py: Add --ipv6_only_mgmt pytest option and ipv6_only_mgmt_enabled session fixture
base.py: Use IPv6 address as mgmt_ip when IPv6-only mode enabled
checks.py: Skip IPv4 management ping check when mgmt_ip is IPv6
reboot.py: Use ping6 for IPv6 management addresses
To run tests in IPv6 only management setup pass -6 to run_tests.sh. Example Usage -
How did you verify/test it?
Locally.
Any platform specific information?
None
Supported testbed topology if it's a new test case?
None
Documentation
Updated in ipv6-management-setup.md and README.testbed.VsSetup.md.