Debian Codegraph @

testing/fulltests/default/T124proxywalkself_simple

raw
1 #!/bin/sh
2
3 . ../support/simple_eval_tools.sh
4
5 HEADER Proxy GETNEXT support: walk when proxying to self
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 OID=.1.3.6.1.4.1.8072.42
19
20 # standard v2c configuration
21 . ./Sv2cconfig
22 # config the proxy to proxy to itself
23 CONFIGAGENT proxy -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $OID .1.3.6.1.2.1.1
24
25 # Start the agent with proxy debugging
26 ORIG_AGENT_FLAGS="$AGENT_FLAGS"
27 AGENT_FLAGS="$ORIG_AGENT_FLAGS -Dproxy"
28 STARTAGENT
29
30 # Check that we get a string from the proxied sysObjectID
31 CAPTURE "snmpgetnext -On $SNMP_FLAGS -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $OID"
32
33 # TODO: can we compare with the real sysDescr?
34 CHECK "${OID}.1.0 = STRING: "
35
36 # Check that we can walk without a non-increasing error
37 CAPTURE "snmpwalk -On $SNMP_FLAGS -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $OID"
38
39 CHECKANDDIE "Error: OID not increasing"
40 CHECKCOUNT atleastone "^${OID}"
41
42 # Also check the same for a table underneath the proxy OID itself
43 # using the sysORTable
44 CAPTURE "snmpwalk -On $SNMP_FLAGS -v 2c -c testcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT ${OID}.9"
45
46 CHECKANDDIE "Error: OID not increasing"
47 CHECKCOUNT atleastone "^${OID}.9."
48
49
50 # stop the agent
51 STOPAGENT
52
53 # all done (whew)
54 FINISHED