[ha][ssw] remove hardcoded devicename and loopback config#22736
Open
zjswhhh wants to merge 2 commits intosonic-net:masterfrom
Open
[ha][ssw] remove hardcoded devicename and loopback config#22736zjswhhh wants to merge 2 commits intosonic-net:masterfrom
zjswhhh wants to merge 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Jing Zhang <zhangjing@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
aronovic
reviewed
Mar 5, 2026
| loopback_v6 = topo_dut["loopback"]["ipv6"][switch_id] | ||
|
|
||
| # VLAN SVI per DUT | ||
| svi_ip = "20.0.200.14/28" if switch_id == 0 else "20.0.201.14/28" |
Contributor
There was a problem hiding this comment.
Can we also remove those hardcoded IP addresses?
Contributor
Author
There was a problem hiding this comment.
Hi @aronovic - these VLAN IPs are actually identical for all testbeds, plus we don't have it defined in topo file or testbed file, so might have to hard code it for now.
aronovic
reviewed
Mar 5, 2026
| def generate_ha_config_for_dut(switch_id: int, duthost, tbinfo): | ||
| """ | ||
| switch_id 0 FOR DUT01 | ||
| switch_id 1 FOR DUT02 |
Contributor
There was a problem hiding this comment.
Where will the hostname come from?
Contributor
Author
There was a problem hiding this comment.
It's from testbed.yml iirc.
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run Azure.sonic-mgmt |
|
Azure Pipelines successfully started running 1 pipeline(s). |
… public_hardcoded_loopback
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
Summary:
Fixes # (issue)
Instead of hardcoding the device name and loopback addresses, get it from topo file.
sign-off: Jing Zhang zhangjing@microsoft.com
Type of change
Back port request
Approach
What is the motivation for this PR?
Otherwise every time we run ha tests, the device name and loopback will be changed.
How did you do it?
Get the information from tbinfo instead of hard coded it.
How did you verify/test it?
I ran a dummy test with the fixture, checked the json files generated under
/tmp, loopback addresses and device names are accurate on both DUTs.Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation