diff --git a/templates/arista_eos_show_mac_address-table.textfsm b/templates/arista_eos_show_mac_address-table.textfsm index 097b1e75ad..8ede40a789 100644 --- a/templates/arista_eos_show_mac_address-table.textfsm +++ b/templates/arista_eos_show_mac_address-table.textfsm @@ -1,10 +1,40 @@ -Value MAC_ADDRESS (\w+?\.\w+?\.\w+?|\w+?\:\w+?\:\w+?\:\w+?\:\w+?\:\w+?) -Value TYPE (\w+?) -Value VLAN (\d+?) -Value DESTINATION_PORT (\w+\s\w+\s\w+\s\w+|\w+\s\w+\s\w+|\w+\s\w+|\w+?) -Value MOVES (\d+?) +Value MAC_ADDRESS (\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+) +Value TYPE (\w+) +Value VLAN (\d+) +Value List DESTINATION_PORT ((\w+\/\w+)|\w+) +Value MOVES (\d+) Value LAST_MOVE (.+) Start - ^\s*${VLAN}\s+?${MAC_ADDRESS}\s+?${TYPE}\s+?${DESTINATION_PORT}\s+?${MOVES}\s+${LAST_MOVE}\sago$$ -> Record - ^\s*${VLAN}\s+?${MAC_ADDRESS}\s+?${TYPE}\s+?${DESTINATION_PORT}$$ -> Record \ No newline at end of file + ^\s*Vlan\s+(M|m)ac\sAddress\s+Type\s+Ports\s+Moves\s+Last\sMove\s*$$ -> MAT + ^\s*Vlan\s+(M|m)ac\sAddress\s+Type\s+Ports\s*$$ -> MMAT + ^\s*$$ + ^\s*(M|m)ac\sAddress\sTable\s*$$ + ^\s*Multicast\s(M|m)ac\sAddress\sTable\s*$$ + ^-*$$ + # ^(-*\s*)*$$ + ^. -> Error + +MAT + # capture the mac address table + ^\s*${VLAN}\s+${MAC_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT}\s*$$ -> Record + ^\s*${VLAN}\s+${MAC_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT}\s+${MOVES}\s+${LAST_MOVE}\sago$$ -> Record + ^\s*Total\s+mac -> Start + ^\s*-+\s+.*-*$$ + ^\s*$$ + ^. -> Error + +MMAT + # capture the multicast mac address table + # key on the record + ^\s*\d+\s+(\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+)\s+\w+\s*.*$$ -> Continue.Record + # match the record with one to five destination ports more. + ^\s*${VLAN}\s+${MAC_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT}$$ -> Record + ^\s*${VLAN}\s+${MAC_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT}\s -> Continue + ^\s*\d+\s+(\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+)\s+\w+\s+((\w+\/\w+|\w+)\s){1}${DESTINATION_PORT}\s* -> Continue + ^\s*\d+\s+(\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+)\s+\w+\s+((\w+\/\w+|\w+)\s){2}${DESTINATION_PORT}\s* -> Continue + ^\s*\d+\s+(\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+)\s+\w+\s+((\w+\/\w+|\w+)\s){3}${DESTINATION_PORT}\s* -> Continue + ^\s*\d+\s+(\w+\.\w+\.\w+|\w+\:\w+\:\w+\:\w+\:\w+\:\w+)\s+\w+\s+((\w+\/\w+|\w+)\s){4}${DESTINATION_PORT}$$ -> Continue + ^\s*Total\s+mac -> Start + ^\s*-+\s+.*-*$$ + ^\s*$$ \ No newline at end of file diff --git a/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.raw b/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.raw index fd52c5e147..684f3e1f4d 100644 --- a/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.raw +++ b/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.raw @@ -29,5 +29,8 @@ Total mac Addresses for this criterion: 24 Vlan mac Address Type Ports ---- ----------- ---- ----- - 4 0112.3057.8423 STATIC Po10 Po12 + 4 c867.3057.8423 STATIC Po10 Po123 + 42 5309.3057.8423 STATIC Po135 Po12 po5 + 200 jenn.3057.8423 STATIC Po66 + 47 4242.3057.8423 STATIC Po135 Po12 po5 eth1/1 Total mac Addresses for this criterion: 1 \ No newline at end of file diff --git a/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.yml b/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.yml index 5abb6add2e..d9b9f88e7a 100644 --- a/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.yml +++ b/tests/arista_eos/show_mac_address-table/arista_eos_show_mac_address-table.yml @@ -3,120 +3,167 @@ parsed_sample: - mac_address: "0012.3694.03ec" type: "STATIC" vlan: "3" - destination_port: "Et7" + destination_port: + - "Et7" moves: "" last_move: "" - mac_address: "001c.7313.a3de" type: "DYNAMIC" vlan: "55" - destination_port: "Et32" + destination_port: + - "Et32" moves: "1" last_move: "0:08:16" - mac_address: "001c.8224.36d7" type: "DYNAMIC" vlan: "101" - destination_port: "Po2" + destination_port: + - "Po2" moves: "1" last_move: "9 days, 15:57:28" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "102" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "001c.8229.a0f3" type: "DYNAMIC" vlan: "102" - destination_port: "Po1" + destination_port: + - "Po1" moves: "1" last_move: "0:05:05" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "661" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "001c.822f.6b22" type: "DYNAMIC" vlan: "661" - destination_port: "Po7" + destination_port: + - "Po7" moves: "1" last_move: "0:20:10" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "3000" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "0050.56a8.0016" type: "DYNAMIC" vlan: "3000" - destination_port: "Po1" + destination_port: + - "Po1" moves: "1" last_move: "0:07:38" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "3909" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "001c.822f.6a80" type: "DYNAMIC" vlan: "3909" - destination_port: "Po1" + destination_port: + - "Po1" moves: "1" last_move: "0:07:08" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "3911" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "001c.8220.40fa" type: "DYNAMIC" vlan: "3911" - destination_port: "Po8" + destination_port: + - "Po8" moves: "1" last_move: "1:19:58" - mac_address: "001c.822b.033e" type: "DYNAMIC" vlan: "3912" - destination_port: "Et11" + destination_port: + - "Et11" moves: "1" last_move: "9 days, 15:57:23" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "3913" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "001c.822b.033e" type: "DYNAMIC" vlan: "3913" - destination_port: "Po1" + destination_port: + - "Po1" moves: "1" last_move: "0:04:35" - mac_address: "001c.8220.178f" type: "DYNAMIC" vlan: "3984" - destination_port: "Et8" + destination_port: + - "Et8" moves: "1" last_move: "4 days, 15:07:29" - mac_address: "001c.8220.1319" type: "STATIC" vlan: "3992" - destination_port: "Po1" + destination_port: + - "Po1" moves: "" last_move: "" - mac_address: "001c.8221.07b9" type: "DYNAMIC" vlan: "3992" - destination_port: "Po6" + destination_port: + - "Po6" moves: "1" last_move: "4 days, 15:13:15" - - mac_address: "0112.3057.8423" + - mac_address: "c867.3057.8423" type: "STATIC" vlan: "4" - destination_port: "Po10 Po12" + destination_port: + - "Po10" + - "Po123" + moves: "" + last_move: "" + - mac_address: "5309.3057.8423" + type: "STATIC" + vlan: "42" + destination_port: + - "Po135" + - "Po12" + - "po5" + moves: "" + last_move: "" + - mac_address: "jenn.3057.8423" + type: "STATIC" + vlan: "200" + destination_port: + - "Po66" + moves: "" + last_move: "" + - mac_address: "4242.3057.8423" + type: "STATIC" + vlan: "47" + destination_port: + - "Po135" + - "Po12" + - "po5" + - "eth1/1" moves: "" last_move: ""