Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cisco ios ping fail #1282

Merged
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 Required RESPONSE_STREAM ([\.\!]+)
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
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:"
22 changes: 22 additions & 0 deletions ntc_templates/templates/cisco_ios_ping_df.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Value Required SENT_QTY (\d+)
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
Value Required SENT_TYPE (.*)
Value Required DESTINATION (\S+)
Value Required TIMEOUT (\d+)
Value SOURCE (\S+)
Value Required 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
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,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
13 changes: 13 additions & 0 deletions tests/cisco_ios/ping/cisco_ios_ping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
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"
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
13 changes: 13 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,13 @@
---
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
13 changes: 13 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,13 @@
---
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
13 changes: 13 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,13 @@
---
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
13 changes: 13 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,13 @@
---
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
13 changes: 13 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,13 @@
---
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
13 changes: 13 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,13 @@
---
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
13 changes: 13 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,13 @@
---
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"