Verify all table elements for system MIB tests.

This commit is contained in:
Kristofer Hallin 2022-05-29 14:55:57 +02:00
parent 9b42d00219
commit 25e92bf15d

View file

@ -64,21 +64,21 @@ cat <<EOF > $fstate
<sysContact>clixon@clicon.com</sysContact> <sysContact>clixon@clicon.com</sysContact>
<sysLocation>Clixon HQ</sysLocation> <sysLocation>Clixon HQ</sysLocation>
<sysDescr>System description</sysDescr> <sysDescr>System description</sysDescr>
<!-- <sysUpTime>0</sysUpTime> --> <sysUpTime>11223344</sysUpTime>
<sysServices>72</sysServices> <sysServices>72</sysServices>
</system> </system>
<sysORTable> <sysORTable>
<sysOREntry> <sysOREntry>
<sysORIndex>1</sysORIndex> <sysORIndex>1</sysORIndex>
<!-- <sysORID>IP-MIB::ip</sysORID> --> <sysORID>IP-MIB::ip</sysORID>
<sysORDescr>Entry 1 description</sysORDescr> <sysORDescr>Entry 1 description</sysORDescr>
<!-- <sysORUpTime>0</sysORUpTime> --> <sysORUpTime>11223344</sysORUpTime>
</sysOREntry> </sysOREntry>
<sysOREntry> <sysOREntry>
<sysORIndex>2</sysORIndex> <sysORIndex>2</sysORIndex>
<!-- <sysORID>IF-MIB:if</sysORID> --> <sysORID>IF-MIB:ifTable</sysORID>
<sysORDescr>Entry 2 description</sysORDescr> <sysORDescr>Entry 2 description</sysORDescr>
<!-- <sysORUpTime>0</sysORUpTime> --> <sysORUpTime>1122111111</sysORUpTime>
</sysOREntry> </sysOREntry>
</sysORTable> </sysORTable>
</SNMPv2-MIB> </SNMPv2-MIB>
@ -125,6 +125,7 @@ testinit
OID_SYS=".1.3.6.1.2.1.1" OID_SYS=".1.3.6.1.2.1.1"
OID_DESCR=".1.3.6.1.2.1.1.1" OID_DESCR=".1.3.6.1.2.1.1.1"
OID_UPTIME=".1.3.6.1.2.1.1.3"
OID_CONTACT=".1.3.6.1.2.1.1.4" OID_CONTACT=".1.3.6.1.2.1.1.4"
OID_LOCATION=".1.3.6.1.2.1.1.6" OID_LOCATION=".1.3.6.1.2.1.1.6"
OID_SYSNAME=".1.3.6.1.2.1.1.5" OID_SYSNAME=".1.3.6.1.2.1.1.5"
@ -140,7 +141,7 @@ new "Get description, $OID_DESCR"
expectpart "$($snmpget $OID_DESCR)" 0 "$OID_DESCR = STRING: System description" expectpart "$($snmpget $OID_DESCR)" 0 "$OID_DESCR = STRING: System description"
new "Get next $OID_DESCR" new "Get next $OID_DESCR"
expectpart "$($snmpgetnext $OID_DESCR)" 0 "$OID_CONTACT = STRING: clixon@clicon.com" expectpart "$($snmpgetnext $OID_DESCR)" 0 "$OID_UPTIME = Timeticks: (11223344) 1 day, 7:10:33.44"
new "Get contact, $OID_CONTACT" new "Get contact, $OID_CONTACT"
expectpart "$($snmpget $OID_CONTACT)" 0 "$OID_CONTACT = STRING: clixon@clicon.com" expectpart "$($snmpget $OID_CONTACT)" 0 "$OID_CONTACT = STRING: clixon@clicon.com"
@ -182,8 +183,8 @@ new "Get sysORTable, entry 2 $OID_ORTABLE2"
expectpart "$($snmpget $OID_ORTABLE2)" 0 "STRING: Entry 2 description" expectpart "$($snmpget $OID_ORTABLE2)" 0 "STRING: Entry 2 description"
new "Get table sysORTable $OID_ORTABLE" new "Get table sysORTable $OID_ORTABLE"
expectpart "$($snmptable $OID_ORTABLE)" 0 ".*Entry 1 description.*" expectpart "$($snmptable $OID_ORTABLE)" 0 ".*Entry 1 description.*" "IP-MIB::ip" "1:7:10:33.44"
expectpart "$($snmptable $OID_ORTABLE)" 0 ".*Entry 2 description.*" expectpart "$($snmptable $OID_ORTABLE)" 0 ".*Entry 2 description.*" "IF-MIB::ifTable" "129:20:58:31.11"
new "Cleaning up" new "Cleaning up"
testexit testexit