| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
. ../support/simple_eval_tools.sh |
| 4 |
|
| 5 |
HEADER SNMPv2 vacm denial support |
| 6 |
|
| 7 |
SKIPIF NETSNMP_DISABLE_SNMPV2C |
| 8 |
SKIPIF NETSNMP_DISABLE_SET_SUPPORT |
| 9 |
SKIPIF NETSNMP_NO_WRITE_SUPPORT |
| 10 |
SKIPIFNOT USING_MIBII_VACM_CONF_MODULE |
| 11 |
|
| 12 |
# |
| 13 |
# Begin test |
| 14 |
# |
| 15 |
|
| 16 |
|
| 17 |
# standard V1 configuration: testcommunity1 testcommunity2 |
| 18 |
# testcommunity1 can access .1.3.6.1.2.1.1.1, others are denied |
| 19 |
# testcommunity2 can access all except .1.3.6.1.2.1.1.1 |
| 20 |
# This case test for denied access |
| 21 |
|
| 22 |
snmp_version=v2c |
| 23 |
. ./Svacmconfig |
| 24 |
|
| 25 |
STARTAGENT |
| 26 |
|
| 27 |
|
| 28 |
CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity1 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0" |
| 29 |
CHECKORDIE ".1.3.6.1.2.1.1.3.0 = No Such Object available on this agent at this OID" |
| 30 |
|
| 31 |
CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity2 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.1.0" |
| 32 |
CHECKORDIE ".1.3.6.1.2.1.1.1.0 = No Such Object available on this agent at this OID" |
| 33 |
|
| 34 |
CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity1 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy" |
| 35 |
CHECKORDIE "Reason: noAccess" |
| 36 |
|
| 37 |
CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity2 -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy" |
| 38 |
CHECKORDIE "Reason: noAccess" |
| 39 |
|
| 40 |
CAPTURE "snmpset -On $SNMP_FLAGS -c testrwcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy" |
| 41 |
CHECKORDIE ".1.3.6.1.2.1.1.5.0 = STRING: \"*dummy" |
| 42 |
|
| 43 |
CAPTURE "snmpset -On $SNMP_FLAGS -c testrocommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.5.0 s dummy" |
| 44 |
CHECKORDIE "Reason: noAccess" |
| 45 |
|
| 46 |
STOPAGENT |
| 47 |
|
| 48 |
FINISHED |