#!/bin/sh . ../eval_tools.sh HEADER AgentX illegal SET handling support SKIPIFNOT USING_AGENTX_MODULE SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE # # Begin test # # standard V3 configuration for initial user . ./Sv3config # Start the agent without initializing the system mib. ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket" AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib -DAgentX" STARTAGENT # test to see that the current agent doesn't support the system mib CAPTURE "snmpget -t 3 $SNMP_FLAGS -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial -n xxx localhost system.sysContact.0" CHECK "system.sysContact.0 = No Such Object" if test "$snmp_last_test_result" = 1; then # test the AgentX 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 AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I system_mib" SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf" echo "syscontact testcontact" >> $SNMP_CONFIG_FILE STARTAGENT # test to see that the agent now supports the system mib CAPTURE "snmpget $SNMP_FLAGS -t 5 -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial -n xxx localhost sysContact.0" CHECK "system.sysContact.0 = testcontact" if test "$snmp_last_test_result" = 1; then # test to see that the agent now supports setting the system mib CAPTURE "snmpset -Ir $SNMP_FLAGS -t 5 -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial -n xxx localhost sysContact.0 i 4" CHECK "wrongType" 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