~ubuntu-branches/ubuntu/gutsy/net-snmp/gutsy-security

« back to all changes in this revision

Viewing changes to testing/tests/T110agentxget

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
. ../eval_tools.sh
 
4
 
 
5
HEADER AgentX GET support
 
6
 
 
7
SKIPIFNOT USING_AGENTX_MODULE
 
8
SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
 
9
 
 
10
#
 
11
# Begin test
 
12
#
 
13
 
 
14
# standard V3 configuration for initial user
 
15
. ./Sv3config
 
16
 
 
17
# Start the agent without initializing the system mib.
 
18
ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"
 
19
AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib"
 
20
STARTAGENT
 
21
 
 
22
# test to see that the current agent doesn't support the system mib
 
23
CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
 
24
 
 
25
CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
 
26
 
 
27
if test "$snmp_last_test_result" = 1; then
 
28
  # test the agentx subagent by first running it...
 
29
 
 
30
  SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
 
31
  SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
 
32
  SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
 
33
  SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
 
34
  AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I system_mib"
 
35
  SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf"
 
36
  STARTAGENT
 
37
 
 
38
  # test to see that the agent now supports setting the system mib
 
39
  CAPTURE "snmpget -On $SNMP_FLAGS -t 3 -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
 
40
 
 
41
  CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
 
42
 
 
43
  # stop the subagent
 
44
  STOPAGENT
 
45
 
 
46
  SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
 
47
  SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
 
48
fi
 
49
 
 
50
# stop the master agent
 
51
STOPAGENT
 
52
 
 
53
# all done (whew)
 
54
FINISHED