Skip to content

[snmp] Improve the error handling of snmp pfc_counters check#798

Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom
wangxin:snmp-pfc
Feb 25, 2019
Merged

[snmp] Improve the error handling of snmp pfc_counters check#798
liat-grozovik merged 1 commit intosonic-net:masterfrom
wangxin:snmp-pfc

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Feb 3, 2019

The snmp pfc_counter check is to validate if the interfaces have
expected attributes. However, when expected attributes are missing, the
script failed with error "'dict object' has no attribute". This change
improved the error handling using a more robust syntax.

Signed-off-by: Xin Wang [email protected]

Description of PR

Summary:
Fixes # (issue)

The snmp pfc_counter check is to validate if the interfaces have
expected attributes. However, when expected attributes are missing, the
script failed with error "'dict object' has no attribute". This change
improved the error handling using a more robust syntax.

Type of change

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

Approach

How did you do it?

Improve the checking of expected interface attributes using a more robust syntax.

How did you verify/test it?

Tested on Mellanox platform.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

The snmp pfc_counter check is to validate if the interfaces have
expected attributes. However, when expected attributes are missing, the
script failed with error "'dict object' has no attribute". This change
improved the error handling using a more robust syntax.

Signed-off-by: Xin Wang <[email protected]>
@qiluo-msft
Copy link
Contributor

Looks good to me. Thanks @wangxin !

@yxieca
Copy link
Collaborator

yxieca commented Feb 28, 2019

Made to 201811 branch on 2/28/2019

yxieca pushed a commit that referenced this pull request Feb 28, 2019
The snmp pfc_counter check is to validate if the interfaces have
expected attributes. However, when expected attributes are missing, the
script failed with error "'dict object' has no attribute". This change
improved the error handling using a more robust syntax.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin deleted the snmp-pfc branch May 24, 2019 03:35
auspham pushed a commit to auspham/sonic-mgmt that referenced this pull request Feb 3, 2026
<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary: Fix ipfwd assert assumption for Broadcom TH5

The test limits the number of nhops that is used for testing. However,
the general assert assumes this limit does not exist and asserts with
CRM to make sure nhops available after the test is 0.

This causes issues on TH5 because the number of nhop groups supported
is 4095, where the limit of the test is 1024. This means that the number
of nhop groups after the test would not be 0 `(4095 - 1024 - (extra
groups) >> 0)`.

The Cisco-case of the test has the proper assert that adjusts for this
test limit. Fixing the test by including Broadcom TH5 devices to use that
proper assert.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
 - [ ] Skipped for non-supported platforms
- [ ] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [x] msft-202412
- [x] 202505

### Approach
#### What is the motivation for this PR?
ipfwd tests failing for Arista TH5 devices.

#### How did you do it?
Adjust the assert conditions for Arista TH5 devices.

#### How did you verify/test it?
Test no longer fails on Arista TH5 devices.

#### Any platform specific information?
Broadcom TH5

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
e438b0db6a8912b50f7acddf93d4dc2157f53ecf (HEAD -> 201911, origin/201911) Increase Syncd operation timeout from 1 min to 6 min. (sonic-net#828)
17974adb369111b44dd56837547806918ed4b1ed Update syncd_flex_counter.cpp (sonic-net#798)

Signed-off-by: Abhishek Dosi <[email protected]>
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.

4 participants