[SNMP4J] Unit Test SNMP v3 Agent with TestSnmpManager

ulrich berl ulrich.berl at gmx.net
Mon Aug 6 14:44:12 CEST 2018


Hi!
 
I wrote a SNMP v3 Agent. The agent was tested using a third-party SnmpManager, works fine if configured with the allowed usm users; additional if vor a valid user a wrong authpassphrase is supplied, the request is not successful.
 
So i wrote some unit tests for the agent, BUT the problem is, that using a TestSnmpManager - using snmp4j too - allows only one instance of SecurityModels, which will be written by Agent and the TestSnmpManager (having same id SECURITY_MODEL_USM, so will be overwritten).

So in this scenario in my test i can successful query eg. sysDescr from agent using an allowed v3 user with wrong authpassphrase ...

How to successful write such an unit test using Agent AND TestSnmpManager (snmp4j) to eg. verify get request for valid v3 user with correct/wrong passphrases ?
Or i have to create binary for TestSnmpManager and use it as external tool ?

br, Ulrich


More information about the SNMP4J mailing list