blob: f1a057bd9f467abe30a6ef64ab763d22d598b0d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
#!/bin/sh
. ../eval_tools.sh
HEADER Proxy illegal SET handling support
SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE
SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
SKIPIF NETSNMP_DISABLE_SNMPV2C
# XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does
[ "x$SNMP_TRANSPORT_SPEC" = "xtcp" ] && SKIP
#
# Begin test
#
# standard V3 configuration for initial user
. ./Sv3config
# config the proxy
CONFIGAGENT proxy -t 2 -r 1 -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:${SNMP_TEST_DEST}${SNMP_AGENTX_PORT} system
# Start the agent without initializing the system mib.
ORIG_AGENT_FLAGS="$AGENT_FLAGS"
AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib -Dproxy"
STARTAGENT
# test to see that the current agent doesn't support the system mib
#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"
#CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
#if test "$snmp_last_test_result" = 1; then
# test the proxy subagent by first running it...
SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf"
echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE
# echo "syscontact testcontact" >> $SNMP_CONFIG_FILE
AGENT_FLAGS="$ORIG_AGENT_FLAGS -Dmib_init"
ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT
SNMP_SNMPD_PORT="${SNMP_AGENTX_PORT}"
STARTAGENT
SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT
# test to see that the agent now supports the system mib
CAPTURE "snmpget -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT sysContact.0"
# we don't know the real value, unfortunately, so we test for what
# we should *not* get back.
CHECK ".1.3.6.1.2.1.1.4.0 = No Such Object"
if test "$snmp_last_test_result" = 0; then
# test to see that the agent now supports the system mib
CAPTURE "snmpset -On -Ir $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT sysContact.0 i 42"
# 5.0.x snmpset shows error on single line
#CHECK ".1.3.6.1.2.1.1.4.0 = Wrong Type"
# 5.1.x snmpset shows error on multiple lines
CHECK "Reason: wrongType"
CHECK "Failed object: .1.3.6.1.2.1.1.4.0"
fi
# stop the subagent
STOPAGENT
SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
#fi
# stop the master agent
STOPAGENT
# all done (whew)
FINISHED
|