From 813f1c9cdcd93186ebc0d5ee0a512a93ff74b041 Mon Sep 17 00:00:00 2001 From: dainok Date: Tue, 1 Oct 2019 17:12:28 +0200 Subject: [PATCH] new_template: watchguard_firebox_show_arp --- templates/index | 2 ++ .../watchguard_firebox_show_arp.template | 11 ++++++++++ tests/test_index_order.py | 2 +- .../watchguard_firebox_show_arp.parsed | 21 +++++++++++++++++++ .../show_arp/watchguard_firebox_show_arp.raw | 9 ++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 templates/watchguard_firebox_show_arp.template create mode 100644 tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.parsed create mode 100644 tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.raw diff --git a/templates/index b/templates/index index 1b22486436..3e82710afe 100644 --- a/templates/index +++ b/templates/index @@ -326,3 +326,5 @@ vmware_nsxv_show_ip_route.template, .*, vmware_nsxv, sh[[ow]] ip r[[oute]] vyatta_vyos_show_interfaces.template, .*, .*vyos.*, sh[[ow]] int[[erfaces]] vyatta_vyos_show_arp.template, .*, .*vyos.*, sh[[ow]] a[[rp]] + +watchguard_firebox_show_arp.template, .*, watchguard_firebox, sh[[ow]] arp diff --git a/templates/watchguard_firebox_show_arp.template b/templates/watchguard_firebox_show_arp.template new file mode 100644 index 0000000000..dff1bf5dce --- /dev/null +++ b/templates/watchguard_firebox_show_arp.template @@ -0,0 +1,11 @@ +Value INTERFACE (\S+) +Value IP ([0-9.]+) +Value MAC ([0-9a-fA-F:]+|incomplete) + +Start + ^-- + ^--\s+ARP\s+Table + ^-- + ^\?\s+\(${IP}\)\s+at\s+<*${MAC}>*\s+(\[\S+\]\s*)?([A-Z]+\s*)?on\s+${INTERFACE} -> Record + ^\s*$$ + ^. -> Error diff --git a/tests/test_index_order.py b/tests/test_index_order.py index 3eef5cda63..56ca39c502 100644 --- a/tests/test_index_order.py +++ b/tests/test_index_order.py @@ -63,7 +63,7 @@ def test_index_ordering(): 'cisco_xe', 'cisco_xr', 'dell_force10', 'enterasys', 'extreme', 'f5_ltm', 'fortinet', 'hp_comware', 'hp_procurve', 'huawei', 'juniper', 'juniper_junos', 'juniper_screenos', 'alcatel_sros', 'linux', 'ovs_linux', 'paloalto_panos', 'quanta_mesh', - 'ubiquiti_edgeswitch', 'vmware_nsxv', 'vyatta_vyos', 'vyos', + 'ubiquiti_edgeswitch', 'vmware_nsxv', 'vyatta_vyos', 'vyos', 'watchguard_firebox', ] prior_os = "" diff --git a/tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.parsed b/tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.parsed new file mode 100644 index 0000000000..7b21bd80ea --- /dev/null +++ b/tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.parsed @@ -0,0 +1,21 @@ +--- +parsed_sample: + +- interface: vlan1 + ip: 10.0.0.6 + mac: '00:01:02:03:04:c8' +- interface: vlan2 + ip: 10.1.0.10 + mac: '00:01:02:03:04:90' +- interface: vlan3 + ip: 10.2.0.1 + mac: '00:01:02:03:04:6a' +- interface: vlan4 + ip: 10.3.0.8 + mac: 'incomplete' +- interface: vlan5 + ip: 10.4.0.4 + mac: '00:01:02:03:04:ee' +- interface: eth0 + ip: 10.5.0.4 + mac: '00:01:02:03:04:05' diff --git a/tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.raw b/tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.raw new file mode 100644 index 0000000000..6cf3ace208 --- /dev/null +++ b/tests/watchguard_firebox/show_arp/watchguard_firebox_show_arp.raw @@ -0,0 +1,9 @@ +-- +-- ARP Table +-- +? (10.0.0.6) at 00:01:02:03:04:c8 [ether] on vlan1 +? (10.1.0.10) at 00:01:02:03:04:90 [ether] on vlan2 +? (10.2.0.1) at 00:01:02:03:04:6a [ether] on vlan3 +? (10.3.0.8) at on vlan4 +? (10.4.0.4) at 00:01:02:03:04:ee [ether] on vlan5 +? (10.5.0.4) at 00:01:02:03:04:05 [ether] PERM on eth0