-
Notifications
You must be signed in to change notification settings - Fork 114
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
Restored snmp vlan support per RFC1213 and added the missing support for RFC2863 #218
Conversation
…egate rif counters (sonic-net#169)" (sonic-net#191)" This reverts commit dfde06e.
Signed-off-by: Raphael Tryster <[email protected]>
Signed-off-by: Raphael Tryster <[email protected]>
Signed-off-by: Raphael Tryster <[email protected]>
…import paths Signed-off-by: Raphael Tryster <[email protected]>
Signed-off-by: Raphael Tryster <[email protected]>
Signed-off-by: Raphael Tryster <[email protected]>
This pull request introduces 2 alerts when merging aa0d150 into 28b9dfd - view on LGTM.com new alerts:
|
Signed-off-by: Raphael Tryster <[email protected]>
@lguohan - Who can review this PR ? |
self.assertEqual(str(value0.name), str(ObjectIdentifier(11, 0, 1, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 20, 1001)))) | ||
self.assertEqual(value0.data, 106) | ||
|
||
class TestGetNextPDU_2863(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: raphaelt <[email protected]>
Can you modify changes added in this PR, so that interface description of Port Channel and management interface matches the value retrieved from config db, which will be empty string.
More information added here: |
…tion" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. (#224) - What I did This is a correction of #218, which is contained in sonic-net/sonic-buildimage#7859, after community decided that entries under .1.3.6.1.2.1.31.1.1.1.18 OID should return the "description" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. For vlan, management and LAG, these are empty strings. - How I did it Deleted the lines of code quoted by Suvarna in the above PRs. This necessitated modifying 4 unit tests that had been written under the assumption that these OIDs would return non-empty data. - How to verify it Run unit tests in build and snmp tests in sonic-mgmt. - Description for the changelog Entries under .1.3.6.1.2.1.31.1.1.1.18 OID should return the "description" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. Signed-off-by: Raphael Tryster <[email protected]>
self.vlan_oid_name_map = Namespace.get_sync_d_from_all_namespace(mibs.init_sync_d_vlan_tables, self.db_conn) | ||
|
||
self.rif_port_map, \ | ||
self.port_rif_map = Namespace.get_sync_d_from_all_namespace(mibs.init_sync_d_rif_tables, self.db_conn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not used. Can you remove? Or are you missing some implementation in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was code, copied from rfc1213, that used them and was removed in an earlier review. So I think I can remove rif_port_map and port_rif_map in rfc2863. Done in #237.
**- What I did** Removed unused variables rif_port_map and port_rif_map in rfc2863.py **- How I did it** Edited rfc2863.py as requested by @qiluo-msft in merged PR #218. **- How to verify it** pytest-3 test_interfaces.py and pytest-3 namespace/test_interfaces.py in sonic-snmpagent/tests. **- Description for the changelog** Removed unused variables.
…for RFC2863 (sonic-net#218) - What I did Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863. - How I did it Reverted sonic-net#191, which was itself a revert of sonic-net#169. Then added code to support vlan in rfc2863.py and unit tests. Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need. - How to verify it Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl. See also Azure#169. - Description for the changelog Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863. (cherry picked from commit 266bd15)
…tion" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. (sonic-net#224) - What I did This is a correction of sonic-net#218, which is contained in sonic-net/sonic-buildimage#7859, after community decided that entries under .1.3.6.1.2.1.31.1.1.1.18 OID should return the "description" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. For vlan, management and LAG, these are empty strings. - How I did it Deleted the lines of code quoted by Suvarna in the above PRs. This necessitated modifying 4 unit tests that had been written under the assumption that these OIDs would return non-empty data. - How to verify it Run unit tests in build and snmp tests in sonic-mgmt. - Description for the changelog Entries under .1.3.6.1.2.1.31.1.1.1.18 OID should return the "description" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. Signed-off-by: Raphael Tryster <[email protected]> (cherry picked from commit 0813b42)
**- What I did** Removed unused variables rif_port_map and port_rif_map in rfc2863.py **- How I did it** Edited rfc2863.py as requested by @qiluo-msft in merged PR sonic-net#218. **- How to verify it** pytest-3 test_interfaces.py and pytest-3 namespace/test_interfaces.py in sonic-snmpagent/tests. **- Description for the changelog** Removed unused variables. (cherry picked from commit a07da53)
…for RFC2863 (sonic-net#218) - What I did Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863. - How I did it Reverted sonic-net#191, which was itself a revert of sonic-net#169. Then added code to support vlan in rfc2863.py and unit tests. Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need. - How to verify it Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl. See also Azure#169. - Description for the changelog Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863. (cherry picked from commit 266bd15)
…tion" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. (sonic-net#224) - What I did This is a correction of sonic-net#218, which is contained in sonic-net/sonic-buildimage#7859, after community decided that entries under .1.3.6.1.2.1.31.1.1.1.18 OID should return the "description" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. For vlan, management and LAG, these are empty strings. - How I did it Deleted the lines of code quoted by Suvarna in the above PRs. This necessitated modifying 4 unit tests that had been written under the assumption that these OIDs would return non-empty data. - How to verify it Run unit tests in build and snmp tests in sonic-mgmt. - Description for the changelog Entries under .1.3.6.1.2.1.31.1.1.1.18 OID should return the "description" field of PORT_TABLE entries in APPL_DB or CONFIG_DB. Signed-off-by: Raphael Tryster <[email protected]> (cherry picked from commit 0813b42)
**- What I did** Removed unused variables rif_port_map and port_rif_map in rfc2863.py **- How I did it** Edited rfc2863.py as requested by @qiluo-msft in merged PR sonic-net#218. **- How to verify it** pytest-3 test_interfaces.py and pytest-3 namespace/test_interfaces.py in sonic-snmpagent/tests. **- Description for the changelog** Removed unused variables. (cherry picked from commit a07da53)
… for RFC2863 (#279) **- What I did** Cherry-pick the required PRs to 202012 Branch to add SNMP VLAN Support. This is done because the VLAN if index comes in ipNetToMediaPhysAddress (1.3.6.1.2.1.4.22.1.2) but not in ifName 1.3.6.1.2.1.31.1.1.1.1. **- How I did it** Cherry-pick below PRs: #218 - Main change #224 - Follow up PR #237 - Follow up PR **- How to verify it** Before PR changes: ``` admin@str2-sn3800-02:~$ docker exec -it snmp snmpwalk -v2c -c msft 127.0.0.1 1.3.6.1.2.1.31.1.1.1.1 iso.3.6.1.2.1.31.1.1.1.1.1 = STRING: "etp1a" iso.3.6.1.2.1.31.1.1.1.1.3 = STRING: "etp1b" iso.3.6.1.2.1.31.1.1.1.1.5 = STRING: "etp2a" iso.3.6.1.2.1.31.1.1.1.1.7 = STRING: "etp2b" iso.3.6.1.2.1.31.1.1.1.1.9 = STRING: "etp3a" iso.3.6.1.2.1.31.1.1.1.1.11 = STRING: "etp3b" .. iso.3.6.1.2.1.31.1.1.1.1.255 = STRING: "etp64b" iso.3.6.1.2.1.31.1.1.1.1.1101 = STRING: "PortChannel101" iso.3.6.1.2.1.31.1.1.1.1.1102 = STRING: "PortChannel102" iso.3.6.1.2.1.31.1.1.1.1.1103 = STRING: "PortChannel103" iso.3.6.1.2.1.31.1.1.1.1.1104 = STRING: "PortChannel104" iso.3.6.1.2.1.31.1.1.1.1.10000 = STRING: "eth0" ``` After PR changes; Can see vlan 1000 with ifindex3000: ``` admin@str2-sn3800-02:~$ docker exec -it snmp snmpwalk -v2c -c msft 127.0.0.1 1.3.6.1.2.1.31.1.1.1.1 iso.3.6.1.2.1.31.1.1.1.1.1 = STRING: "etp1a" iso.3.6.1.2.1.31.1.1.1.1.3 = STRING: "etp1b" iso.3.6.1.2.1.31.1.1.1.1.5 = STRING: "etp2a" iso.3.6.1.2.1.31.1.1.1.1.7 = STRING: "etp2b" iso.3.6.1.2.1.31.1.1.1.1.9 = STRING: "etp3a" iso.3.6.1.2.1.31.1.1.1.1.11 = STRING: "etp3b" .. iso.3.6.1.2.1.31.1.1.1.1.255 = STRING: "etp64b" iso.3.6.1.2.1.31.1.1.1.1.1101 = STRING: "PortChannel101" iso.3.6.1.2.1.31.1.1.1.1.1102 = STRING: "PortChannel102" iso.3.6.1.2.1.31.1.1.1.1.1103 = STRING: "PortChannel103" iso.3.6.1.2.1.31.1.1.1.1.1104 = STRING: "PortChannel104" iso.3.6.1.2.1.31.1.1.1.1.3000 = STRING: "Vlan1000" iso.3.6.1.2.1.31.1.1.1.1.10000 = STRING: "eth0" ``` UT Passes
Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863.
Reverted #191, which was itself a revert of #169. Then added code to support vlan in rfc2863.py and unit tests.
Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need.
Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl.
See also Azure#169.
Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863.