From d4e23ccabc2c74aa809ce3f9a243ce6637f1f381 Mon Sep 17 00:00:00 2001 From: Edouard Lavaud Date: Wed, 2 Feb 2022 11:37:56 +0100 Subject: [PATCH] Add zyxel cfg ipalias get --- ntc_templates/templates/index | 1 + .../zyxel_os_cfg_ipalias_get.textfsm | 16 +++++++++++++ .../zyxel_os_cfg_ipalias_get.raw | 7 ++++++ .../zyxel_os_cfg_ipalias_get.yml | 23 +++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 ntc_templates/templates/zyxel_os_cfg_ipalias_get.textfsm create mode 100644 tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.raw create mode 100644 tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.yml diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index c0191ced2a..d40d6864c2 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -526,4 +526,5 @@ watchguard_firebox_show_arp.textfsm, .*, watchguard_firebox, sh[[ow]] arp yamaha_show_environment.textfsm, .*, yamaha, sh[[ow]] en[[vironment]] yamaha_show_ip_route.textfsm, .*, yamaha, sh[[ow]] ip ro[[ute]] +zyxel_os_cfg_ipalias_get.textfsm, .*, zyxel_os, cfg ipalias get zyxel_os_cfg_nat_get.textfsm, .*, zyxel_os, cfg nat get diff --git a/ntc_templates/templates/zyxel_os_cfg_ipalias_get.textfsm b/ntc_templates/templates/zyxel_os_cfg_ipalias_get.textfsm new file mode 100644 index 0000000000..ab55852f50 --- /dev/null +++ b/ntc_templates/templates/zyxel_os_cfg_ipalias_get.textfsm @@ -0,0 +1,16 @@ +Value NAME (.+?) +Value IPALIAS_ACTIVE (0|1) +Value IPALIAS_IP (\S+) +Value IPALIAS_NETMASK (\S+) +Value PUBLAN_ACTIVE (0|1) +Value PUBLAN_IP (\S+) +Value PUBLAN_NETMASK (\S+) + +Start + ^Group\sName\s+Active\s+IPv4\sArrdess\s+Subnet\smask\s+Active\s+IPv4\sArrdess\s+Subnet\smask\s+Offer\sPublic\sIP\sby\sDHCP\s+Enable\sARP\sProxy\s*$$ -> IPALIASTable + +IPALIASTable + ^${NAME}\s+${IPALIAS_ACTIVE}\s+${IPALIAS_IP}\s+${IPALIAS_NETMASK}\s+${PUBLAN_ACTIVE}\s+${PUBLAN_IP}\s+${PUBLAN_NETMASK}\s+(0|1)\s+(0|1)\s*$$ -> Record + ^Command\sSuccessful.\s*$$ + ^\s*$$ + ^. -> Error diff --git a/tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.raw b/tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.raw new file mode 100644 index 0000000000..6d74c15386 --- /dev/null +++ b/tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.raw @@ -0,0 +1,7 @@ +handlerName=ethwanlan method=GET i=2 +This device do not support Ethernet LAN4 port change to WAN port. IP Alias Setup Public LAN +Group Name Active IPv4 Arrdess Subnet mask Active IPv4 Arrdess Subnet mask Offer Public IP by DHCP Enable ARP Proxy +Default 0 N/A N/A 1 100.200.77.111 255.255.255.252 0 0 +LAN VOIX 0 N/A N/A 0 N/A N/A 0 0 +2e65ed5d-d 1 192.168.180.1 255.255.255.0 0 N/A N/A 0 0 +Command Successful. diff --git a/tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.yml b/tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.yml new file mode 100644 index 0000000000..83ab6241d2 --- /dev/null +++ b/tests/zyxel_os/cfg_ipalias_get/zyxel_os_cfg_ipalias_get.yml @@ -0,0 +1,23 @@ +--- +parsed_sample: + - name: "Default" + ipalias_active: "0" + ipalias_ip: "N/A" + ipalias_netmask: "N/A" + publan_active: "1" + publan_ip: "100.200.77.111" + publan_netmask: "255.255.255.252" + - name: "LAN VOIX" + ipalias_active: "0" + ipalias_ip: "N/A" + ipalias_netmask: "N/A" + publan_active: "0" + publan_ip: "N/A" + publan_netmask: "N/A" + - name: "2e65ed5d-d" + ipalias_active: "1" + ipalias_ip: "192.168.180.1" + ipalias_netmask: "255.255.255.0" + publan_active: "0" + publan_ip: "N/A" + publan_netmask: "N/A"