[Mellanox] Add new cases for eeprom#6649
Conversation
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
1002f19 to
04caa11
Compare
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
For this pre-commit issue, I am not sure how to resolve it. Maybe the pep8 check rule need to do some modification? Because conn_graph_facts is a fixture Actually it has been used by test case. |
|
@Junchao-Mellanox could you please help to review? |
| second_layer_dict = {} | ||
| previous_key = "" | ||
| top_key = "" | ||
| for line in sfp_eeprom_info.split("\n"): |
There was a problem hiding this comment.
Can we parse those SFP which has no EEPROM?
There was a problem hiding this comment.
Yes. for this case, case will raise failure
| key, dom_monitor_data[key], pattern) | ||
|
|
||
|
|
||
| def is_support_dom(duthost, port_index): |
There was a problem hiding this comment.
Maybe it is better to use ethtool -m sfp{index}. Part of the data of "show interface transceiver eeprom -d" comes from sfp.get_transceiver_bulk_status. So, using sfp.get_transceiver_bulk_status to test "show interface transceiver eeprom -d" may not find real issues.
There was a problem hiding this comment.
maybe can use mlxlink/ethtool to check whether relevant fields are valid.
| return sfp_eeprom_info_dict | ||
|
|
||
|
|
||
| def check_sfp_eeprom_info(duthost, sfp_eeprom_info, is_support_dom, show_eeprom_cmd): |
There was a problem hiding this comment.
Could you please consider using compare the output of show eeprom command with ethtool/mlxlink output?
There was a problem hiding this comment.
for a specific field, the output from ethtool/mlxlink could have some differences with the SONiC CLI output, no easy way to directly compare of them. only the Vendor OUI, Vendor Name, Vendor SN.. are the same and can be compared directly.
There was a problem hiding this comment.
Will use mlxlink tool to check if it supports dom.
| """ | ||
| bulk_status_str = get_transceiver_bulk_status(duthost, port_index) | ||
| bulk_status_str = bulk_status_str.replace('-inf', '\'-inf\'') | ||
| bulk_status_dict = eval(bulk_status_str) |
There was a problem hiding this comment.
suggest use literal_eval instead of eval
|
I am not sure about the scope of this PR. A few general comments:
|
As what we discussed at the beginning, the PR doesn't include these scopes, we just check the two cmds' outputs. If needed, we can add one task to add them. |
|
This PR added 2 new files, can you ensure that the new files can pass the pre-commit check? Thanks! @JibinBao |
Sure. There is only one issue in which fixture is used, but pep8 checks it is not imported. I will update it. |
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
ee2c8e6 to
32e9aa9
Compare
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
32e9aa9 to
78cb479
Compare
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
…er_bulk_status for branches apart from 202012
78cb479 to
95661bf
Compare
|
The pre-commit check detected issues in the files touched by this pull request. For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
|
/azpw run Azure.sonic-mgmt |
|
/AzurePipelines run Azure.sonic-mgmt |
|
Azure Pipelines successfully started running 1 pipeline(s). |
- What is the motivation for this PR? Check the outputs are correct for "show interface transceiver eeprom -d", "sudo sfputil show eeprom -d". Check if all expected keys exist in the outputs When cable support dom, check the corresponding keys related to monitor exist, and the the corresponding value has the correct format - How did you do it? Add new tests - How did you verify/test it? Run script of test_check_sfp_eeprom.py - Any platform specific information? Yes. Mellanox - Supported testbed topology if it's a new test case? Any
- What is the motivation for this PR? Check the outputs are correct for "show interface transceiver eeprom -d", "sudo sfputil show eeprom -d". Check if all expected keys exist in the outputs When cable support dom, check the corresponding keys related to monitor exist, and the the corresponding value has the correct format - How did you do it? Add new tests - How did you verify/test it? Run script of test_check_sfp_eeprom.py - Any platform specific information? Yes. Mellanox - Supported testbed topology if it's a new test case? Any
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
Check the outputs are correct for "show interface transceiver eeprom -d", "sudo sfputil show eeprom -d".
How did you do it?
Add new tests
How did you verify/test it?
Run script of test_check_sfp_eeprom.py
Any platform specific information?
Yes. Mellanox
Supported testbed topology if it's a new test case?
Any
Documentation