From 189a1e2df1fd53f9e9e3a6c7956b48666a1f4eab Mon Sep 17 00:00:00 2001 From: Joe Garcia Date: Tue, 25 Feb 2020 09:13:17 -0500 Subject: [PATCH 1/4] added cisco_nxos_show_vrf_interfaces --- .../cisco_nxos_show_vrf_interface.textfsm | 12 +++ templates/index | 1 + .../cisco_nxos_show_vrf_interface.raw | 19 +++++ .../cisco_nxos_show_vrf_interface.yml | 74 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 templates/cisco_nxos_show_vrf_interface.textfsm create mode 100644 templates/show_vrf_interface/cisco_nxos_show_vrf_interface.raw create mode 100644 templates/show_vrf_interface/cisco_nxos_show_vrf_interface.yml diff --git a/templates/cisco_nxos_show_vrf_interface.textfsm b/templates/cisco_nxos_show_vrf_interface.textfsm new file mode 100644 index 0000000000..80275b756b --- /dev/null +++ b/templates/cisco_nxos_show_vrf_interface.textfsm @@ -0,0 +1,12 @@ +Value INTERFACE (\S+) +Value NAME (\S+) +Value ID (\S+) +Value ORIGIN (\S+) + +Start + ^Interface\s+VRF-Name\s+VRF-ID\s+Site-of-Origin -> Start_record + +Start_record + ^${INTERFACE}\s+${NAME}\s+${ID}\s+${ORIGIN} -> Record + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index b9f70a71c9..714e7f1444 100644 --- a/templates/index +++ b/templates/index @@ -233,6 +233,7 @@ cisco_nxos_show_lldp_neighbors.textfsm, .*, cisco_nxos, sh[[ow]] ll[[dp]] nei[[g cisco_nxos_show_cdp_neighbors.textfsm, .*, cisco_nxos, sh[[ow]] cd[[p]] neig[[hbors]] cisco_nxos_show_ip_arp_detail.textfsm, .*, cisco_nxos, sh[[ow]] i[[p]] a[[rp]] det[[ail]] cisco_nxos_show_processes_cpu.textfsm, .*, cisco_nxos, sh[[ow]] proc[[esses]] c[[pu]] +cisco_nxos_show_vrf_interface.textfsm, .*, cisco_nxos, sh[[ow]] vrf int[[erface]] cisco_nxos_show_access-lists.textfsm, .*, cisco_nxos, sh[[ow]] acc[[ess-lists]] cisco_nxos_show_environments.textfsm, .*, cisco_nxos, sh[[ow]] envi[[ronments]] cisco_nxos_show_interface.textfsm, .*, cisco_nxos, sh[[ow]] inte[[rface]] diff --git a/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.raw b/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.raw new file mode 100644 index 0000000000..ec39380f93 --- /dev/null +++ b/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.raw @@ -0,0 +1,19 @@ +Interface VRF-Name VRF-ID Site-of-Origin +Vlan6001 ADMIN 6 -- +Vlan6700 ADMIN 6 -- +Vlan5302 AXNET 7 -- +Vlan7202 AXNET 7 -- +Vlan6302 AXNET 7 -- +Vlan5301 MARKING 4 -- +Vlan7201 MARKING 4 -- +Vlan6301 MARKING 4 -- +Ethernet1/10 Keepalive 3 -- +Vlan1 default 1 -- +Vlan100 default 1 -- +loopback0 default 1 -- +loopback1 default 1 -- +Ethernet1/25 default 1 -- +Ethernet1/30 default 1 -- +Ethernet1/17 default 1 -- +Ethernet1/42 default 1 -- +mgmt0 management 2 -- diff --git a/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.yml b/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.yml new file mode 100644 index 0000000000..406ffdbfe9 --- /dev/null +++ b/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.yml @@ -0,0 +1,74 @@ +--- +parsed_sample: + - interface: Vlan6001 + name: ADMIN + id: '6' + origin: "--" + - interface: Vlan6700 + name: ADMIN + id: '6' + origin: "--" + - interface: Vlan5302 + name: AXNET + id: '7' + origin: "--" + - interface: Vlan7202 + name: AXNET + id: '7' + origin: "--" + - interface: Vlan6302 + name: AXNET + id: '7' + origin: "--" + - interface: Vlan5301 + name: MARKING + id: '4' + origin: "--" + - interface: Vlan7201 + name: MARKING + id: '4' + origin: "--" + - interface: Vlan6301 + name: MARKING + id: '4' + origin: "--" + - interface: Ethernet1/10 + name: Keepalive + id: '3' + origin: "--" + - interface: Vlan1 + name: default + id: '1' + origin: "--" + - interface: Vlan100 + name: default + id: '1' + origin: "--" + - interface: loopback0 + name: default + id: '1' + origin: "--" + - interface: loopback1 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/25 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/30 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/17 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/42 + name: default + id: '1' + origin: "--" + - interface: mgmt0 + name: management + id: '2' + origin: "--" \ No newline at end of file From d6b8d2783e14cb9209d09b5e78bf09db2dfbcaa0 Mon Sep 17 00:00:00 2001 From: Joe Garcia Date: Tue, 25 Feb 2020 09:25:07 -0500 Subject: [PATCH 2/4] added cisco_nxos_show_vrf_interface --- .../show_vrf_interface/cisco_nxos_show_vrf_interface.raw | 0 .../show_vrf_interface/cisco_nxos_show_vrf_interface.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {templates => tests}/show_vrf_interface/cisco_nxos_show_vrf_interface.raw (100%) rename {templates => tests}/show_vrf_interface/cisco_nxos_show_vrf_interface.yml (100%) diff --git a/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.raw b/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.raw similarity index 100% rename from templates/show_vrf_interface/cisco_nxos_show_vrf_interface.raw rename to tests/show_vrf_interface/cisco_nxos_show_vrf_interface.raw diff --git a/templates/show_vrf_interface/cisco_nxos_show_vrf_interface.yml b/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.yml similarity index 100% rename from templates/show_vrf_interface/cisco_nxos_show_vrf_interface.yml rename to tests/show_vrf_interface/cisco_nxos_show_vrf_interface.yml From bfd47b48f7d354e7a5e9908c3ddb7d550d43f934 Mon Sep 17 00:00:00 2001 From: Joe Garcia Date: Tue, 25 Feb 2020 12:27:29 -0500 Subject: [PATCH 3/4] put the tests where they need to be --- .../cisco_nxos_show_vrf_interface.raw | 19 +++++ .../cisco_nxos_show_vrf_interface.yml | 74 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.raw create mode 100644 tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml diff --git a/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.raw b/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.raw new file mode 100644 index 0000000000..ec39380f93 --- /dev/null +++ b/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.raw @@ -0,0 +1,19 @@ +Interface VRF-Name VRF-ID Site-of-Origin +Vlan6001 ADMIN 6 -- +Vlan6700 ADMIN 6 -- +Vlan5302 AXNET 7 -- +Vlan7202 AXNET 7 -- +Vlan6302 AXNET 7 -- +Vlan5301 MARKING 4 -- +Vlan7201 MARKING 4 -- +Vlan6301 MARKING 4 -- +Ethernet1/10 Keepalive 3 -- +Vlan1 default 1 -- +Vlan100 default 1 -- +loopback0 default 1 -- +loopback1 default 1 -- +Ethernet1/25 default 1 -- +Ethernet1/30 default 1 -- +Ethernet1/17 default 1 -- +Ethernet1/42 default 1 -- +mgmt0 management 2 -- diff --git a/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml b/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml new file mode 100644 index 0000000000..406ffdbfe9 --- /dev/null +++ b/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml @@ -0,0 +1,74 @@ +--- +parsed_sample: + - interface: Vlan6001 + name: ADMIN + id: '6' + origin: "--" + - interface: Vlan6700 + name: ADMIN + id: '6' + origin: "--" + - interface: Vlan5302 + name: AXNET + id: '7' + origin: "--" + - interface: Vlan7202 + name: AXNET + id: '7' + origin: "--" + - interface: Vlan6302 + name: AXNET + id: '7' + origin: "--" + - interface: Vlan5301 + name: MARKING + id: '4' + origin: "--" + - interface: Vlan7201 + name: MARKING + id: '4' + origin: "--" + - interface: Vlan6301 + name: MARKING + id: '4' + origin: "--" + - interface: Ethernet1/10 + name: Keepalive + id: '3' + origin: "--" + - interface: Vlan1 + name: default + id: '1' + origin: "--" + - interface: Vlan100 + name: default + id: '1' + origin: "--" + - interface: loopback0 + name: default + id: '1' + origin: "--" + - interface: loopback1 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/25 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/30 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/17 + name: default + id: '1' + origin: "--" + - interface: Ethernet1/42 + name: default + id: '1' + origin: "--" + - interface: mgmt0 + name: management + id: '2' + origin: "--" \ No newline at end of file From fad170dc517e4594ea359e44778989b686e58285 Mon Sep 17 00:00:00 2001 From: Joe Garcia Date: Tue, 25 Feb 2020 14:18:55 -0500 Subject: [PATCH 4/4] ran development tools to fix the yaml and add pipenv files to gitignore --- .gitignore | 4 + .../cisco_nxos_show_vrf_interface.yml | 144 +++++++++--------- .../cisco_nxos_show_vrf_interface.raw | 19 --- .../cisco_nxos_show_vrf_interface.yml | 74 --------- 4 files changed, 76 insertions(+), 165 deletions(-) delete mode 100644 tests/show_vrf_interface/cisco_nxos_show_vrf_interface.raw delete mode 100644 tests/show_vrf_interface/cisco_nxos_show_vrf_interface.yml diff --git a/.gitignore b/.gitignore index ede28f140f..497b3b114a 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,7 @@ hosts *.py~ create_ntc-templates_parsed.py + +# Ignore pipenv files +**Pipfile +**Pipfile.lock \ No newline at end of file diff --git a/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml b/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml index 406ffdbfe9..c9d63f50c2 100644 --- a/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml +++ b/tests/cisco_nxos/show_vrf_interface/cisco_nxos_show_vrf_interface.yml @@ -1,74 +1,74 @@ --- parsed_sample: - - interface: Vlan6001 - name: ADMIN - id: '6' - origin: "--" - - interface: Vlan6700 - name: ADMIN - id: '6' - origin: "--" - - interface: Vlan5302 - name: AXNET - id: '7' - origin: "--" - - interface: Vlan7202 - name: AXNET - id: '7' - origin: "--" - - interface: Vlan6302 - name: AXNET - id: '7' - origin: "--" - - interface: Vlan5301 - name: MARKING - id: '4' - origin: "--" - - interface: Vlan7201 - name: MARKING - id: '4' - origin: "--" - - interface: Vlan6301 - name: MARKING - id: '4' - origin: "--" - - interface: Ethernet1/10 - name: Keepalive - id: '3' - origin: "--" - - interface: Vlan1 - name: default - id: '1' - origin: "--" - - interface: Vlan100 - name: default - id: '1' - origin: "--" - - interface: loopback0 - name: default - id: '1' - origin: "--" - - interface: loopback1 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/25 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/30 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/17 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/42 - name: default - id: '1' - origin: "--" - - interface: mgmt0 - name: management - id: '2' - origin: "--" \ No newline at end of file + - interface: "Vlan6001" + name: "ADMIN" + id: "6" + origin: "--" + - interface: "Vlan6700" + name: "ADMIN" + id: "6" + origin: "--" + - interface: "Vlan5302" + name: "AXNET" + id: "7" + origin: "--" + - interface: "Vlan7202" + name: "AXNET" + id: "7" + origin: "--" + - interface: "Vlan6302" + name: "AXNET" + id: "7" + origin: "--" + - interface: "Vlan5301" + name: "MARKING" + id: "4" + origin: "--" + - interface: "Vlan7201" + name: "MARKING" + id: "4" + origin: "--" + - interface: "Vlan6301" + name: "MARKING" + id: "4" + origin: "--" + - interface: "Ethernet1/10" + name: "Keepalive" + id: "3" + origin: "--" + - interface: "Vlan1" + name: "default" + id: "1" + origin: "--" + - interface: "Vlan100" + name: "default" + id: "1" + origin: "--" + - interface: "loopback0" + name: "default" + id: "1" + origin: "--" + - interface: "loopback1" + name: "default" + id: "1" + origin: "--" + - interface: "Ethernet1/25" + name: "default" + id: "1" + origin: "--" + - interface: "Ethernet1/30" + name: "default" + id: "1" + origin: "--" + - interface: "Ethernet1/17" + name: "default" + id: "1" + origin: "--" + - interface: "Ethernet1/42" + name: "default" + id: "1" + origin: "--" + - interface: "mgmt0" + name: "management" + id: "2" + origin: "--" diff --git a/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.raw b/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.raw deleted file mode 100644 index ec39380f93..0000000000 --- a/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.raw +++ /dev/null @@ -1,19 +0,0 @@ -Interface VRF-Name VRF-ID Site-of-Origin -Vlan6001 ADMIN 6 -- -Vlan6700 ADMIN 6 -- -Vlan5302 AXNET 7 -- -Vlan7202 AXNET 7 -- -Vlan6302 AXNET 7 -- -Vlan5301 MARKING 4 -- -Vlan7201 MARKING 4 -- -Vlan6301 MARKING 4 -- -Ethernet1/10 Keepalive 3 -- -Vlan1 default 1 -- -Vlan100 default 1 -- -loopback0 default 1 -- -loopback1 default 1 -- -Ethernet1/25 default 1 -- -Ethernet1/30 default 1 -- -Ethernet1/17 default 1 -- -Ethernet1/42 default 1 -- -mgmt0 management 2 -- diff --git a/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.yml b/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.yml deleted file mode 100644 index 406ffdbfe9..0000000000 --- a/tests/show_vrf_interface/cisco_nxos_show_vrf_interface.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -parsed_sample: - - interface: Vlan6001 - name: ADMIN - id: '6' - origin: "--" - - interface: Vlan6700 - name: ADMIN - id: '6' - origin: "--" - - interface: Vlan5302 - name: AXNET - id: '7' - origin: "--" - - interface: Vlan7202 - name: AXNET - id: '7' - origin: "--" - - interface: Vlan6302 - name: AXNET - id: '7' - origin: "--" - - interface: Vlan5301 - name: MARKING - id: '4' - origin: "--" - - interface: Vlan7201 - name: MARKING - id: '4' - origin: "--" - - interface: Vlan6301 - name: MARKING - id: '4' - origin: "--" - - interface: Ethernet1/10 - name: Keepalive - id: '3' - origin: "--" - - interface: Vlan1 - name: default - id: '1' - origin: "--" - - interface: Vlan100 - name: default - id: '1' - origin: "--" - - interface: loopback0 - name: default - id: '1' - origin: "--" - - interface: loopback1 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/25 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/30 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/17 - name: default - id: '1' - origin: "--" - - interface: Ethernet1/42 - name: default - id: '1' - origin: "--" - - interface: mgmt0 - name: management - id: '2' - origin: "--" \ No newline at end of file