Skip to content

test: run SNMPv3 end to end for every protocol pair against snmpd - #40

Merged
ilyam8 merged 1 commit into
masterfrom
engine-v3-e2e
Oct 11, 2026
Merged

ilyam8 merged 1 commit into
masterfrom
engine-v3-e2e

Conversation

@ilyam8

@ilyam8 ilyam8 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

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's createUser accepts as they are (AES192/AES256 extend the key as Blumenthal, AES192C/AES256C as Reeder; snmpd keeps them apart).
  • snmp_users.sh creates the snmpd users from that file (same interface for CI and build_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: TestSnmpV3Users gets 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 checked Connect's validation (pinned exactly by TestUSMValidate) 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, and GOARCH=386) and against Alpine's net-snmp 5.9.5.2 through the repository's Docker image (build_tests.sh).
  • TestSnmpUsers fails for a missing pair, a duplicated pair, a missing privacy passphrase, an unknown protocol name and a duplicated user name.
  • go vet with and without end2end; golangci-lint v2.14.0 with --build-tags=end2end: 0 issues.

@ilyam8
ilyam8 added this pull request to stack #38 October 9, 2026 14:25
@ilyam8
ilyam8 force-pushed the engine-v3-e2e branch 2 times, most recently from 94066f8 to af8c0d2 Compare October 11, 2026 09:47
Base automatically changed from engine-walk to master October 11, 2026 09:52
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.
@ilyam8
ilyam8 merged commit 0958200 into master Oct 11, 2026
21 checks passed
@ilyam8
ilyam8 deleted the engine-v3-e2e branch October 11, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants