ct_snmp

MODULE

ct_snmp

MODULE SUMMARY

Common Test user interface module for the OTP snmp application.

DESCRIPTION

Common Test user interface module for the OTP snmp application

The purpose of this module is to make snmp configuration easier for
the test case writer. Many test cases can use default values for common
operations and then no snmp configuration files need to be supplied. When
it is necessary to change particular configuration parameters, a subset
of the relevant snmp configuration files may be passed to ct_snmp
by means of Common Test configuration files.
For more specialized configuration parameters, it is possible to place a
"simple snmp configuration file" in the test suite data directory.
To simplify the test suite, Common Test keeps track
of some of the snmp manager information. This way the test suite doesn't
have to handle as many input parameters as it would if it had to interface the
OTP snmp manager directly.

The MgrAgentConfName parameter in the functions
should be a name you allocate in your test suite using a
require statement.
Example (where MgrAgentConfName = snmp_mgr_agent):

suite() -> [{require, snmp_mgr_agent, snmp}].

or

ct:require(snmp_mgr_agent, snmp).

Note that Usm users are needed for snmp v3 configuration and are
not to be confused with users.

Snmp traps, inform and report messages are handled by the
user callback module. For more information about this see
the snmp application.

Note: It is recommended to use the .hrl-files created by the
Erlang/OTP mib-compiler to define the oids.
Example for the getting the erlang node name from the erlNodeTable
in the OTP-MIB:

Oid = ?erlNodeEntry ++ [?erlNodeName, 1]

It is also possible to set values for snmp application configuration
parameters, such as config, server,
net_if, etc (see the "Configuring the application" chapter in
the OTP snmp User's Guide for a list of valid parameters and types). This is
done by defining a configuration data variable on the following form:

A name for the data needs to be allocated in the suite using
require (see example above), and this name passed as
the SnmpAppConfName argument to start/3.
ct_snmp specifies default values for some snmp application
configuration parameters (such as {verbosity,trace} for the
config parameter). This set of defaults will be
merged with the parameters specified by the user, and user values
override ct_snmp defaults.

Returns a list of all successful set requests performed in
the test case in reverse order. The list contains the involved
user and agent, the value prior to the set and the new value. This
is intended to facilitate the clean up in the end_per_testcase
function i.e. the undoing of the set requests and its possible
side-effects.

Starts an snmp manager and/or agent. In the manager case,
registrations of users and agents as specified by the configuration
MgrAgentConfName will be performed. When using snmp
v3 also so called usm users will be registered. Note that users,
usm_users and managed agents may also be registered at a later time
using ct_snmp:register_users/2, ct_snmp:register_agents/2, and
ct_snmp:register_usm_users/2. The agent started will be
called snmp_master_agent. Use ct_snmp:load_mibs/1 to load
mibs into the agent. With SnmpAppConfName it's possible
to configure the snmp application with parameters such as config,
mibs, net_if, etc. The values will be merged
with (and possibly override) default values set by ct_snmp.