From 3018fdab47fd1c6558d74c68f378e9b0d71ecdff Mon Sep 17 00:00:00 2001 From: Alejandro Suarez Date: Tue, 2 Jun 2020 15:56:38 -0400 Subject: [PATCH 1/2] Added support for broadcom_icos command show_mac-address-table --- ...oadcom_icos_show_mac-address-table.textfsm | 14 +++ templates/index | 1 + .../broadcom_show_mac-address-table.raw | 22 +++++ .../broadcom_show_mac-address-table.yml | 97 +++++++++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 templates/broadcom_icos_show_mac-address-table.textfsm create mode 100644 tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.raw create mode 100644 tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.yml diff --git a/templates/broadcom_icos_show_mac-address-table.textfsm b/templates/broadcom_icos_show_mac-address-table.textfsm new file mode 100644 index 0000000000..0774e0f2d4 --- /dev/null +++ b/templates/broadcom_icos_show_mac-address-table.textfsm @@ -0,0 +1,14 @@ +Value VLAN (\S+) +Value MAC (\S+) +Value INTERFACE (\S+) +Value INDEX (\S+) +Value STATUS (\S+) + +Start + # Captures show mac-address-table for: + # Accton AS4610-54P, Accton AS5610-52X, Quanta LY2R, Quanta LB9, DNI AG3448P-R + # Raw data is the same in the case of all those devices + ^\s*VLAN\s+ID\s+MAC\s+Address\s+Interface\s+IfIndex\s+Status + ^-+ -+ -+ -+ + ^\s*${VLAN}\s+${MAC}\s+${INTERFACE}\s+${INDEX}\s+${STATUS} -> Record + ^. -> Error \ No newline at end of file diff --git a/templates/index b/templates/index index 121b3c53ea..eeecfeefc4 100644 --- a/templates/index +++ b/templates/index @@ -67,6 +67,7 @@ avaya_ers_show_mlt.textfsm, .*, avaya_ers, sh[[ow]] ml[[t]] avaya_vsp_show_software.textfsm, .*, avaya_vsp, sho[[w]] so[[ftware]] +broadcom_icos_show_mac-address-table.textfsm, .*, broadcom_icos, sh[[ow]] mac[[-adress-table]] broadcom_icos_show_version.textfsm, .*, broadcom_icos, sh[[ow]] ver[[sion]] brocade_fastiron_show_lldp_neighbors_detail.textfsm, .*, brocade_fastiron, sh[[ow]] ll[[dp]] n[[eighbors]] d[[etail]] diff --git a/tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.raw b/tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.raw new file mode 100644 index 0000000000..7a975e48bf --- /dev/null +++ b/tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.raw @@ -0,0 +1,22 @@ + +VLAN ID MAC Address Interface IfIndex Status +------- ------------------ --------------------- ------- ------------ +1 CC:37:AB:18:5F:01 5/1 55 Management +100 CC:37:AB:18:AF:03 4/100 219 Management +150 00:04:F2:B3:AD:CA 0/4 4 Learned +150 00:30:D1:00:A2:F6 0/5 5 Learned +150 00:30:F1:00:AC:36 0/1 1 Learned +150 1C:C1:FE:24:00:C0 0/47 47 Learned +150 1C:C1:FE:24:F7:C2 0/48 48 Learned +150 40:00:34:25:03:A1 0/20 20 Learned +150 64:06:0F:47:0F:A1 0/31 31 Learned +150 64:16:0F:81:B6:BC 0/18 18 Learned +150 04:16:0F:21:E6:3A 0/17 17 Learned +150 14:16:0F:21:F8:24 0/30 30 Learned +150 24:16:0F:34:57:24 0/10 10 Learned +150 34:16:0F:89:28:4E 0/16 16 Learned +150 44:16:0F:49:28:55 0/19 19 Learned +150 AC:3F:DB:09:0D:8F 0/8 8 Learned +112 00:40:58:0E:A6:36 0/14 14 Learned +112 00:40:58:0E:A8:08 0/6 6 Learned +112 00:00:58:13:E4:67 0/13 13 Learned diff --git a/tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.yml b/tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.yml new file mode 100644 index 0000000000..e2e023c7b0 --- /dev/null +++ b/tests/broadcom_icos/show_mac-address-table/broadcom_show_mac-address-table.yml @@ -0,0 +1,97 @@ +--- +parsed_sample: + - vlan: "1" + mac: "CC:37:AB:18:5F:01" + interface: "5/1" + index: "55" + status: "Management" + - vlan: "100" + mac: "CC:37:AB:18:AF:03" + interface: "4/100" + index: "219" + status: "Management" + - vlan: "150" + mac: "00:04:F2:B3:AD:CA" + interface: "0/4" + index: "4" + status: "Learned" + - vlan: "150" + mac: "00:30:D1:00:A2:F6" + interface: "0/5" + index: "5" + status: "Learned" + - vlan: "150" + mac: "00:30:F1:00:AC:36" + interface: "0/1" + index: "1" + status: "Learned" + - vlan: "150" + mac: "1C:C1:FE:24:00:C0" + interface: "0/47" + index: "47" + status: "Learned" + - vlan: "150" + mac: "1C:C1:FE:24:F7:C2" + interface: "0/48" + index: "48" + status: "Learned" + - vlan: "150" + mac: "40:00:34:25:03:A1" + interface: "0/20" + index: "20" + status: "Learned" + - vlan: "150" + mac: "64:06:0F:47:0F:A1" + interface: "0/31" + index: "31" + status: "Learned" + - vlan: "150" + mac: "64:16:0F:81:B6:BC" + interface: "0/18" + index: "18" + status: "Learned" + - vlan: "150" + mac: "04:16:0F:21:E6:3A" + interface: "0/17" + index: "17" + status: "Learned" + - vlan: "150" + mac: "14:16:0F:21:F8:24" + interface: "0/30" + index: "30" + status: "Learned" + - vlan: "150" + mac: "24:16:0F:34:57:24" + interface: "0/10" + index: "10" + status: "Learned" + - vlan: "150" + mac: "34:16:0F:89:28:4E" + interface: "0/16" + index: "16" + status: "Learned" + - vlan: "150" + mac: "44:16:0F:49:28:55" + interface: "0/19" + index: "19" + status: "Learned" + - vlan: "150" + mac: "AC:3F:DB:09:0D:8F" + interface: "0/8" + index: "8" + status: "Learned" + - vlan: "112" + mac: "00:40:58:0E:A6:36" + interface: "0/14" + index: "14" + status: "Learned" + - vlan: "112" + mac: "00:40:58:0E:A8:08" + interface: "0/6" + index: "6" + status: "Learned" + - vlan: "112" + mac: "00:00:58:13:E4:67" + interface: "0/13" + index: "13" + status: "Learned" From 99a0ebb9e94816fc42440dac13f45e96129e45bc Mon Sep 17 00:00:00 2001 From: Alejandro Suarez Date: Thu, 4 Jun 2020 21:09:15 -0400 Subject: [PATCH 2/2] Corrections for broadcom_icos command show_mac-address-table #736 --- templates/broadcom_icos_show_mac-address-table.textfsm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/broadcom_icos_show_mac-address-table.textfsm b/templates/broadcom_icos_show_mac-address-table.textfsm index 0774e0f2d4..16028e7316 100644 --- a/templates/broadcom_icos_show_mac-address-table.textfsm +++ b/templates/broadcom_icos_show_mac-address-table.textfsm @@ -9,6 +9,7 @@ Start # Accton AS4610-54P, Accton AS5610-52X, Quanta LY2R, Quanta LB9, DNI AG3448P-R # Raw data is the same in the case of all those devices ^\s*VLAN\s+ID\s+MAC\s+Address\s+Interface\s+IfIndex\s+Status - ^-+ -+ -+ -+ + ^-+ ^\s*${VLAN}\s+${MAC}\s+${INTERFACE}\s+${INDEX}\s+${STATUS} -> Record + ^\s*$$ ^. -> Error \ No newline at end of file