Debian Codegraph @

testing/fulltests/default/T121proxyset_simple

raw
1 #!/bin/sh
2
3 . ../support/simple_eval_tools.sh
4
5 HEADER Proxy SET support
6
7 SKIPIFNOT USING_UCD_SNMP_PROXY_MODULE
8 SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE
9 SKIPIF NETSNMP_DISABLE_SNMPV2C
10 SKIPIF NETSNMP_DISABLE_SET_SUPPORT
11 SKIPIF NETSNMP_NO_WRITE_SUPPORT
12
13 # XXX: ucd-snmp/proxy doesn't properly support TCP -- remove this once it does
14 [ "x$SNMP_TRANSPORT_SPEC" = "xtcp" -o "x$SNMP_TRANSPORT_SPEC" = "xtcp6" ] && SKIP Test does not support TCP
15
16 #
17 # Begin test
18 #
19
20 # standard V3 configuration for initial user
21 . ./Sv3config
22 # config the proxy
23 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
24
25 # Start the agent without initializing the system mib.
26 ORIG_AGENT_FLAGS="$AGENT_FLAGS"
27 AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib,winExtDLL -Dproxy"
28 STARTAGENT
29
30 # test to see that the current agent doesn't support the system mib
31 #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"
32
33 #CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"
34
35 #if test "$snmp_last_test_result" = 1; then
36 # test the proxy subagent by first running it...
37
38 SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE
39 SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE
40 SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2
41 SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2
42 SNMP_CONFIG_FILE="$SNMP_TMPDIR/proxy.conf"
43 echo "rwcommunity testcommunity" >> $SNMP_CONFIG_FILE
44 if [ "$SNMP_TRANSPORT_SPEC" = "udp6" -o "$SNMP_TRANSPORT_SPEC" = "tcp6" ];then
45 echo "rwcommunity6 testcommunity" >> $SNMP_CONFIG_FILE
46 fi
47 echo "psyscontact testcontact" >> $SNMP_CONFIG_FILE
48 AGENT_FLAGS="$ORIG_AGENT_FLAGS -Dmib_init"
49 ORIG_SNMP_SNMPD_PORT=$SNMP_SNMPD_PORT
50 SNMP_SNMPD_PORT="${SNMP_AGENTX_PORT}"
51 STARTAGENT
52 SNMP_SNMPD_PORT=$ORIG_SNMP_SNMPD_PORT
53
54 # test to see that the agent now supports the system mib
55 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"
56
57 CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testcontact"
58
59 if test "$snmp_last_test_result" = 1; then
60
61 # test to see that the agent now supports the system mib
62 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"
63
64 CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testnewcontact"
65
66 if test "$snmp_last_test_result" = 1; then
67
68 # test to see that the agent now supports the system mib
69 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"
70
71 CHECK ".1.3.6.1.2.1.1.4.0 = STRING: \"*testnewcontact"
72 fi
73 fi
74
75 # stop the subagent
76 STOPAGENT
77
78 SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG
79 SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIG
80 #fi
81
82 # stop the master agent
83 STOPAGENT
84
85 # all done (whew)
86 FINISHED