Skip to content

Commit

Permalink
Add template for cisco ios ping (networktocode#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
KeithETruesdell authored and sjhloco committed Feb 2, 2023
1 parent 8314a38 commit c0041b2
Show file tree
Hide file tree
Showing 21 changed files with 199 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ fabric.properties
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
.idea/

### vscode ###
.vscode/*
Expand Down
23 changes: 23 additions & 0 deletions ntc_templates/templates/cisco_ios_ping.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Value Required SENT_QTY (\d+)
Value Required SENT_TYPE (.*)
Value Required DESTINATION (\S+)
Value Required TIMEOUT (\d+)
Value SOURCE (\S+)
Value List RESPONSE_STREAM ([\.\!]+)
Value Required SUCCESS_PCT (\d+)
Value Required SUCCESS_QTY (\d+)
Value RTT_MIN (\d+)
Value RTT_AVG (\d+)
Value RTT_MAX (\d+)


Start
^Type\s+escape\s+sequence\s+to\s+abort.
^Sending\s+${SENT_QTY},\s+${SENT_TYPE}\s+to\s+${DESTINATION},\s+timeout\s+is\s+${TIMEOUT}\s+seconds:
^Packet\s+sent\s+with\s+a\s+source\s+address\s+of\s+${SOURCE}
^Packet\s+sent\s+with\s+the\s+DF\s+bit\s+set
^${RESPONSE_STREAM}
^Success\s+rate\s+is\s+${SUCCESS_PCT}\s+percent\s+\(${SUCCESS_QTY}\/\d+\)(?:,\s+round-trip\s+min/avg/max\s+\=\s+)?(?:${RTT_MIN}/${RTT_AVG}/${RTT_MAX})?(?:\sms)?
^\s*$$
# Error out if raw data does not match any above rules.
^.* -> Error "Could not parse line:"
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ cisco_ios_traceroute.textfsm, .*, cisco_ios, tr[[aceroute]]
cisco_ios_show_boot.textfsm, .*, cisco_ios, sh[[ow]] boot
cisco_ios_show_vlan.textfsm, .*, cisco_ios, sh[[ow]] vlan
cisco_ios_show_vrf.textfsm, .*, cisco_ios, sh[[ow]] vrf
cisco_ios_ping.textfsm, .*, cisco_ios, ping
cisco_ios_dir.textfsm, .*, cisco_ios, dir

cisco_nxos_show_l2rib_internal_permanently-frozen-list.textfsm, .*, cisco_nxos, sh[[ow]] l2ri[[b]] i[[nternal]] pe[[rmanently-frozen-list]]
Expand Down
4 changes: 4 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "5"
sent_type: "100-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: ""
response_stream:
- "!!!!!"
success_pct: "100"
success_qty: "5"
rtt_min: "1"
rtt_avg: "2"
rtt_max: "10"
6 changes: 6 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_200.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Type escape sequence to abort.
Sending 200, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (200/200), round-trip min/avg/max = 1/7/17 ms
16 changes: 16 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_200.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
parsed_sample:
- sent_qty: "200"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: ""
response_stream:
- "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
success_pct: "100"
success_qty: "200"
rtt_min: "1"
rtt_avg: "7"
rtt_max: "17"
5 changes: 5 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_df.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Type escape sequence to abort.
Sending 4, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Packet sent with the DF bit set
!!!!
Success rate is 100 percent (4/4), round-trip min/avg/max = 1/8/17 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_df.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "4"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: ""
response_stream:
- "!!!!"
success_pct: "100"
success_qty: "4"
rtt_min: "1"
rtt_avg: "8"
rtt_max: "17"
5 changes: 5 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_df_fail.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Type escape sequence to abort.
Sending 4, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Packet sent with the DF bit set
....
Success rate is 0 percent (0/4), round-trip min/avg/max = 1/8/17 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_df_fail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "4"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: ""
response_stream:
- "...."
success_pct: "0"
success_qty: "0"
rtt_min: "1"
rtt_avg: "8"
rtt_max: "17"
4 changes: 4 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_fail.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5), round-trip min/avg/max = 1/2/10 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_fail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "5"
sent_type: "100-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: ""
response_stream:
- "....."
success_pct: "0"
success_qty: "0"
rtt_min: "1"
rtt_avg: "2"
rtt_max: "10"
5 changes: 5 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Type escape sequence to abort.
Sending 4, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.0.10
!!!!
Success rate is 100 percent (4/4), round-trip min/avg/max = 1/8/17 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "4"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: "192.168.0.10"
response_stream:
- "!!!!"
success_pct: "100"
success_qty: "4"
rtt_min: "1"
rtt_avg: "8"
rtt_max: "17"
6 changes: 6 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source_df.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Type escape sequence to abort.
Sending 4, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.0.10
Packet sent with the DF bit set
!!!!
Success rate is 100 percent (4/4), round-trip min/avg/max = 1/8/17 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source_df.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "4"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: "192.168.0.10"
response_stream:
- "!!!!"
success_pct: "100"
success_qty: "4"
rtt_min: "1"
rtt_avg: "8"
rtt_max: "17"
6 changes: 6 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source_df_fail.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Type escape sequence to abort.
Sending 4, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.0.10
Packet sent with the DF bit set
....
Success rate is 0 percent (0/4), round-trip min/avg/max = 1/8/17 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source_df_fail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "4"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: "192.168.0.10"
response_stream:
- "...."
success_pct: "0"
success_qty: "0"
rtt_min: "1"
rtt_avg: "8"
rtt_max: "17"
5 changes: 5 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source_fail.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Type escape sequence to abort.
Sending 4, 1500-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.0.10
....
Success rate is 0 percent (0/4), round-trip min/avg/max = 1/8/17 ms
14 changes: 14 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping_source_fail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- sent_qty: "4"
sent_type: "1500-byte ICMP Echos"
destination: "192.168.0.1"
timeout: "2"
source: "192.168.0.10"
response_stream:
- "...."
success_pct: "0"
success_qty: "0"
rtt_min: "1"
rtt_avg: "8"
rtt_max: "17"

0 comments on commit c0041b2

Please sign in to comment.