summaryrefslogtreecommitdiff
path: root/testing/fulltests/default/T121proxyset_simple
diff options
context:
space:
mode:
authorHideki Yamane <henrich@debian.org>2014-03-30 19:38:48 +0900
committerHideki Yamane <henrich@debian.org>2014-03-30 19:38:48 +0900
commit7769a9595c3da9a35f31b42451b1f6c3ed4004fa (patch)
tree009bf8fd68af6bb1129e07dd8c1ed205010d81f8 /testing/fulltests/default/T121proxyset_simple
parent2e7891b0311204e0ecd5dc4a4334df01f3a6a1b4 (diff)
downloadpkg-net-snmp-7769a9595c3da9a35f31b42451b1f6c3ed4004fa.tar.gz
Imported Upstream version 5.7.2~dfsg
Diffstat (limited to 'testing/fulltests/default/T121proxyset_simple')
-rw-r--r--testing/fulltests/default/T121proxyset_simple86
1 files changed, 86 insertions, 0 deletions
diff --git a/testing/fulltests/default/T121proxyset_simple b/testing/fulltests/default/T121proxyset_simple
new file mode 100644
index 0000000..977ddb9
--- /dev/null
+++ b/testing/fulltests/default/T121proxyset_simple
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+. ../support/simple_eval_tools.sh
+
+HEADER Proxy SET support
+
+SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE
+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
+SKIPIF NETSNMP_DISABLE_SNMPV2C
+SKIPIF NETSNMP_DISABLE_SET_SUPPORT
+SKIPIF NETSNMP_NO_WRITE_SUPPORT
+
+# XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does
+[ "x$SNMP_TRANSPORT_SPEC" = "xtcp" -o "x$SNMP_TRANSPORT_SPEC" = "xtcp6" ] && 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} .1.3.6.1.2.1.1
+
+# Start the agent without initializing the system mib.
+ORIG_AGENT_FLAGS="$AGENT_FLAGS"
+AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -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
+ if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
+ echo "rwcommunity6 testcommunity" >> $SNMP_CONFIG_FILE
+ fi
+ echo "psyscontact 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 .1.3.6.1.2.1.1.4.0"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testcontact"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # test to see that the agent now supports the system mib
+ CAPTURE "snmpset -On $SNMP_FLAGS -t 5 $AUTHTESTARGS $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 s testnewcontact"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testnewcontact"
+
+ if test "$snmp_last_test_result" = 1; then
+
+ # 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 .1.3.6.1.2.1.1.4.0"
+
+ CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testnewcontact"
+ fi
+ 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