Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / testing / tests / T120proxyget
1 #!/bin/sh
2
3 . ../eval_tools.sh
4
5 HEADER Proxy GET support
6
7 SKIPIFNOT USING_UCD_SNMP_PROXY_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 # config the proxy
17 CONFIGAGENT proxy -t 2 -r 1 -v 2c -c testcommunity udp:localhost:7676 system
18
19 # Start the agent without initializing the system mib.
20 ORIG_AGENT_FLAGS="$AGENT_FLAGS"
21 AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib -Dproxy"
22 STARTAGENT
23
24 # test to see that the current agent doesn't support the system mib
25 #CAPTURE "snmpget -On -t 3 $SNMP_FLAGS -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
26
27 #CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
28
29 #if test "$snmp_last_test_result" = 1; then
30   # test the proxy subagent by first running it...
31
32   SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
33   SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
34   SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
35   SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
36   SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf"
37   echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE
38   AGENT_FLAGS=$ORIG_AGENT_FLAGS
39   ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT
40   SNMP_SNMPD_PORT="7676"
41   STARTAGENT
42   SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT
43
44   # test to see that the agent now supports the system mib
45   CAPTURE "snmpget -On $SNMP_FLAGS -t 5 -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
46
47   CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"
48
49   # stop the subagent
50   STOPAGENT
51
52   SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
53   SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
54 #fi
55
56 # stop the master agent
57 STOPAGENT
58
59 # all done (whew)
60 FINISHED