From 6806fc34565ceecb4fc389deee4f92811f170c6c Mon Sep 17 00:00:00 2001 From: georgesnow Date: Fri, 8 May 2020 12:16:39 -0400 Subject: [PATCH] New Template: ciena_saos_ssh_server_show_key.textfsm (#693) --- templates/ciena_saos_ssh_server_show_key.textfsm | 12 ++++++++++++ templates/index | 1 + .../ciena_saos_ssh_server_show_key.raw | 11 +++++++++++ .../ciena_saos_ssh_server_show_key.yml | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 templates/ciena_saos_ssh_server_show_key.textfsm create mode 100644 tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.raw create mode 100644 tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.yml diff --git a/templates/ciena_saos_ssh_server_show_key.textfsm b/templates/ciena_saos_ssh_server_show_key.textfsm new file mode 100644 index 0000000000..12c87c0fb2 --- /dev/null +++ b/templates/ciena_saos_ssh_server_show_key.textfsm @@ -0,0 +1,12 @@ +Value USERNAME (\S+) +Value KEY_STATUS (\S+) + +Start + # Accounts for tabular delineations and table names + ^\+\- + # Account for SSH Server Key block + ^\|\s+[Kk]ey + ^\|\s+[Uu]sername.*[Kk]ey\s+[Ss]tatus + ^\|\s*${USERNAME}\s*\S*\s*\|\s*${KEY_STATUS}\s*\| -> Record + ^\s*$$ + ^. -> Error \ No newline at end of file diff --git a/templates/index b/templates/index index 1086f1d2a9..70e7285b8e 100644 --- a/templates/index +++ b/templates/index @@ -106,6 +106,7 @@ checkpoint_gaia_show_lom.textfsm, .*, checkpoint_gaia, show lom checkpoint_gaia_fw_stat.textfsm, .*, checkpoint_gaia, fw stat ciena_saos_chassis_show_temperature.textfsm, .*, ciena_saos, ch[[assis]] sh[[ow]] te[[mperature]] +ciena_saos_ssh_server_show_key.textfsm, .*, ciena_saos, ssh se[[rver]] sh[[ow]] k[[ey]] ciena_saos_software_show.textfsm, .*, ciena_saos, so[[ftware]] sh[[ow]] ciena_saos_port_show.textfsm, .*, ciena_saos, po[[rt]] sh[[ow]] ciena_saos_rstp_show.textfsm, .*, ciena_saos, rs[[tp]] sh[[ow]] diff --git a/tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.raw b/tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.raw new file mode 100644 index 0000000000..426a645c7c --- /dev/null +++ b/tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.raw @@ -0,0 +1,11 @@ ++---------------------------- SSH SERVER KEY --------------------------------+ +| Key Status | Generated | +| Key Fingerprint [MD5] | 1a:1d:1c:1e:da:11:1d:1d:11:aa:11:11:11:a1:11:1c | ++-------------------------+--------------------------------------------------+ + ++------------------------ SSH PUBLIC KEY AUTHENTICATION USERS ------------------------+ +| Username | Key Status | ++----------------------------------+--------------------------------------------------+ +| abc1 | installed | +| abc2 | installed | ++----------------------------------+--------------------------------------------------+ diff --git a/tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.yml b/tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.yml new file mode 100644 index 0000000000..27aa37b6f8 --- /dev/null +++ b/tests/ciena_saos/ssh_server_show_key/ciena_saos_ssh_server_show_key.yml @@ -0,0 +1,6 @@ +--- +parsed_sample: + - username: "abc1" + key_status: "installed" + - username: "abc2" + key_status: "installed"