From 5687273473b261093bef0f18a8fd62f405a74438 Mon Sep 17 00:00:00 2001 From: PavloSkliarenko <78343937+PavloSkliarenko@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:46:19 +0400 Subject: [PATCH] fortinet_get_router_info_ospf_status template + test (#1472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --------- Co-authored-by: pskliarenko <“pskliarenko@bsh.ru”> Co-authored-by: Josh VanDeraa --- ...rtinet_get_router_info_ospf_status.textfsm | 41 +++++++++++++++++++ ntc_templates/templates/index | 1 + .../fortinet_get_router_info_ospf_status.raw | 26 ++++++++++++ .../fortinet_get_router_info_ospf_status.yml | 12 ++++++ 4 files changed, 80 insertions(+) create mode 100644 ntc_templates/templates/fortinet_get_router_info_ospf_status.textfsm create mode 100644 tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.raw create mode 100644 tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.yml diff --git a/ntc_templates/templates/fortinet_get_router_info_ospf_status.textfsm b/ntc_templates/templates/fortinet_get_router_info_ospf_status.textfsm new file mode 100644 index 0000000000..21fff349c4 --- /dev/null +++ b/ntc_templates/templates/fortinet_get_router_info_ospf_status.textfsm @@ -0,0 +1,41 @@ +Value PROCESS_NAME (.*) +Value PROCESS_ID (\S+) +Value PROCESS_STATUS (.+) +Value ATTACHED_AREAS_NUMBER (\d+) +Value List ATTACHED_AREA (.*) +Value List ATTACHED_AREA_INTERFACES (\S+) +Value List ATTACHED_AREA_FULLY_ADJACENT_NEIGHBORS (\d+) + + +Start + ^\s*Routing\s+Process\s+\".*\".* -> Continue.Record + ^\s*Routing\s+Process\s+\"${PROCESS_NAME}\"\s+with\s+ID\s+${PROCESS_ID}\s*$$ + ^\s*Process\s+is\s+${PROCESS_STATUS}\s*$$ + ^\s*Process\s+bound.*$$ + ^\s*Conforms\s+to.*$$ + ^\s*Supports\s+only.*$$ + ^\s*Supports\s+opaque.*$$ + ^\s*Do\s+not\s+support\s+Restarting.*$$ + ^\s*SPF\s+schedule\s+delay\s+.*$$ + ^\s*Refresh\s+timer.*$$ + ^\s*Number\s+of\s+incomming\s+current\s+DD\s+exchange\s+neighbors\s+.*$$ + ^\s*Number\s+of\s+outgoing\s+current\s+DD\s+exchange\s+neighbors\s+.*$$ + ^\s*Number\s+of\s+external\s+LSA\s+\d+\.\s+Checksum\s+.*$$ + ^\s*Number\s+of\s+opaque\s+AS\s+LSA\s+\d+\.\s+Checksum\s+.*$$ + ^\s*Number\s+of\s+non\-default\s+external\s+LSA\s+.*$$ + ^\s*External\s+LSA\s+database\s+.*$$ + ^\s*Number\s+of\s+LSA\s+originated.*$$ + ^\s*Number\s+of\s+LSA\s+received.*$$ + ^\s*Number\s+of\s+areas\s+attached\s+to\s+this\s+router\:\s+${ATTACHED_AREAS_NUMBER}\s*$$ -> Areas + ^\s*$$ + ^. -> Error + +Areas + ^\s*Routing\s+Process\s+\".*\".* -> Continue.Record + ^\s*Area\s+(?!has)${ATTACHED_AREA}\s*$$ + ^\s*Number\s+of\s+interfaces\s+in\s+this\s+area\s+is\s+${ATTACHED_AREA_INTERFACES}\s*$$ + ^\s*Number\s+of\s+fully\s+adjacent\s+neighbors\s+in\s+this\s+area\s+is\s+${ATTACHED_AREA_FULLY_ADJACENT_NEIGHBORS}\s*$$ + ^\s*Area\s+has\s+.*$$ + ^\s*SPF\s+algorithm\s+last\s+executed\s+.*$$ + ^\s*SPF\s+algorithm\s+executed\s+.*$$ + ^\s*Number\s+of\s+LSA\s+.*$$ -> Areas diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 8c0cb4e153..48404c5f13 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -564,6 +564,7 @@ extreme_exos_show_iparp.textfsm, .*, extreme_exos, show iparp fortinet_get_system_interface_physical.textfsm, .*, fortinet, g[[et]] sy[[stem]] in[[terface]] p[[hysical]] fortinet_get_router_info_bgp_summary.textfsm, .*, fortinet, g[[et]] r[[outer]] info bg[[p]] su[[mmary]] +fortinet_get_router_info_ospf_status.textfsm, .*, fortinet, g[[et]] r[[outer]] info o[[spf]] s[[tatus]] fortinet_get_system_ha_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] ha s[[tatus]] fortinet_get_system_interface.textfsm, .*, fortinet, g[[et]] sy[[stem]] in[[terface]] fortinet_get_system_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] stat[[us]] diff --git a/tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.raw b/tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.raw new file mode 100644 index 0000000000..7392b0f5f7 --- /dev/null +++ b/tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.raw @@ -0,0 +1,26 @@ + Routing Process "ospf 0" with ID 10.123.105.1 + Process is not up + Process bound to VRF default + Conforms to RFC2328, and RFC1583Compatibility flag is disabled + Supports only single TOS(TOS0) routes + Supports opaque LSA + Do not support Restarting + SPF schedule delay 5 secs, Hold time between two SPFs 10 secs + Refresh timer 10 secs + Number of incomming current DD exchange neighbors 0/5 + Number of outgoing current DD exchange neighbors 0/5 + Number of external LSA 485. Checksum 0xF53F64 + Number of opaque AS LSA 0. Checksum 0x000000 + Number of non-default external LSA 483 + External LSA database is unlimited. + Number of LSA originated 1 + Number of LSA received 1026789 + Number of areas attached to this router: 1 + Area 0.0.0.0 (BACKBONE) + Number of interfaces in this area is 9(11) + Number of fully adjacent neighbors in this area is 2 + Area has no authentication + SPF algorithm last executed 00:00:22.990 ago + SPF algorithm executed 35480 times + Number of LSA 68. Checksum 0x207089 + diff --git a/tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.yml b/tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.yml new file mode 100644 index 0000000000..8203d537a6 --- /dev/null +++ b/tests/fortinet/get_router_info_ospf_status/fortinet_get_router_info_ospf_status.yml @@ -0,0 +1,12 @@ +--- +parsed_sample: + - process_name: "ospf 0" + process_id: "10.123.105.1" + process_status: "not up" + attached_areas_number: "1" + attached_area: + - "0.0.0.0 (BACKBONE)" + attached_area_interfaces: + - "9(11)" + attached_area_fully_adjacent_neighbors: + - "2"