Skip to content

Commit

Permalink
spytest textfsm template changes-4 (sonic-net#9556)
Browse files Browse the repository at this point in the history
Co-authored-by: Rama Sasthri, Kristipati <[email protected]>
  • Loading branch information
ramakristipati and ramakristipatibrcm authored Aug 21, 2023
1 parent bc60bfd commit d92cedf
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spytest/templates/show_bgp_ipv4_unicast_vrf_dampened_paths.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Value Filldown ROUTER_ID (\d+\.\d+\.\d+\.\d+)
Value Filldown LOCAL_PREF (\d+)
Value Filldown LOCAL_AS (\d+)
Value STATUS_CODE1 (\*|>)
Value STATUS_CODE2 (d|S|s|h)
Value Required NETWORK (\d+\.\d+\.\d+\.\d+/\d+)
Value FROM_NEIGH (\d+\.\d+\.\d+\.\d+)
Value REUSE (\d+:\d+:\d+)
Value PATH (\d+)
Value ORIGIN_CODE (i|e|\?)

Start
^\s*BGP local router ID is ${ROUTER_ID}
^\s*Default local pref ${LOCAL_PREF}, local AS ${LOCAL_AS}
^\s*${STATUS_CODE1}${STATUS_CODE2}\s+${NETWORK}\s+${FROM_NEIGH}\s+${REUSE}\s+${PATH}\s+${ORIGIN_CODE} -> Continue.Record
8 changes: 8 additions & 0 deletions spytest/templates/show_bgp_nexthop.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Value ip_addr (\S+)
Value metric (\d+)
Value paths (\d+)
Value peers ([-()\w/. ]+)


Start
^\s*${ip_addr}\s+valid\s+\[IGP metric ${metric}\],\s+#paths\s+${paths},\s+peer\s+${peers}\s*$$ -> Record
16 changes: 16 additions & 0 deletions spytest/templates/show_interface_counters_rif.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Value IFACE ([\w./]+)
Value RX_OK ([\d\.\,]+|N/A)
Value RX_BPS (\S+(\s\S+)?|N/A)
Value RX_ERR ([\d\.]+|N/A)
Value RX_PPS (\S+(\s\S+)?|N/A)
Value TX_OK ([\d\.\,]+|N/A)
Value TX_BPS (\S+(\s\S+)?|N/A)
Value TX_ERR ([\d\.]+|N/A)
Value TX_PPS (\S+(\s\S+)?|N/A)
Value Polling_interval (\d+)

Start
^\s*Polling\s*Rate\s*\:\s*${Polling_interval}.*\s*$$
^\s*${IFACE}\s+${RX_OK}\s+${RX_BPS}\s+${RX_PPS}\s+${RX_ERR}\s+${TX_OK}\s+${TX_BPS}\s+${TX_PPS}\s+${TX_ERR}\s*$$ -> Record

EOF
19 changes: 19 additions & 0 deletions spytest/templates/show_lldp_statistics.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Value interface (\S+)
Value transmitted (\d+)
Value received (\d+)
Value discarded (\d+)
Value unrecognized (\d+)
Value ageout (\d+)
Value inserted (\d+)
Value deleted (\d+)

Start
^\s*Interface\s*\:\s*${interface}\s*$$
^\s*Transmitted\s*\:\s*${transmitted}\s*$$
^\s*Received\s*\:\s*${received}\s*$$
^\s*Discarded\s*\:\s*${discarded}\s*$$
^\s*Unrecognized\s*\:\s*${unrecognized}\s*$$
^\s*Unrecognized\s*[TLV]*\s*\:\s*${unrecognized}\s*$$
^\s*Ageout\s*\:\s*${ageout}\s*$$
^\s*Inserted\s*\:\s*${inserted}\s*$$
^\s*Deleted\s*\:\s*${deleted}\s*$$ -> Record
6 changes: 6 additions & 0 deletions spytest/templates/show_system_reserved_vlan.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Value vlan_range (\S+)

Start
^\s*system vlan reservation:\s*${vlan_range}\s*$$ -> Record

EOF

0 comments on commit d92cedf

Please sign in to comment.