From 26addd08744d0eb9cbc9bdeae138e0d2db2f646a Mon Sep 17 00:00:00 2001 From: ansible Date: Sun, 21 Jul 2019 01:45:45 -0700 Subject: [PATCH 1/8] New template cisco_ios_show_snmp_user.template --- templates/cisco_ios_show_snmp_user.template | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 templates/cisco_ios_show_snmp_user.template diff --git a/templates/cisco_ios_show_snmp_user.template b/templates/cisco_ios_show_snmp_user.template new file mode 100644 index 0000000000..fcee69ce9f --- /dev/null +++ b/templates/cisco_ios_show_snmp_user.template @@ -0,0 +1,17 @@ +Value Required USER_NAME (\w+) +Value ENGINE_ID (\w+) +Value STORAGE_TYPE (\w+) +Value STORAGE_TYPE_ACTIVE (\w+) +Value AUTHENTICATION_PROTOCOL (\w+) +Value PRIVACY_PROTOCOL (\w+) +Value GROUP_NAME (\w+) + +Start + ^User\s+name:\s+${USER_NAME}$$ + ^Engine\s+ID:\s+${ENGINE_ID}$$ + ^storage-type:\s${STORAGE_TYPE}\s+${STORAGE_TYPE_ACTIVE}$$ + ^Authentication\s+Protocol:\s+${AUTHENTICATION_PROTOCOL}$$ + ^Privacy\s+Protocol:\s+${PRIVACY_PROTOCOL}$$ + ^Group-name:\s+${GROUP_NAME}$$ -> Record + ^\s*$$ + ^. -> Error From f9f915ab343db7ea9977abd5354072a039eb0837 Mon Sep 17 00:00:00 2001 From: ansible Date: Mon, 22 Jul 2019 21:19:49 +0200 Subject: [PATCH 2/8] Updates index and added .raw and .parsed files for show snmp user command --- templates/index | 1 + .../cisco_ios_show_snmp_user.parsed | 16 ++++++++++++++++ .../show_snmp_user/cisco_ios_show_snmp_user.raw | 14 ++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed create mode 100644 tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw diff --git a/templates/index b/templates/index index a2b4bbc876..4af7c17452 100644 --- a/templates/index +++ b/templates/index @@ -173,6 +173,7 @@ cisco_ios_show_dot1x_all.template, .*, cisco_ios, sh[[ow]] dot1x a[[ll]] cisco_ios_show_inventory.template, .*, cisco_ios, sh[[ow]] inven[[tory]] cisco_ios_show_ip_mroute.template, .*, cisco_ios, sh[[ow]] ip mr[[oute]] cisco_ios_show_route-map.template, .*, cisco_ios, sh[[ow]] route-m[[ap]] +cisco_ios_show_snmp_user.template, .*, cisco_ios, sh[[ow]] sn[[mp]] u[[ser]] cisco_ios_show_ip_route.template, .*, cisco_ios, sh[[ow]] ip r[[oute]] cisco_ios_show_aliases.template, .*, cisco_ios, sh[[ow]] alia[[ses]] cisco_ios_show_archive.template, .*, cisco_ios, sh[[ow]] arc[[hive]] diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed new file mode 100644 index 0000000000..d1c4d029df --- /dev/null +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed @@ -0,0 +1,16 @@ +--- +parsed_sample: +- AUTHENTICATION_PROTOCOL: SHA + ENGINE_ID: 80000009030000451DEC1085 + GROUP_NAME: managerpriv + PRIVACY_PROTOCOL: AES128 + STORAGE_TYPE: nonvolatile + STORAGE_TYPE_ACTIVE: active + USER_NAME: user_snmp1 +- AUTHENTICATION_PROTOCOL: SHA + ENGINE_ID: 80000009030000451DEC1085 + GROUP_NAME: managerpriv + PRIVACY_PROTOCOL: AES128 + STORAGE_TYPE: nonvolatile + STORAGE_TYPE_ACTIVE: active + USER_NAME: user_snmp2 \ No newline at end of file diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw new file mode 100644 index 0000000000..5e5ff0d55f --- /dev/null +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw @@ -0,0 +1,14 @@ + +User name: user_snmp1 +Engine ID: 80000009030000451DEC1085 +storage-type: nonvolatile active +Authentication Protocol: SHA +Privacy Protocol: AES128 +Group-name: managerpriv + +User name: user_snmp2 +Engine ID: 80000009030000451DEC1085 +storage-type: nonvolatile active +Authentication Protocol: SHA +Privacy Protocol: AES128 +Group-name: managerpriv \ No newline at end of file From 7829cbc7564640cdd76e4171347daf8ed3da0bd4 Mon Sep 17 00:00:00 2001 From: ansible Date: Mon, 22 Jul 2019 21:27:53 +0200 Subject: [PATCH 3/8] Added linefeed to eof --- tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed | 2 +- tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed index d1c4d029df..653e8fc4f9 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed @@ -13,4 +13,4 @@ parsed_sample: PRIVACY_PROTOCOL: AES128 STORAGE_TYPE: nonvolatile STORAGE_TYPE_ACTIVE: active - USER_NAME: user_snmp2 \ No newline at end of file + USER_NAME: user_snmp2 diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw index 5e5ff0d55f..baaca1d79d 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw @@ -11,4 +11,4 @@ Engine ID: 80000009030000451DEC1085 storage-type: nonvolatile active Authentication Protocol: SHA Privacy Protocol: AES128 -Group-name: managerpriv \ No newline at end of file +Group-name: managerpriv From 31486e12c5441024dbe4770c71a3721468de10bb Mon Sep 17 00:00:00 2001 From: ansible Date: Mon, 22 Jul 2019 21:39:14 +0200 Subject: [PATCH 4/8] Modified case of .parsed --- .../cisco_ios_show_snmp_user.parsed | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed index 653e8fc4f9..327567b34d 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed @@ -1,16 +1,16 @@ --- parsed_sample: -- AUTHENTICATION_PROTOCOL: SHA - ENGINE_ID: 80000009030000451DEC1085 - GROUP_NAME: managerpriv - PRIVACY_PROTOCOL: AES128 - STORAGE_TYPE: nonvolatile - STORAGE_TYPE_ACTIVE: active - USER_NAME: user_snmp1 -- AUTHENTICATION_PROTOCOL: SHA - ENGINE_ID: 80000009030000451DEC1085 - GROUP_NAME: managerpriv - PRIVACY_PROTOCOL: AES128 - STORAGE_TYPE: nonvolatile - STORAGE_TYPE_ACTIVE: active - USER_NAME: user_snmp2 +- authentication_protocol: SHA + engine_id: 80000009030000451DEC1085 + group_name: managerpriv + privacy_protocol: AES128 + storage_type: nonvolatile + storage_type_active: active + user_name: user_snmp1 +- authentication_protocol: SHA + engine_id: 80000009030000451DEC1085 + group_name: managerpriv + privacy_protocol: AES128 + storage_type: nonvolatile + storage_type_active: active + user_name: user_snmp2 From 37b62ad3f4e7586611405edee81a7b1346e6ffe6 Mon Sep 17 00:00:00 2001 From: ansible Date: Fri, 26 Jul 2019 20:01:57 +0200 Subject: [PATCH 5/8] add access_list to template --- templates/cisco_ios_show_snmp_user.template | 5 +++-- .../cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed | 3 +-- tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/cisco_ios_show_snmp_user.template b/templates/cisco_ios_show_snmp_user.template index fcee69ce9f..32c6e8e3bc 100644 --- a/templates/cisco_ios_show_snmp_user.template +++ b/templates/cisco_ios_show_snmp_user.template @@ -1,7 +1,7 @@ Value Required USER_NAME (\w+) Value ENGINE_ID (\w+) Value STORAGE_TYPE (\w+) -Value STORAGE_TYPE_ACTIVE (\w+) +Value ACCESS_LIST (.*) Value AUTHENTICATION_PROTOCOL (\w+) Value PRIVACY_PROTOCOL (\w+) Value GROUP_NAME (\w+) @@ -9,7 +9,8 @@ Value GROUP_NAME (\w+) Start ^User\s+name:\s+${USER_NAME}$$ ^Engine\s+ID:\s+${ENGINE_ID}$$ - ^storage-type:\s${STORAGE_TYPE}\s+${STORAGE_TYPE_ACTIVE}$$ + ^storage-type:\s${STORAGE_TYPE}\s+active\s+access-list:\s+${ACCESS_LIST}$$ + ^storage-type:\s${STORAGE_TYPE}\s+active$$ ^Authentication\s+Protocol:\s+${AUTHENTICATION_PROTOCOL}$$ ^Privacy\s+Protocol:\s+${PRIVACY_PROTOCOL}$$ ^Group-name:\s+${GROUP_NAME}$$ -> Record diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed index 327567b34d..c5c6d8be88 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed @@ -5,12 +5,11 @@ parsed_sample: group_name: managerpriv privacy_protocol: AES128 storage_type: nonvolatile - storage_type_active: active user_name: user_snmp1 - authentication_protocol: SHA engine_id: 80000009030000451DEC1085 group_name: managerpriv privacy_protocol: AES128 storage_type: nonvolatile - storage_type_active: active + access_list: 10 user_name: user_snmp2 diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw index baaca1d79d..513aede425 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw @@ -8,7 +8,7 @@ Group-name: managerpriv User name: user_snmp2 Engine ID: 80000009030000451DEC1085 -storage-type: nonvolatile active +storage-type: nonvolatile active access-list: 10 Authentication Protocol: SHA Privacy Protocol: AES128 Group-name: managerpriv From c1ada0067ae35eade6bb06114079c31e7bffbb10 Mon Sep 17 00:00:00 2001 From: ansible Date: Fri, 26 Jul 2019 20:09:54 +0200 Subject: [PATCH 6/8] add access_list to template --- tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw index 513aede425..9d0fbff33b 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.raw @@ -8,7 +8,7 @@ Group-name: managerpriv User name: user_snmp2 Engine ID: 80000009030000451DEC1085 -storage-type: nonvolatile active access-list: 10 +storage-type: nonvolatile active access-list: 10 Authentication Protocol: SHA Privacy Protocol: AES128 Group-name: managerpriv From 7c884f059187352ea3000496106fabff81c1cb72 Mon Sep 17 00:00:00 2001 From: ansible Date: Fri, 26 Jul 2019 20:13:41 +0200 Subject: [PATCH 7/8] add access_list to template --- .../show_snmp_user/cisco_ios_show_snmp_user.parsed | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed index c5c6d8be88..bb16fd0dbf 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed @@ -1,15 +1,16 @@ --- parsed_sample: -- authentication_protocol: SHA +- access_list: '' + authentication_protocol: SHA engine_id: 80000009030000451DEC1085 group_name: managerpriv privacy_protocol: AES128 storage_type: nonvolatile user_name: user_snmp1 -- authentication_protocol: SHA +- access_list: 10 + authentication_protocol: SHA engine_id: 80000009030000451DEC1085 group_name: managerpriv privacy_protocol: AES128 storage_type: nonvolatile - access_list: 10 user_name: user_snmp2 From 08bfd2b571eb9c02c69ec29d73549305f5f9116b Mon Sep 17 00:00:00 2001 From: ansible Date: Fri, 26 Jul 2019 20:16:34 +0200 Subject: [PATCH 8/8] add access_list to template --- tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed index bb16fd0dbf..9aa4915131 100644 --- a/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed +++ b/tests/cisco_ios/show_snmp_user/cisco_ios_show_snmp_user.parsed @@ -7,7 +7,7 @@ parsed_sample: privacy_protocol: AES128 storage_type: nonvolatile user_name: user_snmp1 -- access_list: 10 +- access_list: '10' authentication_protocol: SHA engine_id: 80000009030000451DEC1085 group_name: managerpriv