Menu

#1392 "make test" fails if port 8756/udp and/or 7676/udp are busy

closed
5
2012-11-08
2005-06-30
No

In testing/TESTCONF.sh (5.3.dev) the UDP port to start
snmpd on is hardcoded to

SNMP_SNMPD_PORT="8765"

"make test" will fail miserably if this port is busy on
localhost. It should at least give an appropriate error
message or, better, choose another one until it finds
one that works. This would also allow multiple
invocations of "make test" on the same host.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Some of the test also start a (sub)agent on hardcoded port
    7676 which may suffer the same problem. I recently saw
    problems with "test agents" not terminating properly and
    thus causing subsequent tests to fail -- *without* telling
    the reason for it.

     
  • Robert Story

    Robert Story - 2005-07-07

    Logged In: YES
    user_id=76148

    if you look at the scripts, when netstat is available, it will try 3-5 different ports if the default is in use.

    since tests are supposed to return pass/fail, there's not much we can do. You could change things to have a 'test error' as well. This should be discussed on coders first, if you plan on trying it.

    as for agents/subagents not terminating properly, that is a separate issue, and should have it's own bug report.

     
  • Thomas Anders

    Thomas Anders - 2005-07-25

    Logged In: YES
    user_id=848638

    I've re-opened the bug as I can definitely reproduce the bug
    by starting an unconfigured snmpd on localhost:8765, then
    run make test and it fails with

    1:testing SNMPv1 support...(no pid file(s) found)FAIL
    2:testing SNMPv2c get of system.sysUpTime.0...(no pid
    file(s) found)FAIL
    3:testing SNMPv2c getnext of system.sysUpTime...(no pid
    file(s) found)FAIL
    4:testing SNMPv2 bulkget of system components...(no pid
    file(s) found)FAIL
    ...

    This is with the V5-2-patches CVS branch (as I currently
    can't compile 5.3.dev). You may want to try to see yourself.
    If you can't reproduce, I'll dig into what's different on my
    box.

     
  • Thomas Anders

    Thomas Anders - 2005-07-25

    Logged In: YES
    user_id=848638

    If I start an unconfigured agent on localhost:7676, then
    tests #34, #35 (proxy) fail (5.3.dev):

    foo# snmpd localhost:7676
    foo# make test
    [...]
    34:testing Proxy GET support...FAIL
    35:testing Proxy SET support...FAIL

     
  • Thomas Anders

    Thomas Anders - 2005-07-25

    Logged In: YES
    user_id=848638

    I finally felt curious enough to track this down. The
    problems happens if the port (8765/udp for the main agent,
    7676/udp for the proxy tests) is busy *and* there are
    entries for these ports in /etc/services like here:

    foo# egrep '(8765/udp|7676/udp)' /etc/services
    imqbrokerd 7676/udp # iMQ Broker Rendezvous
    ultraseek-http 8765/udp # Ultraseek HTTP

    The reason is that testing/TESTCONF.sh uses "netstat -a" and
    greps for the numeric port number, however "netstat -a"
    displays the service *name* (as returned by
    getservbyproto(3)) instead. The fix would be to either
    i) use "netstat -a -n" instead, or
    ii) find out the service name and grep for that
    I'd vote for i) if the netstat "-n" option is portable
    enough on the platforms we support. I've verified that for
    Linux (SuSE 9.3), Solaris 9 and Tru64 Unix 5.1B at least.

    Feedback appreciated.

     
  • Thomas Anders

    Thomas Anders - 2005-07-26

    Logged In: YES
    user_id=848638

    Thanks for the bug report! We've fixed the problem in the
    5.1.x and 5.2.x code branches and the main development tree,
    so it should be fixed in future releases of the net-snmp package.

     

Log in to post a comment.