Repository navigation
test: run SNMPv3 end to end for every protocol pair against snmpd - #40
Merged
Merged
Conversation
ilyam8
added this pull request to stack #38
October 9, 2026 14:25
ilyam8
force-pushed
the
engine-v3-e2e
branch
2 times, most recently
from
October 11, 2026 09:47
94066f8 to
af8c0d2
Compare
Of the 18 SNMPv3 end-to-end tests, CI ran one (noAuth): 16 skipped unless they ran against the retired demo.snmplabs.com service, and AES-192 was skipped as "known to have issues". CI's snmpd had no AES-192/256 users. testdata/snmp_users.txt now lists one user per authentication x privacy protocol pair (42) plus a noAuth user, each with its own passphrases, using the library's protocol names, which net-snmp's createUser accepts as they are. snmp_users.sh creates the users from it, and TestSnmpUsers (no build tag) checks that every pair is there once with the passphrases it needs. TestSnmpV3Users gets sysDescr and bulk-walks the system group as each user, after the engine discovery of a new connection: all 43 pass against net-snmp 5.9.3, AES-192 and AES-256 with both key extensions included. It replaces the 18 copies; the credentials tables, the snmplabs flag and target, and the two tests that only checked Connect's validation (pinned exactly by TestUSMValidate) are removed.
stelfrag
approved these changes
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Runs SNMPv3 end to end against a real net-snmp agent for every authentication and privacy protocol pair, the last part of the request engine's safety net. Tests and CI test setup only, no library change.
Of the 18 SNMPv3 end-to-end tests, CI ran one (noAuth): 16 skipped unless they ran against the retired demo.snmplabs.com service, and AES-192 was skipped as "known to have issues". CI's snmpd had no AES-192/256 users.
testdata/snmp_users.txt: one user per authentication x privacy pair (6 x 7) plus a noAuth user, each with its own passphrases, using the library's protocol names, which net-snmp'screateUseraccepts as they are (AES192/AES256 extend the key as Blumenthal, AES192C/AES256C as Reeder; snmpd keeps them apart).snmp_users.shcreates the snmpd users from that file (same interface for CI andbuild_tests.sh).snmp_users_test.go:TestSnmpUsers(no build tag) checks that every pair is there exactly once, with a passphrase exactly where a protocol needs one.generic_e2e_test.go:TestSnmpV3Usersgets sysDescr and bulk-walks the system group as each user after engine discovery on a new connection. It replaces the 18 copies; the credentials tables, the snmplabs flag and target, and the two tests that only checkedConnect's validation (pinned exactly byTestUSMValidate) are removed. The README says which users the agent needs.Testing
TestSnmpV3Users: 43 of 43 pass against Debian's net-snmp 5.9.3 in a Docker reproduction of the CI job (amd64 with-race, andGOARCH=386) and against Alpine's net-snmp 5.9.5.2 through the repository's Docker image (build_tests.sh).TestSnmpUsersfails for a missing pair, a duplicated pair, a missing privacy passphrase, an unknown protocol name and a duplicated user name.go vetwith and withoutend2end; golangci-lint v2.14.0 with--build-tags=end2end: 0 issues.