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 for test_snmp_numpsu failure #14860

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

agadia-cisco
Copy link
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
Contributor

@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
Contributor Author

@bpar9 have updated the PR with approach section.

Copy link
Contributor

@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
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
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
15 checks passed
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
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
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