From f9acdfcf2aac85e38a97ee0b51652b3eae06a4c4 Mon Sep 17 00:00:00 2001 From: pskliarenko <“pskliarenko@bsh.ru”> Date: Sun, 10 Sep 2023 22:23:14 +0400 Subject: [PATCH] Template + test --- ntc_templates/templates/fortinet_execute_date.textfsm | 8 ++++++++ ntc_templates/templates/index | 1 + tests/fortinet/execute_date/fortinet_execute_date.raw | 1 + tests/fortinet/execute_date/fortinet_execute_date.yml | 5 +++++ 4 files changed, 15 insertions(+) create mode 100644 ntc_templates/templates/fortinet_execute_date.textfsm create mode 100644 tests/fortinet/execute_date/fortinet_execute_date.raw create mode 100644 tests/fortinet/execute_date/fortinet_execute_date.yml diff --git a/ntc_templates/templates/fortinet_execute_date.textfsm b/ntc_templates/templates/fortinet_execute_date.textfsm new file mode 100644 index 0000000000..4563084e05 --- /dev/null +++ b/ntc_templates/templates/fortinet_execute_date.textfsm @@ -0,0 +1,8 @@ +Value YEAR (\d{4}) +Value MONTH (\d{2}) +Value DAY (\d{2}) + +Start + ^\s*current\s+date\s+is:\s+${YEAR}-${MONTH}-${DAY}\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 3a5b516184..fab2fdaff1 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -487,6 +487,7 @@ fortinet_get_system_ha_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] ha s[[ta fortinet_get_system_interface.textfsm, .*, fortinet, g[[et]] sy[[stem]] in[[terface]] fortinet_get_system_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] stat[[us]] fortinet_get_system_arp.textfsm, .*, fortinet, g[[et]] sy[[stem]] arp +fortinet_execute_date.textfsm, .*, fortinet, exec[[ute]] da[[te]] hp_comware_display_lldp_neighbor-information_verbose.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] v[[erbose]] hp_comware_display_lldp_neighbor-information_list.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] l[[ist]] diff --git a/tests/fortinet/execute_date/fortinet_execute_date.raw b/tests/fortinet/execute_date/fortinet_execute_date.raw new file mode 100644 index 0000000000..ab89397aee --- /dev/null +++ b/tests/fortinet/execute_date/fortinet_execute_date.raw @@ -0,0 +1 @@ +current date is: 2023-08-07 diff --git a/tests/fortinet/execute_date/fortinet_execute_date.yml b/tests/fortinet/execute_date/fortinet_execute_date.yml new file mode 100644 index 0000000000..e68ea3603f --- /dev/null +++ b/tests/fortinet/execute_date/fortinet_execute_date.yml @@ -0,0 +1,5 @@ +--- +parsed_sample: + - year: "2023" + month: "08" + day: "07"