From 535eac7696cfec798ff790590246b098398afab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20RIBOT?= Date: Thu, 16 Mar 2023 12:19:23 +0100 Subject: [PATCH] MikroTik RouterOs add management of entry without flags in ip-firewall-address-list template --- ..._firewall_address-list_print_terse.textfsm | 4 +-- ..._firewall_address-list_print_terseIPv4.raw | 1 + ..._firewall_address-list_print_terseIPv4.yml | 33 +++++++++++-------- ..._firewall_address-list_print_terseIPv6.raw | 1 + ..._firewall_address-list_print_terseIPv6.yml | 15 ++++++--- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm b/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm index 720fff3423..63a4bb2862 100644 --- a/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm +++ b/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm @@ -1,5 +1,5 @@ Value Key INDEX (\d+) -Value FLAGS ([XD ]) +Value FLAGS ([XD]) Value LIST (\S+) Value ADDRESS (\S+) Value CREATION_TIME (\S+\s\S+) @@ -7,5 +7,5 @@ Value TIMEOUT (\S+) Value DYNAMIC (yes|no) Start - ^\s*${INDEX}\s${FLAGS}\slist=${LIST}\saddress=${ADDRESS}(\screation-time=${CREATION_TIME})?(\stimeout=${TIMEOUT})?(\sdynamic=${DYNAMIC})?.*$$ -> Record + ^\s*${INDEX}\s+(${FLAGS})?\s*list=${LIST}\saddress=${ADDRESS}(\screation-time=${CREATION_TIME})?(\stimeout=${TIMEOUT})?(\sdynamic=${DYNAMIC})?.*$$ -> Record ^. -> Error diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw index 7c16c5324a..f7ae7e87e2 100644 --- a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw @@ -13,3 +13,4 @@ 12 list=azeazeaze address=192.168.1.3 creation-time=jun/14/2022 06:44:51 13 X list=azeazeaze address=192.168.3.0/24 creation-time=jun/14/2022 07:53:30 14 D list=azeazeaze address=192.168.3.0/24 creation-time=jun/14/2022 07:53:49 timeout=4m52s +15 list=snmp-monitoring-address-list address=85.14.167.234 creation-time=mar/01/2023 13:59:33 diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml index b081181caa..c2b9476013 100644 --- a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml @@ -1,91 +1,91 @@ --- parsed_sample: - index: "0" - flags: " " + flags: "" list: "Eqinoxe" address: "185.48.253.0/27" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "1" - flags: " " + flags: "" list: "Eqinoxe" address: "185.48.254.0/28" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "2" - flags: " " + flags: "" list: "Eqinoxe" address: "185.163.212.64/28" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "3" - flags: " " + flags: "" list: "Eqinoxe" address: "185.163.212.48/28" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "4" - flags: " " + flags: "" list: "Eqinoxe" address: "185.197.109.16/28" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "5" - flags: " " + flags: "" list: "Supervision" address: "185.132.66.240" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "6" - flags: " " + flags: "" list: "Supervision" address: "85.14.167.232/29" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "7" - flags: " " + flags: "" list: "Supervision" address: "185.48.254.16/29" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "8" - flags: " " + flags: "" list: "Supervision" address: "5.10.130.152/30" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "9" - flags: " " + flags: "" list: "Supervision" address: "85.14.167.193" creation_time: "jan/01/2002 01:00:25" timeout: "" dynamic: "" - index: "10" - flags: " " + flags: "" list: "azeazeaze" address: "192.168.1.1" creation_time: "jun/14/2022 06:34:30" timeout: "" dynamic: "" - index: "11" - flags: " " + flags: "" list: "azeazeaze" address: "192.168.1.2" creation_time: "jun/14/2022 06:44:09" timeout: "" dynamic: "" - index: "12" - flags: " " + flags: "" list: "azeazeaze" address: "192.168.1.3" creation_time: "jun/14/2022 06:44:51" @@ -105,3 +105,10 @@ parsed_sample: creation_time: "jun/14/2022 07:53:49" timeout: "4m52s" dynamic: "" + - index: "15" + flags: "" + list: "snmp-monitoring-address-list" + address: "85.14.167.234" + creation_time: "mar/01/2023 13:59:33" + timeout: "" + dynamic: "" diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw index 1770597d3d..2de0040c86 100644 --- a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw @@ -5,3 +5,4 @@ 4 D list=azeazeaze address=d4de:e2c0::/26 timeout=7m49s dynamic=yes 5 list=azeazeaze address=e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:ad62/128 dynamic=no 6 X list=azeazeaze address=e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:0/128 dynamic=no + 7 list=ertyhgfgf address=e7bb:6ba4:5eb9:4014:37f:d1ab:6d74:0/128 dynamic=no diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml index 8f4a7f151e..dc1bcb9d5b 100644 --- a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml @@ -1,21 +1,21 @@ --- parsed_sample: - index: "0" - flags: " " + flags: "" list: "Supervision" address: "2a05:c100::/48" creation_time: "" timeout: "" dynamic: "no" - index: "1" - flags: " " + flags: "" list: "Supervision" address: "2a00:41e0::/48" creation_time: "" timeout: "" dynamic: "no" - index: "2" - flags: " " + flags: "" list: "azeazeaze" address: "b620::/11" creation_time: "" @@ -36,7 +36,7 @@ parsed_sample: timeout: "7m49s" dynamic: "yes" - index: "5" - flags: " " + flags: "" list: "azeazeaze" address: "e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:ad62/128" creation_time: "" @@ -49,3 +49,10 @@ parsed_sample: creation_time: "" timeout: "" dynamic: "no" + - index: "7" + flags: "" + list: "ertyhgfgf" + address: "e7bb:6ba4:5eb9:4014:37f:d1ab:6d74:0/128" + creation_time: "" + timeout: "" + dynamic: "no"