Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sudo sfputil show error-status on a multiasic platform issue #2373

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

mlok-nokia
Copy link
Contributor

What I did

Fixed "sudo sfputil show error-status" on a multiasic platform issue. Fixes sonic-net/sonic-buildimage#8504

This change is also applicable to 202205 branch

How I did it

The current implementation is only hard code to connect STATE_DB on host database with SonicV2Connector(127.,0.0.1). To support the multiasic platform, we need to query the data entry from STATE_DB of namespace database. Following the existing design to use multi_asic.get_front_end_namespaces. And looping the namespaces to get the output_table for each namespace.

How to verify it

  1. running the image on a multasic platform which front panel ports have SFP inserted.
  2. execute "sudo sfptuil show error-status". The output should show all ports with status.
admin@sonic:~$ sudo sfputil show error-status
Port        Error Status
----------  --------------
Ethernet0   OK
Ethernet1   OK
Ethernet2   OK
Ethernet3   OK
Ethernet4   OK
Ethernet5   OK
Ethernet6   OK
Ethernet7   OK
Ethernet8   OK
Ethernet9   OK
Ethernet10  OK
Ethernet11  OK
Ethernet12  OK
Ethernet13  OK
Ethernet14  OK
Ethernet15  OK
Ethernet16  OK
Ethernet17  OK
Ethernet18  OK
Ethernet19  OK
Ethernet20  OK
Ethernet21  OK
Ethernet22  OK
Ethernet23  OK
Ethernet24  OK
Ethernet25  OK
Ethernet26  OK
Ethernet27  OK
Ethernet28  OK
Ethernet29  OK
Ethernet30  OK
Ethernet31  OK
Ethernet32  OK
Ethernet33  OK
Ethernet34  OK
Ethernet35  OK

Previous command output (if the output of a command-line utility has changed)

Previous output doesn't have any port name

admin@sonic:~$ sudo sfputil show error-status
Port    Error Status
------  --------------
admin@sonic:~$ 

New command output (if the output of a command-line utility has changed)

abdosi
abdosi previously approved these changes Oct 3, 2022
@abdosi
Copy link
Contributor

abdosi commented Oct 3, 2022

@mlok-nokia can we add code-coverage for same ?

@mlok-nokia
Copy link
Contributor Author

@mlok-nokia can we add code-coverage for same ?

I am currently on some other task right now, can I add the code-coverage in the next PR? Thanks

@mlok-nokia
Copy link
Contributor Author

@abdosi Unit Test case test_show_error_status() has been added for this PR. Please review it. Thanks.

Signed-off-by: mlok <marty.lok@nokia.com>
@mlok-nokia mlok-nokia force-pushed the sfputil-show-error-status branch from 452bed5 to 69d8af7 Compare October 24, 2022 17:42
@abdosi abdosi merged commit 6621120 into sonic-net:master Nov 2, 2022
yxieca pushed a commit that referenced this pull request Nov 10, 2022
Fixed "sudo sfputil show error-status" on a multiasic platform issue. Fixes sonic-net/sonic-buildimage#8504
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
…ic-net#2373)

Fixed "sudo sfputil show error-status" on a multiasic platform issue. Fixes sonic-net/sonic-buildimage#8504
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
…ic-net#2373)

Fixed "sudo sfputil show error-status" on a multiasic platform issue. Fixes sonic-net/sonic-buildimage#8504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

sfputil show error-status on a multi-asic box shows no ports
5 participants