From f3e61aa796dbc53a5e93dd7aa42bfae5b3833306 Mon Sep 17 00:00:00 2001 From: Maxim Shpak Date: Fri, 3 May 2024 19:50:55 +0300 Subject: [PATCH] Fix template for Eltex's command 'show ip interface' --- .../templates/eltex_show_ip_interface.textfsm | 6 +++ .../show_ip_interface/show_ip_interface_4.raw | 8 ++++ .../show_ip_interface/show_ip_interface_4.yml | 38 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/eltex/show_ip_interface/show_ip_interface_4.raw create mode 100644 tests/eltex/show_ip_interface/show_ip_interface_4.yml diff --git a/ntc_templates/templates/eltex_show_ip_interface.textfsm b/ntc_templates/templates/eltex_show_ip_interface.textfsm index 34112cfffa..7e656b4199 100644 --- a/ntc_templates/templates/eltex_show_ip_interface.textfsm +++ b/ntc_templates/templates/eltex_show_ip_interface.textfsm @@ -31,6 +31,8 @@ Column4 ^${IP}\s+${INTERFACE}\s+${TYPE}\s+${STATUS}\s*$$ -> Record # Skip wrapped lines ^\s+received\s*$$ + ^\s+receiv\s*$$ + ^\s+ed\s*$$ ^\s*$$ ^. -> Error @@ -40,6 +42,8 @@ Column6 ^${IP}\s+${INTERFACE}\s+${TYPE}\s+${DIRECTED_BROADCAST}\s+${PRECEDENCE}\s+${STATUS}\s*$$ -> Record # Skip wrapped lines ^\s+received\s*$$ + ^\s+receiv\s*$$ + ^\s+ed\s*$$ ^\s*$$ ^. -> Error @@ -49,5 +53,7 @@ Column8 ^${IP}\s+${INTERFACE}(?:\s+${INTERFACE_STATUS_ADMIN}/${INTERFACE_STATUS_OPER})?\s+${TYPE}\s+${DIRECTED_BROADCAST}\s+${PRECEDENCE}\s+${REDIRECT}\s+${STATUS}\s*$$ -> Record # Skip wrapped lines ^\s+received\s*$$ + ^\s+receiv\s*$$ + ^\s+ed\s*$$ ^\s*$$ ^. -> Error diff --git a/tests/eltex/show_ip_interface/show_ip_interface_4.raw b/tests/eltex/show_ip_interface/show_ip_interface_4.raw new file mode 100644 index 0000000000..00ccc465c3 --- /dev/null +++ b/tests/eltex/show_ip_interface/show_ip_interface_4.raw @@ -0,0 +1,8 @@ + IP Address I/F I/F Status Type Directed Prec Redirect Status + admin/oper Broadcast +------------------ ------------- ---------- ------- --------- ---- -------- ------ +0.0.0.0/32 vlan 1 UP/UP DHCP disable No enable Not + receiv + ed +10.1.2.33/24 oob UP/UP Static disable No enable Valid +10.255.1.101/16 vlan 666 UP/UP Static disable No enable Valid diff --git a/tests/eltex/show_ip_interface/show_ip_interface_4.yml b/tests/eltex/show_ip_interface/show_ip_interface_4.yml new file mode 100644 index 0000000000..4ebc730815 --- /dev/null +++ b/tests/eltex/show_ip_interface/show_ip_interface_4.yml @@ -0,0 +1,38 @@ +--- +parsed_sample: + - directed_broadcast: "disable" + gateway_ip: "" + gateway_status: "" + gateway_type: "" + interface: "vlan 1" + interface_status_admin: "UP" + interface_status_oper: "UP" + ip: "0.0.0.0/32" + precedence: "No" + redirect: "enable" + status: "Not" + type: "DHCP" + - directed_broadcast: "disable" + gateway_ip: "" + gateway_status: "" + gateway_type: "" + interface: "oob" + interface_status_admin: "UP" + interface_status_oper: "UP" + ip: "10.1.2.33/24" + precedence: "No" + redirect: "enable" + status: "Valid" + type: "Static" + - directed_broadcast: "disable" + gateway_ip: "" + gateway_status: "" + gateway_type: "" + interface: "vlan 666" + interface_status_admin: "UP" + interface_status_oper: "UP" + ip: "10.255.1.101/16" + precedence: "No" + redirect: "enable" + status: "Valid" + type: "Static"