From 6cff3556b9a06cac8d002bdd3868771710656cd7 Mon Sep 17 00:00:00 2001 From: yone2ks Date: Tue, 2 Jul 2024 00:07:03 +0900 Subject: [PATCH 1/4] fixed for old viptela os --- ntc_templates/templates/cisco_viptela_show_arp.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntc_templates/templates/cisco_viptela_show_arp.textfsm b/ntc_templates/templates/cisco_viptela_show_arp.textfsm index 5194a16fa0..b01b4ff45f 100644 --- a/ntc_templates/templates/cisco_viptela_show_arp.textfsm +++ b/ntc_templates/templates/cisco_viptela_show_arp.textfsm @@ -8,7 +8,7 @@ Value UPTIME (\S+) Start ^\s*IF - ^\s*VPN\s+NAME\s+IP\s+MAC\s+STATE\s+IDLE\s+TIMER\s+UPTIME + ^\s*VPN\s+(IF)?\s*NAME\s+IP\s+MAC\s+STATE\s+IDLE\s+TIMER\s+UPTIME ^-+ ^\s*${VPN}\s+${NAME}\s+${IP_ADDRESS}\s+${MAC_ADDRESS}\s+${STATE}\s+${IDLE_TIMER}\s+${UPTIME} -> Record ^. -> Error \ No newline at end of file From d0ee585a9f1014acac595d7fb568301380b4b292 Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 22 Jul 2024 20:32:59 -0400 Subject: [PATCH 2/4] Add test case --- .../show_arp/cisco_viptela_show_arp-old.raw | 3 +++ .../show_arp/cisco_viptela_show_arp-old.yml | 9 +++++++++ tests/cisco_viptela/show_arp/cisco_viptela_show_arp.raw | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.raw create mode 100644 tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.yml diff --git a/tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.raw b/tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.raw new file mode 100644 index 0000000000..90e15745ae --- /dev/null +++ b/tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.raw @@ -0,0 +1,3 @@ +VPN IF NAME IP MAC STATE IDLE TIMER UPTIME +----------------------------------------------------------------------------- +0 eth0 10.10.20.70 00:50:56:bf:a0:d3 dynamic 0:00:11:33 0:00:08:28 diff --git a/tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.yml b/tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.yml new file mode 100644 index 0000000000..46a13c7219 --- /dev/null +++ b/tests/cisco_viptela/show_arp/cisco_viptela_show_arp-old.yml @@ -0,0 +1,9 @@ +--- +parsed_sample: + - vpn: "0" + name: "eth0" + ip_address: "10.10.20.70" + mac_address: "00:50:56:bf:a0:d3" + state: "dynamic" + uptime: "0:00:08:28" + idle_timer: "0:00:11:33" diff --git a/tests/cisco_viptela/show_arp/cisco_viptela_show_arp.raw b/tests/cisco_viptela/show_arp/cisco_viptela_show_arp.raw index f6757995cc..969919adc6 100644 --- a/tests/cisco_viptela/show_arp/cisco_viptela_show_arp.raw +++ b/tests/cisco_viptela/show_arp/cisco_viptela_show_arp.raw @@ -8,4 +8,4 @@ VPN NAME IP MAC STATE IDLE TIMER UPTIME 0 eth0 10.10.20.173 00:00:00:00:00:00 dynamic 0:00:01:11 0:00:18:49 0 eth0 10.10.20.178 52:54:00:17:8e:2a dynamic 0:00:19:59 0:00:39:46 0 eth0 10.10.20.181 52:54:00:03:cb:4c dynamic 0:00:13:39 0:00:06:22 -0 eth0 10.10.20.254 00:50:56:bf:6e:98 dynamic 0:00:11:44 0:00:08:17 \ No newline at end of file +0 eth0 10.10.20.254 00:50:56:bf:6e:98 dynamic 0:00:11:44 0:00:08:17 From 15e808ac666e5c42e2cd563f818c826833262a4d Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Mon, 22 Jul 2024 20:36:01 -0400 Subject: [PATCH 3/4] Update ntc_templates/templates/cisco_viptela_show_arp.textfsm --- ntc_templates/templates/cisco_viptela_show_arp.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntc_templates/templates/cisco_viptela_show_arp.textfsm b/ntc_templates/templates/cisco_viptela_show_arp.textfsm index b01b4ff45f..d12ef3c378 100644 --- a/ntc_templates/templates/cisco_viptela_show_arp.textfsm +++ b/ntc_templates/templates/cisco_viptela_show_arp.textfsm @@ -11,4 +11,4 @@ Start ^\s*VPN\s+(IF)?\s*NAME\s+IP\s+MAC\s+STATE\s+IDLE\s+TIMER\s+UPTIME ^-+ ^\s*${VPN}\s+${NAME}\s+${IP_ADDRESS}\s+${MAC_ADDRESS}\s+${STATE}\s+${IDLE_TIMER}\s+${UPTIME} -> Record - ^. -> Error \ No newline at end of file + ^. -> Error From 84f10a8e93db96a5d8d3e0653c86b7fa50ac18a4 Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Mon, 22 Jul 2024 20:36:52 -0400 Subject: [PATCH 4/4] Apply suggestions from code review --- ntc_templates/templates/cisco_viptela_show_arp.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntc_templates/templates/cisco_viptela_show_arp.textfsm b/ntc_templates/templates/cisco_viptela_show_arp.textfsm index d12ef3c378..e243a33004 100644 --- a/ntc_templates/templates/cisco_viptela_show_arp.textfsm +++ b/ntc_templates/templates/cisco_viptela_show_arp.textfsm @@ -8,7 +8,7 @@ Value UPTIME (\S+) Start ^\s*IF - ^\s*VPN\s+(IF)?\s*NAME\s+IP\s+MAC\s+STATE\s+IDLE\s+TIMER\s+UPTIME + ^\s*VPN\s+(IF\s+)?NAME\s+IP\s+MAC\s+STATE\s+IDLE\s+TIMER\s+UPTIME ^-+ ^\s*${VPN}\s+${NAME}\s+${IP_ADDRESS}\s+${MAC_ADDRESS}\s+${STATE}\s+${IDLE_TIMER}\s+${UPTIME} -> Record ^. -> Error