From f1f167876790f9f2a16898d74cc5a32300e8798d Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Wed, 30 Oct 2019 10:45:09 -0400 Subject: [PATCH] New Template - EOS - show vrf (#524) --- templates/arista_eos_show_vrf.template | 20 +++++++++++++++++++ templates/index | 1 + .../show_vrf/arista_eos_show_vrf.parsed | 12 +++++++++++ .../show_vrf/arista_eos_show_vrf.raw | 14 +++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 templates/arista_eos_show_vrf.template create mode 100644 tests/arista_eos/show_vrf/arista_eos_show_vrf.parsed create mode 100644 tests/arista_eos/show_vrf/arista_eos_show_vrf.raw diff --git a/templates/arista_eos_show_vrf.template b/templates/arista_eos_show_vrf.template new file mode 100644 index 0000000000..651f617103 --- /dev/null +++ b/templates/arista_eos_show_vrf.template @@ -0,0 +1,20 @@ +Value VRF (\S+) +Value RD (\d\S+|<.+>) + +Start + ^\s+Vrf\s+RD\s+Protocols\s+State\s+Interfaces -> VRF + ^Maximum + ^\s*$$ + ^. -> Error + +VRF + ^\s+${VRF}\s+${RD} -> Record + # Match second line with Status e.x. v6:routing + ^\s+\S+:\S+ + # Match multiline interface with last line having a single interface + ^\s+\S+\s*$$ + # Match multilin interface with multiple interfaces on the line + ^(?:\s+\S+?,){1,5}(?:\s+\S+)?\s*$$ + ^\s*-+\s+-+ + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index 07e5174926..863cbf98c6 100644 --- a/templates/index +++ b/templates/index @@ -51,6 +51,7 @@ arista_eos_show_clock.template, .*, arista_eos, sh[[ow]] clo[[ck]] arista_eos_dir_flash.template, .*, arista_eos, dir fl[[ash:]] arista_eos_show_mlag.template, .*, arista_eos, sh[[ow]] ml[[ag]] arista_eos_show_vlan.template, .*, arista_eos, sh[[ow]] vl[[an]] +arista_eos_show_vrf.template, .*, arista_eos, sh[[ow]] vrf aruba_os_show_ipv6_interface_brief.template, .*, aruba_os, sh[[ow]] ipv6 in[[terface]] b[[rief]] aruba_os_show_ip_interface_brief.template, .*, aruba_os, sh[[ow]] ip in[[terface]] b[[rief]] diff --git a/tests/arista_eos/show_vrf/arista_eos_show_vrf.parsed b/tests/arista_eos/show_vrf/arista_eos_show_vrf.parsed new file mode 100644 index 0000000000..867a881a76 --- /dev/null +++ b/tests/arista_eos/show_vrf/arista_eos_show_vrf.parsed @@ -0,0 +1,12 @@ +--- +parsed_sample: + - vrf: "blue" + rd: "10.125.253.15:1" + - vrf: "green" + rd: "" + - vrf: "yellow" + rd: '10.125.253.15:4' + - vrf: "red" + rd: "10.125.253.15:6" + - vrf: "black" + rd: "999:999" diff --git a/tests/arista_eos/show_vrf/arista_eos_show_vrf.raw b/tests/arista_eos/show_vrf/arista_eos_show_vrf.raw new file mode 100644 index 0000000000..f28c1e394f --- /dev/null +++ b/tests/arista_eos/show_vrf/arista_eos_show_vrf.raw @@ -0,0 +1,14 @@ + Vrf RD Protocols State Interfaces +--------- -------- --------------- ----------- ---------- + blue 10.125.253.15:1 ipv4,ipv6 v4:routing, Vlan1006, Vlan2230, Vlan2231, + v6:no routing Vlan2232, Vlan2233, Vlan2234, + Vlan2235, Vlan2236, Vlan2237, + Vlan2238, Vlan2239, Vlan2240 + green ipv4,ipv6 v4:routing, Vlan1015, Vlan1016, Vlan1017, + v6:no routing Vlan1018, Vlan1019, Vlan1020, + Vlan1021 + yellow 10.125.253.15:4 ipv4,ipv6 v4:routing, Vlan1009 + v6:no routing + red 10.125.253.15:6 ipv4,ipv6 v4:routing, + v6:no routing + black 999:999 ipv4,ipv6 v4:no routing Management1