Skip to content

[action] [PR:27309] [console] Use mapped fanout ports in loopback test - #1371

Merged
mssonicbld merged 1 commit into
Azure:202603from
mssonicbld:cherry/msft-202603/27309
Aug 25, 2026
Merged

[action] [PR:27309] [console] Use mapped fanout ports in loopback test#1371
mssonicbld merged 1 commit into
Azure:202603from
mssonicbld:cherry/msft-202603/27309

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
Fix test_console_loopback for c0 topologies where a DUT console line and its connected fanout line use different port numbers. The test now resolves the fanout port from device_serial_link instead of reusing the DUT port number.

Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): N/A
Failure type: N/A

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Test result

  • master: flake8, syntax validation, mapping smoke test, and pytest collection passed (8 cases collected).
  • Physical c0 validation on Nokia-7215-C1-G3 with SONiC image 20260310.19: 8 passed, 0 failed, 0 skipped.

Approach

What is the motivation for this PR?

*_serial_links.csv records both the DUT line number and the connected fanout line number. These values are not always identical. The test selected DUT lines from the graph but incorrectly reused those numbers for fanout loopback and bridge operations, causing all data-path checks to time out when the fanout used different ports.

How did you do it?

Added a helper that resolves and validates each DUT line's fanout peerport from device_serial_link. Echo tests now loop back the mapped fanout port, and ping-pong tests bridge the two mapped fanout ports. Reverse-SSH session state checks remain on the corresponding DUT lines.

How did you verify/test it?

Before the change, all 8 echo and ping-pong combinations failed on a c0 testbed whose DUT lines 1/2 mapped to different fanout lines. After the change, all 8 combinations passed at 9600 and 115200 baud with flow control enabled and disabled.

Any platform specific information?

Physically verified on Nokia-7215-C1-G3. The fix is graph-driven and not platform-specific.

Supported testbed topology if it's a new test case?

N/A. This fixes an existing test for c0 topology and preserves existing c0-lo behavior.

Documentation

N/A.

Signed-off-by: Sonic Build Admin sonicbld@microsoft.com

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fix `test_console_loopback` for c0 topologies where a DUT console line and its connected fanout line use different port numbers. The test now resolves the fanout port from `device_serial_link` instead of reusing the DUT port number.

Fixes # (issue)
<!--
If you request a backport/cherry-pick below, link the GitHub issue or ADO work
item here (for example, "Fixes #<issue>" or "ADO: <work item URL>").
-->

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [x] Test case improvement

### Back port request
<!--
Only check a release or feature branch when the PR links a GitHub issue or ADO
work item above. The linked tracker should explain the failure in detail,
including whether it is a day-one issue or a regression, the affected
branch/image/platform/test, and why this branch needs the fix. Backport or
cherry-pick requests without a linked issue/work item may not be favored.

If you request a backport/cherry-pick, provide both:
1. A GitHub issue or Microsoft ADO work item tracking the change.
2. Test evidence from the target branch(es) requested below.
-->
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): N/A
Failure type: N/A

### Tested branch
<!--
Select each branch where the change was tested. If you request a
backport/cherry-pick, select the base branch and the tested target release
branch(es).
-->
- [x] master
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [ ] 202512
- [ ] 202605
- [ ] N/A

### Test result
<!--
Provide the tested image version and test evidence for each selected branch.
For example:
- master: 20260716.01 - <test result or link>
- 202605: 20260531.42 - <test result or link>
-->

- master: flake8, syntax validation, mapping smoke test, and pytest collection passed (8 cases collected).
- Physical c0 validation on Nokia-7215-C1-G3 with SONiC image `20260310.19`: `8 passed, 0 failed, 0 skipped`.

### Approach
#### What is the motivation for this PR?

`*_serial_links.csv` records both the DUT line number and the connected fanout line number. These values are not always identical. The test selected DUT lines from the graph but incorrectly reused those numbers for fanout loopback and bridge operations, causing all data-path checks to time out when the fanout used different ports.

#### How did you do it?

Added a helper that resolves and validates each DUT line's fanout `peerport` from `device_serial_link`. Echo tests now loop back the mapped fanout port, and ping-pong tests bridge the two mapped fanout ports. Reverse-SSH session state checks remain on the corresponding DUT lines.

#### How did you verify/test it?
<!--
Summarize the overall validation here. For a backport/cherry-pick request,
provide branch-specific image versions and evidence in the Test result section.
-->

Before the change, all 8 echo and ping-pong combinations failed on a c0 testbed whose DUT lines `1/2` mapped to different fanout lines. After the change, all 8 combinations passed at 9600 and 115200 baud with flow control enabled and disabled.

#### Any platform specific information?

Physically verified on Nokia-7215-C1-G3. The fix is graph-driven and not platform-specific.

#### Supported testbed topology if it's a new test case?

N/A. This fixes an existing test for c0 topology and preserves existing c0-lo behavior.

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->

N/A.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-mgmt#27309

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@mssonicbld
mssonicbld merged commit d264168 into Azure:202603 Aug 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant