Skip to content

[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202603#324

Merged
mssonicbld merged 3 commits intoAzure:202603from
mssonicbld:sonicbld/202603-merge
May 7, 2026
Merged

[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202603#324
mssonicbld merged 3 commits intoAzure:202603from
mssonicbld:sonicbld/202603-merge

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

* b753f1a8 - (origin/202511) Showtech collection for gearbox (#4305) (#4523) (2026-05-06) [arpit-nexthop]
* fc5a26ee - [sfputil] Gracefully handle missing/invalid info for 'sfputil show eeprom' (#4524) (2026-05-07) [mssonicbld]<br>```

mssonicbld and others added 3 commits May 7, 2026 05:12
…prom' (#4524)

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

 CODE_OF_CONDUCT.md LICENSE README.md SECURITY.md SUPPORT.md azure-pipelines failure_prs.log scripts skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "closes #xxxx",
 "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
 issue when the PR is merged.

 If you are adding/modifying/removing any command or utility script, please also
 make sure to add/modify/remove any unit tests from the tests
 directory as appropriate.

 If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
 subcommand, or you are adding a new subcommand, please make sure you also
 update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
 your changes.

 Please provide the following information:
-->

#### What I did
Handle the scenario when there is missing/non-available info in EEPROM

#### How I did it
Add a check in CLI

#### How to verify it
run 'sfputil show eeprom'

#### Previous command output (if the output of a command-line utility has changed)
```
 File "/usr/local/bin/sfputil", line 8, in <module>
 sys.exit(cli())
 ^^^^^
 File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 764, in __call__
 return self.main(*args, **kwargs)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 717, in main
 rv = self.invoke(ctx)
 ^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1137, in invoke
 return _process_result(sub_ctx.command.invoke(sub_ctx))
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1137, in invoke
 return _process_result(sub_ctx.command.invoke(sub_ctx))
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 956, in invoke
 return ctx.invoke(self.callback, **ctx.params)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 555, in invoke
 return callback(*args, **kwargs)
```

#### New command output (if the output of a command-line utility has changed)
`EEPROM info: N/A`

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
* Showtech collection for gearbox

1) Updated gearboxutil to show gearbox fec stats and histogram
2) Added gearbox stats in the generate_dump



* tests: Add coverage for gearboxutil FEC stats and histogram

Add unit tests for the new InterfaceFecStats class and format_ber()
helper introduced in the gearboxutil script. Includes a mock
GB_COUNTERS_DB fixture with Ethernet0 line/system port data.

Tests cover:
- format_ber(): normal values, zero, N/A, -1, non-numeric passthrough
- InterfaceFecStats: fec-stats headers, port display, BER formatting,
  port filtering, invalid port error handling, fec-histogram bins
  (BIN0-BIN15), histogram port filtering and error handling



* tests: Fix gearboxutil import and flake8 blank line violation

Use SourceFileLoader explicitly to load extensionless script as
spec_from_file_location returns None without a .py extension.
Remove extra blank line to fix E303 flake8 violation.



* tests: Fix E402 flake8 violation by moving import to top of file



* gearboxutil: Use string literal for GB_COUNTERS_DB connection

SonicV2Connector.GB_COUNTERS_DB attribute is not available in all
environments. Use the string literal directly, consistent with how
get_all() calls already reference the DB name.



* Update the tests with GB_COUNTERS_DB connector



* Added show gearbox CLI to support fec-stats and histogram, updated the
command refernce guide

Updated to read oper state from the system_oper_status and
line_oper_status



* Fix the precommit check, E302 and E741 errors



* Tests for show gearbox command



---------


(cherry picked from commit f62b8ecdf240ad3b0540d29b1cf4d7fcf9948625)

Signed-off-by: arpit-nexthop <arpit@nexthop.ai>
@mssonicbld mssonicbld merged commit 77ac7ad into Azure:202603 May 7, 2026
3 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.

2 participants