Commit 453beb0
test: fix SNMPv3 negative test against USM key cache
The wrong-password test passed authentication because net-snmp caches
localized USM keys per (engineID, username) for the process lifetime. An
earlier test had already authenticated as testuser with the correct
passphrase, so the cached key was reused and the bad passphrase never
reached the agent -- the test was asserting on the cache, not the agent.
Use a dedicated 'baduser' that no passing test ever authenticates as, so
its cache entry is only ever populated from the wrong passphrase. Also
add an unknown-user case, which is rejected agent-side and so cannot be
affected by client caching at all.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014KG1c9XtKawkvig5PnZjC81 parent 3604154 commit 453beb0
2 files changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
| |||
0 commit comments