sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Fix test_check_show_lpmode case

Open weiguo-nvidia opened this issue 1 year ago • 6 comments
trafficstars

Description of PR

Summary: Fix test_check_show_lpmode case Fixes # (issue)

  1. Currently the test_check_show_lpmode case use xcvr_skip_list function to check lpmode for only supported interface, but the code passes all the output of show interface transceiver lpmode to validate_transceiver_lpmode function, 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 function validate_transceiver_lpmode. It checks each item and finds that Ethernet0 lpmode is "N/A", then the case fails. This is incorrect
  1. Move the "check if header exists" test from validate_transceiver_lpmode to test_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

weiguo-nvidia avatar Oct 21 '24 08:10 weiguo-nvidia

@prgeor Can you help review?

bingwang-ms avatar Oct 23 '24 21:10 bingwang-ms

@mihirpat1 can review?

prgeor avatar Oct 30 '24 20:10 prgeor

Hi @bingwang-ms ,

@mihirpat1 had approved the change, could you help merge it, thanks!

weiguo-nvidia avatar Oct 31 '24 02:10 weiguo-nvidia

/azp run Azure.sonic-mgmt

bingwang-ms avatar Oct 31 '24 17:10 bingwang-ms

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 31 '24 17:10 azure-pipelines[bot]

PR checker got stuck. Just re-triggered it

bingwang-ms avatar Oct 31 '24 17:10 bingwang-ms

@weiguo-nvidia PR conflicts with 202405 branch

mssonicbld avatar Nov 06 '24 21:11 mssonicbld

conflicts with 202405 branch

Hi @mssonicbld ,

I create PR #15417 to submit the same fix in 202405 branch, could you help review it?

weiguo-nvidia avatar Nov 07 '24 03:11 weiguo-nvidia