Skip to content

fix for test_snmp_numpsu failure#14860

Merged
kevinskwang merged 2 commits intosonic-net:masterfrom
agadia-cisco:test-snmp-numpsu-failure
Oct 30, 2024
Merged

fix for test_snmp_numpsu failure#14860
kevinskwang merged 2 commits intosonic-net:masterfrom
agadia-cisco:test-snmp-numpsu-failure

Conversation

@agadia-cisco
Copy link
Copy Markdown
Contributor

@agadia-cisco agadia-cisco commented Oct 7, 2024

Description of PR

Summary: test_snmp_numpsu TC fails because of change in stdout output, observed in 202405 & 202311.

Fixes # (issue)
stdout_lines will be use to fetch the numpsus value, if the stdout_lines is empty / the value can't be typecasted; then in all scenarios TC wouldn't break, instead it will Error out gracefully. Sample stdout_lines considered -

1. ["PSU0: Topology teardown completed successfully upon PSU removal", "2"]
2. ["2"]
3. []

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Observed test_snmp_psu failing in 202405 & 202311 images due to change in the stdout structure.

How did you do it?

Earlier stdout output was simply getting typecasted, instead now it will use stdout_lines & check its length, if it has a non-zero length, then it will pick the last element & try typecasting it; numpsus count if exists, will always be the last element in the output.

How did you verify/test it?

Run changes with 202405 & 202311 images on a T0 setup and all of them passed.

Copy link
Copy Markdown
Collaborator

@bpar9 bpar9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fill the Approach Section of the PR and how/where it was verified? rest lgtm

@agadia-cisco
Copy link
Copy Markdown
Contributor Author

@bpar9 have updated the PR with approach section.

Copy link
Copy Markdown
Collaborator

@bpar9 bpar9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Copy Markdown
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lğtm

@wsycqyz
Copy link
Copy Markdown
Contributor

wsycqyz commented Oct 29, 2024

PR test stuck. Let me close and re-open the PR.

@wsycqyz wsycqyz closed this Oct 29, 2024
@wsycqyz wsycqyz reopened this Oct 29, 2024
@kevinskwang kevinskwang merged commit a20e752 into sonic-net:master Oct 30, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 30, 2024
* fix for test_snmp_numpsu tc failure

* Trigger Pipeline again
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202405: #15254

mssonicbld pushed a commit that referenced this pull request Oct 30, 2024
* fix for test_snmp_numpsu tc failure

* Trigger Pipeline again
@agadia-cisco
Copy link
Copy Markdown
Contributor Author

@kevinskwang @wsycqyz Could you please trigger cherry pick PR for 202311 too.

sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
* fix for test_snmp_numpsu tc failure

* Trigger Pipeline again
yutongzhang-microsoft pushed a commit to yutongzhang-microsoft/sonic-mgmt that referenced this pull request Nov 21, 2024
* fix for test_snmp_numpsu tc failure

* Trigger Pipeline again
@agadia-cisco
Copy link
Copy Markdown
Contributor Author

@kevinskwang @wsycqyz Could you please trigger cherry pick PR for 202311 too.

@kevinskwang @wsycqyz Could you please trigger cherry pick PR for 202305 too.

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.

5 participants