Test cases – Comtrol eCos User Manual
Page 619

Chapter 47. SNMP for eCos
location specified in
SNMPCONFPATH
, or the standard builtin locations, and use these profiles. Only the profiles
specified in the
ACCESS-CONTROL
section of
file have been tested and shown to work. Other profiles
which have been implemented in
UCD-SNMP-4.1.2
’s
snmpd.conf
may not work because the sole purpose of
adding support for the snmpd.conf file has been to set up
ACCESS-CONTROL
models.
At startup, the SNMP module tries to look for file
snmp.conf
. If this file is not available, the module successively
looks for files
snmpd.conf
,
snmp.local.conf
and
snmpd.local.conf
at the locations pointed to by
SNMP-
CONFPATH
environment variable. In case
SNMPCONFPATH
is not defined, the search sequence is carried out in default
directories. The default directories are :
/usr/share/snmp
,
/usr/local/share/snmp
and
$(HOME)/.snmp
. The
configurations read from these files are used to control both, SNMP applications and the SNMP agent; in the usual
UNIX fashion.
The inclusion of snmpd.conf support is enabled by default when suitable filesystems and FILEIO packages are
active.
Test cases
Currently only one test program is provided which uses SNMP.
"snmpping" in the SNMP agent package runs the ping test from the TCPIP package, with the snmpd running also.
This allows you to interrogate it using host tools of your choice. It supports MIBs as documented above, so eg.
snmpwalk <
hostname
> public dot3 under Linux/UNIX should have the desired effect.
For
serious
testing,
you
should
increase
the
length
of
time
the
test
runs
by
setting
CYGNUM_SNMPAGENT_TESTS_ITERATIONS to something big (e.g., 999999). Build the test (make -C
net/snmp/agent/current tests) and run it on the target.
Then start several jobs, some for pinging the board (to make the stats change) and some for interrogating the snmpd.
Set $IP to whatever IP address the board has:
# in a root shell, for flood ping
while(1)
date
ping -f -c 3001 $IP
sleep 5
ping -c 32 -s 2345 $IP
end
# have more than one of these going at once
setenv MIBS all
while (1)
snmpwalk -OS $IP
public
date
end
Leave to run for a couple of days or so to test stability.
The test program can also test snmpd.conf support. It tries to build a minimal snmpd.conf file on a RAM filesystem
and passes it to the snmp sub-system. With this profile on target, the following snmp[cmd] (cmd=walk, get, set)
should work :
snmp[cmd] -v1 $IP crux $OID
snmp[cmd] -v2 $IP crux $OID
515