| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
. ../support/simple_eval_tools.sh |
| 4 |
|
| 5 |
HEADER Proxy GET support |
| 6 |
|
| 7 |
SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE |
| 8 |
SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE |
| 9 |
SKIPIF NETSNMP_DISABLE_SNMPV2C |
| 10 |
|
| 11 |
# XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does |
| 12 |
[ "x$SNMP_TRANSPORT_SPEC" = "xtcp" -o "x$SNMP_TRANSPORT_SPEC" = "xtcp6" ] && SKIP Test does not support TCP |
| 13 |
|
| 14 |
# |
| 15 |
# Begin test |
| 16 |
# |
| 17 |
|
| 18 |
# standard V3 configuration for initial user |
| 19 |
. ./Sv3config |
| 20 |
# config the proxy |
| 21 |
CONFIGAGENT proxy -t 2 -r 1 -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT} .1.3.6.1.2.1.1 |
| 22 |
|
| 23 |
# Start the agent without initializing the system mib. |
| 24 |
ORIG_AGENT_FLAGS="$AGENT_FLAGS" |
| 25 |
AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -Dproxy" |
| 26 |
STARTAGENT |
| 27 |
|
| 28 |
# test to see that the current agent doesn't support the system mib |
| 29 |
#CAPTURE "snmpget -On -t 3 $SNMP_FLAGS $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0" |
| 30 |
|
| 31 |
#CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object" |
| 32 |
|
| 33 |
#if test "$snmp_last_test_result" = 1; then |
| 34 |
# test the proxy subagent by first running it... |
| 35 |
|
| 36 |
SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE |
| 37 |
SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE |
| 38 |
SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2 |
| 39 |
SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2 |
| 40 |
SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf" |
| 41 |
echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE |
| 42 |
if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then |
| 43 |
echo "rwcommunity6 testcommunity" >> $SNMP_CONFIG_FILE |
| 44 |
fi |
| 45 |
AGENT_FLAGS=$ORIG_AGENT_FLAGS |
| 46 |
ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT |
| 47 |
SNMP_SNMPD_PORT="${SNMP_AGENTX_PORT}" |
| 48 |
STARTAGENT |
| 49 |
SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT |
| 50 |
|
| 51 |
# test to see that the agent now supports the system mib |
| 52 |
CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0" |
| 53 |
|
| 54 |
CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:" |
| 55 |
|
| 56 |
# stop the subagent |
| 57 |
STOPAGENT |
| 58 |
|
| 59 |
SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG |
| 60 |
SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG |
| 61 |
#fi |
| 62 |
|
| 63 |
# stop the master agent |
| 64 |
STOPAGENT |
| 65 |
|
| 66 |
# all done (whew) |
| 67 |
FINISHED |