-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add netsnmp-cffi as alternative SNMP trap receiver back-end #395
base: feature/use-netsnmpy-cffi
Are you sure you want to change the base?
Add netsnmp-cffi as alternative SNMP trap receiver back-end #395
Conversation
In preparation for making an alternative trap back-end based on netsnmp-cffi, this moves the existing module to a submodule that can be selectively imported, just as we did with `zino.snmp`.
This extracts from `zino.trapd.pysnmp_backend` all auxiliary classes and type definitions that are not specific to the PySNMP back-end and moves them to `zino.trapd.base` so they can be re-used by other back-ends.
This changes the `localhost_receiver` fixture to use 1163 as its trap port, and then updates tests that sends external traps to the fixture so that they will use the port assigned to the fixture. This will better enable the test suite to change trap ports dynamically, which might become necessary when running tests for multiple back-ends in the same test session.
A PySNMP-based and a netsnmp-cffi-based `TrapReceiver` implementation will share a lot of common functionality that is unrelated to the specifics of the underlying SNMP libraries. This factors those things out in to a base class that can be common to the implementations, to avoid redundancies.
|
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results2 tests 0 ✅ 2s ⏱️ For more details on these errors, see this check. Results for commit 5665879. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/use-netsnmpy-cffi #395 +/- ##
==============================================================
- Coverage 98.51% 34.32% -64.20%
==============================================================
Files 80 52 -28
Lines 9893 3733 -6160
==============================================================
- Hits 9746 1281 -8465
- Misses 147 2452 +2305 ☔ View full report in Codecov by Sentry. |
Scope and purpose
Fixes the trap part of #383. Dependent on #389.
#389 works on its own, without touching the trap implementation. This builds on that to add just the trap implementation, using many of the same refactoring techniques as #3389.
Contributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Zino can be found in the
README.