From 403d07fad3b312c73fe6058a2767742e8e9c890e Mon Sep 17 00:00:00 2001 From: PavloSkliarenko <78343937+PavloSkliarenko@users.noreply.github.com> Date: Tue, 17 Oct 2023 21:30:54 +0400 Subject: [PATCH] Template + test (#1522) --- ntc_templates/templates/cisco_s300_show_system_id.textfsm | 6 ++++++ ntc_templates/templates/index | 1 + .../cisco_s300/show_system_id/cisco_s300_show_system_id.raw | 1 + .../cisco_s300/show_system_id/cisco_s300_show_system_id.yml | 3 +++ 4 files changed, 11 insertions(+) create mode 100644 ntc_templates/templates/cisco_s300_show_system_id.textfsm create mode 100644 tests/cisco_s300/show_system_id/cisco_s300_show_system_id.raw create mode 100644 tests/cisco_s300/show_system_id/cisco_s300_show_system_id.yml diff --git a/ntc_templates/templates/cisco_s300_show_system_id.textfsm b/ntc_templates/templates/cisco_s300_show_system_id.textfsm new file mode 100644 index 0000000000..accdf646f3 --- /dev/null +++ b/ntc_templates/templates/cisco_s300_show_system_id.textfsm @@ -0,0 +1,6 @@ +Value SERIAL_NUMBER (\S+) + +Start + ^\s*Serial\s+number\s*:\s*${SERIAL_NUMBER}\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index cc6dfeb589..9f28e8c7fb 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -379,6 +379,7 @@ cisco_nxos_show_vrf.textfsm, .*, cisco_nxos, sh[[ow]] vrf cisco_s300_show_interfaces_status.textfsm, .*, cisco_s300, sh[[ow]] int[[erfaces]] st[[atus]] cisco_s300_show_mac_address-table.textfsm, .*, cisco_s300, sh[[ow]] mac address-[[table]] cisco_s300_show_lldp_neighbors.textfsm, .*, cisco_s300, sh[[ow]] lld[[p]] neig[[hbors]] +cisco_s300_show_system_id.textfsm, .*, cisco_s300, sh[[ow]] system id cisco_s300_show_version.textfsm, .*, cisco_s300, sh[[ow]] ver[[sion]] cisco_wlc_ssh_show_flexconnect_group_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] fl[[exconnect]] gr[[oup]] s[[ummary]] diff --git a/tests/cisco_s300/show_system_id/cisco_s300_show_system_id.raw b/tests/cisco_s300/show_system_id/cisco_s300_show_system_id.raw new file mode 100644 index 0000000000..f89327e18b --- /dev/null +++ b/tests/cisco_s300/show_system_id/cisco_s300_show_system_id.raw @@ -0,0 +1 @@ +Serial number : IDN123456AA diff --git a/tests/cisco_s300/show_system_id/cisco_s300_show_system_id.yml b/tests/cisco_s300/show_system_id/cisco_s300_show_system_id.yml new file mode 100644 index 0000000000..8737d29bbf --- /dev/null +++ b/tests/cisco_s300/show_system_id/cisco_s300_show_system_id.yml @@ -0,0 +1,3 @@ +--- +parsed_sample: + - serial_number: "IDN123456AA"