| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | . ../support/simple_eval_tools.shscip-shell source . . `../support/simple_eval_tools.sh`. |
| 4 | |
| 5 | HEADER DISMAN EXPRESSION MIB |
| 6 | |
| 7 | ISDEFINED USING_DISMAN_EXPRESSION_EXPEXPRESSIONTABLE_MODULE || |
| 8 | ISDEFINED USING_DISMAN_EXPRESSION_MODULE || |
| 9 | SKIP "DISMAN EXPRESSION MIB is not available" |
| 10 | |
| 11 | # SNMPv2-TC |
| 12 | active=1 |
| 13 | createAndWait=5 |
| 14 | destroy=6 |
| 15 | # Test configuration |
| 16 | # expExpressionOwner and expExpressionName |
| 17 | on='"foo"."bar"' |
| 18 | |
| 19 | # |
| 20 | # Begin test |
| 21 | # |
| 22 | |
| 23 | # standard V3 configuration |
| 24 | snmp_write_access='all' |
| 25 | . ./Sv3configscip-shell source . . `./Sv3config`. |
| 26 | |
| 27 | CONFIGAGENT "createUser internal" |
| 28 | CONFIGAGENT "iquerySecName internal" |
| 29 | CONFIGAGENT "rouser internal" |
| 30 | |
| 31 | AGENT_FLAGS="$AGENT_FLAGS -DexpValueTable -Ddisman:expr:run" |
| 32 | |
| 33 | STARTAGENT |
| 34 | |
| 35 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset().() { |
| 36 | CAPTURE "snmpset $SNMP_FLAGS $NOAUTHTESTARGS \ |
| 37 | $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $*" |
| 38 | } |
| 39 | |
| 40 | capture_snmpgetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpget().() { |
| 41 | CAPTURE "snmpget $SNMP_FLAGS $NOAUTHTESTARGS \ |
| 42 | $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $*" |
| 43 | } |
| 44 | |
| 45 | capture_snmpwalkscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpwalk().() { |
| 46 | CAPTURE "snmpwalk $SNMP_FLAGS $NOAUTHTESTARGS \ |
| 47 | $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT $*" |
| 48 | } |
| 49 | |
| 50 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expExpressionEntryStatus."${on}" \ |
| 51 | i $destroy |
| 52 | CHECK "^DISMAN-EXPRESSION-MIB::expExpressionEntryStatus.${on} = INTEGER: destroy(6)" |
| 53 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expExpressionEntryStatus."${on}" \ |
| 54 | i $createAndWait |
| 55 | CHECK "^DISMAN-EXPRESSION-MIB::expExpressionEntryStatus.${on} = INTEGER: createAndWait(5)" |
| 56 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expExpression."${on}" \ |
| 57 | = '$1+$2*($1+$2*($1+$2))' |
| 58 | CHECK "^DISMAN-EXPRESSION-MIB::expExpression.${on} = STRING: " |
| 59 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expExpressionValueType."${on}" \ |
| 60 | = counter32 |
| 61 | CHECK "^DISMAN-EXPRESSION-MIB::expExpressionValueType.${on} = INTEGER: counter32(1)" |
| 62 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expExpressionEntryStatus."${on}" \ |
| 63 | i $active |
| 64 | CHECK "^DISMAN-EXPRESSION-MIB::expExpressionEntryStatus.${on} = INTEGER: active(1)" |
| 65 | |
| 66 | i=1 |
| 67 | for e in IF-MIB::ifIndex.1 IF-MIB::ifIndex.2; do |
| 68 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expObjectEntryStatus."${on}".$i \ |
| 69 | i $destroy |
| 70 | CHECK "^DISMAN-EXPRESSION-MIB::expObjectEntryStatus.${on}.$i = INTEGER: destroy(6)" |
| 71 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expObjectEntryStatus."${on}".$i \ |
| 72 | = createAndWait |
| 73 | CHECK "^DISMAN-EXPRESSION-MIB::expObjectEntryStatus.${on}.$i = INTEGER: createAndWait(5)" |
| 74 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expObjectID."${on}".$i \ |
| 75 | = $e |
| 76 | CHECK "^DISMAN-EXPRESSION-MIB::expObjectID.${on}.$i = OID: $e" |
| 77 | capture_snmpsetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpset(). DISMAN-EXPRESSION-MIB::expObjectEntryStatus."${on}".$i \ |
| 78 | i $active |
| 79 | CHECK "^DISMAN-EXPRESSION-MIB::expObjectEntryStatus.${on}.$i = INTEGER: active(1)" |
| 80 | i=`exprscip-shell system . . expr. $i + 1` |
| 81 | done |
| 82 | |
| 83 | capture_snmpgetscip-shell shell net-snmp 5.9.5.2+dfsg-2.1 capture_snmpget(). DISMAN-EXPRESSION-MIB::expValueCounter32Val."${on}".0.0.0 |
| 84 | |
| 85 | CHECK "^DISMAN-EXPRESSION-MIB::expValueCounter32Val.${on}.0.0.0 = Counter32: 15" |
| 86 | |
| 87 | STOPAGENT |
| 88 | |
| 89 | FINISHED |