Hello,

in building net-snmp 5.1.2.1 I found some strange behaviour when running
the tests (which happens implicitly when using dist/nsb-package btw).

There is an OID (ipRoutingDiscards.0) which I know isn't available for
e.g. HP-UX 10.20, 11.0 and 11i. As I saw in the tests this OID is
checked using SNMPv1, SNMPv2c and SNMPv3 (tests 47, 48, 49), but only
the test with SNMPv1 fails (test 47.30).

I activated a complete logging for the tests (SNMP_VERBOSE=2) because I
wanted to see what comes back from the daemon using different snmp
versions and what is displayed using snmpget.

Here are the results (extracted from the logfile):

47.30:Access ip.ipRoutingDiscards.0 by SNMPv1...
EXECUTING: snmpget -v 1 -c test udp:localhost:8774 ip.ipRoutingDiscards.0

Command Output:
MIBDIR .../net-snmp-5.2.1.2/testing/../mibs
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Error in packet
  Reason: (noSuchName) There is no such variable name in this MIB.
  Failed object: IP-MIB::ipRoutingDiscards.0

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FAIL

48.30:Access ip.ipRoutingDiscards.0 by SNMPv2c...
EXECUTING: snmpget -v 2c -c test udp:localhost:8774 ip.ipRoutingDiscards.0

Command Output:
MIBDIR .../net-snmp-5.2.1.2/testing/../mibs
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  IP-MIB::ipRoutingDiscards.0 = No Such Object available on this agent
at this OID
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PASS

49.30:Access ip.ipRoutingDiscards.0 by SNMPv3...
EXECUTING: snmpget -v 3 -u testrwuser -l authNoPriv -a MD5 -A testpass
udp:localhost:8774 ip.ipRoutingDiscards.0

Command Output:
MIBDIR .../net-snmp-5.2.1.2/testing/../mibs
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  IP-MIB::ipRoutingDiscards.0 = No Such Object available on this agent
at this OID
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PASS

As you see the test fails only for SNMPv1 even though the OID isn't
defined regardless of the snmp protocol version used.

The snmpget command seems to have two problems (or errors):

a) for SNMPv1 snmpget returns an error code 2 when the given OID doesn't
exist, but for SNMPv2c and SNMPv3 snmpget returns an exit code 0 whether
the given OID exists or not

b) the output from snmpget differs between SNMPv1, SNMPv2c and SNMPv3 if
the given OID doesn't exist - for SNMPv1 it prints an appropriate error
message whereas for both other protocols the message looks more like a
normal output with the difference that the value has been replaced by an
error message

Since checking a test for its correctness first uses the command's exit
code, and if it is 0 (ok) it checks whether the given OID is part of the
command's output, the tests for SNMPV2c and SNMPv3 seem to pass the test
although they fail in reality (and should fail in those test I think).

I didn't checked (yet) in the sources but I presume that the second
problem is a follow-up of the first one. If the command would recognize
that the given OID doesn't exist it would exit with an appropriate exit
code and it would show a message saying that the OID doesn't exist
before exiting.

Unfortunately this might mean that passing the net-snmp testsuite for
net-snmp 5.2.x (this is afaik the first version these tests were
introduced) without errors in tests 48 and 49 doesn't mean that those
tests were really ok. Other tests using SNMPv2c or SNMPv3 might be
affected too but I can't say for sure.

Johannes
-- 
Johannes Schmidt-Fischer

InterFace AG                 phone  +49 (0)89 / 610 49 - 207
Leipziger Str. 16            fax    +49 (0)89 / 610 49 - 85
D-82008 Unterhaching         mobile +49 (0)171/ 787 76 01
http://www.InterFace-AG.com  mailto:[EMAIL PROTECTED]


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to