sonic-mgmt
sonic-mgmt copied to clipboard
Fix test_check_show_lpmode case
Description of PR
Summary: Fix test_check_show_lpmode case Fixes # (issue)
- Currently the
test_check_show_lpmodecase usexcvr_skip_listfunction to check lpmode for only supported interface, but the code passes all the output ofshow interface transceiver lpmodetovalidate_transceiver_lpmodefunction, then the function checks each interface lpmode. This is incorrect. Fix it.
For example, if the interface lpmode is like this "['Ethernet0 N/A', 'Ethernet1 Off']", Ethernet0 is RJ45 and no lpmode check is needed. Ethernet1 needs to check lpmode
- In the current logic, Ethernet0 does not check lpmode, which is correct.
- Ethernet1 needs to check lpmode, but the code passes all the output
(['Ethernet0 N/A', 'Ethernet1 Off'])of the command to the functionvalidate_transceiver_lpmode. It checks each item and finds that Ethernet0 lpmode is "N/A", then the case fails. This is incorrect
- Move the "
check if header exists" test fromvalidate_transceiver_lpmodetotest_check_show_lpmode. So the header only check one time.
Type of change
- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] Test case(new/improvement)
Back port request
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [x] 202405
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
@prgeor Can you help review?
@mihirpat1 can review?
Hi @bingwang-ms ,
@mihirpat1 had approved the change, could you help merge it, thanks!
/azp run Azure.sonic-mgmt
Azure Pipelines successfully started running 1 pipeline(s).
PR checker got stuck. Just re-triggered it
@weiguo-nvidia PR conflicts with 202405 branch
conflicts with 202405 branch
Hi @mssonicbld ,
I create PR #15417 to submit the same fix in 202405 branch, could you help review it?