diff options
author | Gaige B Paulsen <gaige@cluetrust.com> | 2024-12-30 06:51:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-30 06:51:56 -0500 |
commit | dbd87e3ab89b7839e41df76c2fa7712855853fd3 (patch) | |
tree | 4e4f6d04277efcfcb1b747e72bf53cdb2ac0dec6 | |
parent | cae1c6cc42fa786095433692a6d685f029bbde2e (diff) | |
download | vyos.vyos-dbd87e3ab89b7839e41df76c2fa7712855853fd3.tar.gz vyos.vyos-dbd87e3ab89b7839e41df76c2fa7712855853fd3.zip |
T6982: update SNMP module for 1.3+ (#369)
* fix: get SNMP integration tests running
* fix: remove no_log from docs because it fails sanity
* tests: fix unit tests and no_log args
* tests: fix error in hostname integration test
16 files changed, 126 insertions, 183 deletions
diff --git a/changelogs/fragments/snmp_server.yml b/changelogs/fragments/snmp_server.yml new file mode 100644 index 00000000..b771a440 --- /dev/null +++ b/changelogs/fragments/snmp_server.yml @@ -0,0 +1,10 @@ +--- +minor_changes: + - 192.0.2.1/24 (TEST-NET-1) is used on eth1 for testing to accomodate services that check + valid configurations (such as SNMP) + - use encrypted passwords for SNMPv3 tests as VyOS now converts those "when next reloaded" + - fixed integration tests for 1.3+ for `vyos_hostname` +breaking_changes: + - parameter `engine_id` is no longer a `user` or `trap_target` parameter and is now a `snmp_v3` parameter + - parameters `encrypted-key` and `plaintext-key` are now `encrypted-password` and `puplaintext-password` + which is a breaking change with 1.2 and prior diff --git a/docs/vyos.vyos.vyos_snmp_server_module.rst b/docs/vyos.vyos.vyos_snmp_server_module.rst index 9e15b8f5..d11afaae 100644 --- a/docs/vyos.vyos.vyos_snmp_server_module.rst +++ b/docs/vyos.vyos.vyos_snmp_server_module.rst @@ -510,24 +510,6 @@ Parameters <td class="elbow-placeholder"></td> <td colspan="2"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>engine_id</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - </div> - </td> - <td> - </td> - <td> - <div>Defines the engineID.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> <b>port</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> @@ -670,60 +652,6 @@ Parameters <td class="elbow-placeholder"></td> <td colspan="3"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>tsm</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>Specifies that the snmpd uses encryption</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>local_key</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - </div> - </td> - <td> - </td> - <td> - <div>Defines the server certificate fingerprint or key-file name.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>port</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">integer</span> - </div> - </td> - <td> - </td> - <td> - <div>Defines the port for tsm.</div> - </td> - </tr> - - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> <b>users</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> @@ -823,24 +751,6 @@ Parameters <td class="elbow-placeholder"></td> <td colspan="2"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>engine_id</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - </div> - </td> - <td> - </td> - <td> - <div>Defines the engineID.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> <b>group</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> @@ -1218,7 +1128,7 @@ Notes ----- .. note:: - - Tested against vyos 1.3.8 + - Tested against vyos 1.3.8, 1.4.1 - This module works with connection ``network_cli``. - The Configuration defaults of the Vyos network devices are supposed to hinder idempotent behavior of plays diff --git a/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py b/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py index 7d0fefec..b94c2639 100644 --- a/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py +++ b/plugins/module_utils/network/vyos/argspec/snmp_server/snmp_server.py @@ -108,7 +108,6 @@ class Snmp_serverArgs(object): # pylint: disable=R0903 }, }, }, - "engine_id": {"type": "str"}, "port": {"type": "int"}, "privacy": { "type": "dict", @@ -137,13 +136,6 @@ class Snmp_serverArgs(object): # pylint: disable=R0903 }, }, }, - "tsm": { - "type": "dict", - "options": { - "local_key": {"type": "str", "no_log": True}, - "port": {"type": "int"}, - }, - }, "users": { "type": "list", "elements": "dict", @@ -166,7 +158,6 @@ class Snmp_serverArgs(object): # pylint: disable=R0903 }, }, }, - "engine_id": {"type": "str"}, "group": {"type": "str"}, "mode": {"type": "str", "choices": ["ro", "rw"]}, "privacy": { diff --git a/plugins/module_utils/network/vyos/rm_templates/snmp_server.py b/plugins/module_utils/network/vyos/rm_templates/snmp_server.py index 724be228..71753083 100644 --- a/plugins/module_utils/network/vyos/rm_templates/snmp_server.py +++ b/plugins/module_utils/network/vyos/rm_templates/snmp_server.py @@ -82,9 +82,9 @@ def _tmplt_snmp_server_v3_trap_target(config_data): if "type" in config_data: command += " type {mode}".format(**config_data) if "encrypted_key" in config_data: - command += " encrypted-key {encrypted_key}".format(**config_data) + command += " encrypted-password {encrypted_key}".format(**config_data) if "plaintext_key" in config_data: - command += " plaintext-key {plaintext_key}".format(**config_data) + command += " plaintext-password {plaintext_key}".format(**config_data) return command @@ -103,10 +103,10 @@ def _tmplt_snmp_server_v3_user(config_data): type_cmd = cmd + val + " type {type}".format(**config) command.append(type_cmd) if "encrypted_key" in config: - enc_cmd = cmd + val + " encrypted-key {encrypted_key}".format(**config) + enc_cmd = cmd + val + " encrypted-password {encrypted_key}".format(**config) command.append(enc_cmd) if "plaintext_key" in config: - plain_cmd = cmd + val + " plaintext-key {plaintext_key}".format(**config) + plain_cmd = cmd + val + " plaintext-password {plaintext_key}".format(**config) command.append(plain_cmd) return command @@ -329,8 +329,8 @@ class Snmp_serverTemplate(NetworkTemplate): ^set\sservice\ssnmp\sv3\strap-target \s+(?P<name>\S+) \s+auth - \s*(?P<enc>encrypted-key\s\S+)* - \s*(?P<plain>plaintext-key\s\S+)* + \s*(?P<enc>encrypted-password\s\S+)* + \s*(?P<plain>plaintext-password\s\S+)* \s*(?P<type>type\s\S+)* $""", re.VERBOSE, @@ -451,8 +451,8 @@ class Snmp_serverTemplate(NetworkTemplate): ^set\sservice\ssnmp\sv3\strap-target \s+(?P<name>\S+) \s+privacy - \s*(?P<enc>encrypted-key\s\S+)* - \s*(?P<plain>plaintext-key\s\S+)* + \s*(?P<enc>encrypted-password\s\S+)* + \s*(?P<plain>plaintext-password\s\S+)* \s*(?P<type>type\s\S+)* $""", re.VERBOSE, @@ -481,8 +481,8 @@ class Snmp_serverTemplate(NetworkTemplate): ^set\sservice\ssnmp\sv3\suser \s+(?P<name>\S+) \s+auth - \s*(?P<enc>encrypted-key\s\S+)* - \s*(?P<plain>plaintext-key\s\S+)* + \s*(?P<enc>encrypted-password\s\S+)* + \s*(?P<plain>plaintext-password\s\S+)* \s*(?P<type>type\s\S+)* $""", re.VERBOSE, @@ -511,8 +511,8 @@ class Snmp_serverTemplate(NetworkTemplate): ^set\sservice\ssnmp\sv3\suser \s+(?P<name>\S+) \s+privacy - \s*(?P<enc>encrypted-key\s\S+)* - \s*(?P<plain>plaintext-key\s\S+)* + \s*(?P<enc>encrypted-password\s\S+)* + \s*(?P<plain>plaintext-password\s\S+)* \s*(?P<type>type\s\S+)* $""", re.VERBOSE, diff --git a/plugins/modules/vyos_snmp_server.py b/plugins/modules/vyos_snmp_server.py index 87ddb794..f574919a 100644 --- a/plugins/modules/vyos_snmp_server.py +++ b/plugins/modules/vyos_snmp_server.py @@ -20,7 +20,7 @@ short_description: Manages snmp_server resource module description: This module manages the snmp server attributes of Vyos network devices author: Gomathi Selvi Srinivasan (@GomathiselviS) notes: - - Tested against vyos 1.3.8 + - Tested against vyos 1.3.8, 1.4.1 - This module works with connection C(network_cli). - The Configuration defaults of the Vyos network devices are supposed to hinder idempotent behavior of plays @@ -136,9 +136,6 @@ options: plaintext_key: description: Defines the clear text password for authentication type: str - engine_id: - description: Defines the engineID. - type: str port: description: Specifies the TCP/UDP port of a destination for SNMP traps/informs. type: int @@ -164,16 +161,6 @@ options: description: Specifies the type of notification between inform and trap type: str choices: ['inform', 'trap'] - tsm: - description: Specifies that the snmpd uses encryption - type: dict - suboptions: - local_key: - description: Defines the server certificate fingerprint or key-file name. - type: str - port: - description: Defines the port for tsm. - type: int users: description: Defines username for authentication type: list @@ -196,9 +183,6 @@ options: plaintext_key: description: Defines the clear text password for authentication type: str - engine_id: - description: Defines the engineID. - type: str group: description: Specifies group for user name type: str diff --git a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml index 2ed8d8cf..5800a582 100644 --- a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml +++ b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml @@ -5,7 +5,7 @@ set interfaces ethernet eth0 address dhcp set interfaces ethernet eth0 speed auto set interfaces ethernet eth0 duplex auto - set interfaces ethernet eth1 + set interfaces ethernet eth1 address 192.0.2.1/24 set interfaces ethernet eth2 delete interfaces loopback lo ignore_errors: "{{ result.failed }}" diff --git a/tests/integration/targets/vyos_hostname/tests/cli/_remove_config.yaml b/tests/integration/targets/vyos_hostname/tests/cli/_remove_config.yaml index 9850e2f3..3c1bf09b 100644 --- a/tests/integration/targets/vyos_hostname/tests/cli/_remove_config.yaml +++ b/tests/integration/targets/vyos_hostname/tests/cli/_remove_config.yaml @@ -1,8 +1,8 @@ --- -- name: Delete Hostname vyosuser +- name: Delete Hostname vyos.vyos.vyos_config: lines: - - delete system host-name 'vyosuser' + - delete system host-name ignore_errors: true vars: ansible_connection: ansible.netcommon.network_cli diff --git a/tests/integration/targets/vyos_snmp_server/tests/cli/_parsed.cfg b/tests/integration/targets/vyos_snmp_server/tests/cli/_parsed.cfg index 9750253c..493842df 100644 --- a/tests/integration/targets/vyos_snmp_server/tests/cli/_parsed.cfg +++ b/tests/integration/targets/vyos_snmp_server/tests/cli/_parsed.cfg @@ -11,9 +11,9 @@ set service snmp trap-target 203.0.113.10 set service snmp v3 engineid '000000000000000000000002' set service snmp v3 group default mode 'ro' set service snmp v3 group default view 'default' -set service snmp v3 user vyos auth plaintext-key 'vyos12345678' +set service snmp v3 user vyos auth plaintext-password 'vyos12345678' set service snmp v3 user vyos auth type 'sha' set service snmp v3 user vyos group 'default' -set service snmp v3 user vyos privacy plaintext-key 'vyos12345678' +set service snmp v3 user vyos privacy plaintext-password 'vyos12345678' set service snmp v3 user vyos privacy type 'aes' set service snmp v3 view default oid 1 diff --git a/tests/integration/targets/vyos_snmp_server/tests/cli/_populate_config.yaml b/tests/integration/targets/vyos_snmp_server/tests/cli/_populate_config.yaml index f4d89f55..f8aa82e8 100644 --- a/tests/integration/targets/vyos_snmp_server/tests/cli/_populate_config.yaml +++ b/tests/integration/targets/vyos_snmp_server/tests/cli/_populate_config.yaml @@ -2,16 +2,21 @@ - name: setup vyos.vyos.vyos_config: lines: + - set interface ethernet eth2 address 20.1.1.1/24 - set service snmp community switches authorization rw - set service snmp community bridges client 1.1.1.1 - set service snmp community bridges client 12.1.1.10 - set service snmp listen-address 20.1.1.1 - - set service snmp listen-address 100.1.2.1 port 33 - - set service snmp v3 user adminuser engineid 33 + - set service snmp listen-address 192.0.2.1 port 33 + - set service snmp v3 engineid 33 + - set service snmp v3 group testgroup mode ro + - set service snmp v3 group testgroup view default + - set service snmp v3 view default oid 1 - set service snmp v3 user adminuser auth type sha - - set service snmp v3 user adminuser auth plaintext-key abc1234567 + - set service snmp v3 user adminuser auth plaintext-password abc1234567 - set service snmp v3 user adminuser privacy type aes - - set service snmp v3 user adminuser privacy plaintext-key abc1234567 + - set service snmp v3 user adminuser privacy plaintext-password abc1234567 + - set service snmp v3 user adminuser group testgroup - set service snmp contact admin2@ex.com ignore_errors: true vars: diff --git a/tests/integration/targets/vyos_snmp_server/tests/cli/merged.yaml b/tests/integration/targets/vyos_snmp_server/tests/cli/merged.yaml index 7f8139d0..991cb42d 100644 --- a/tests/integration/targets/vyos_snmp_server/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_snmp_server/tests/cli/merged.yaml @@ -17,25 +17,36 @@ contact: admin2@ex.com listen_addresses: - address: 20.1.1.1 - - address: 100.1.2.1 + - address: 192.0.2.1 port: 33 snmp_v3: + views: + - view: default + oid: 1 + groups: + - group: testgroup + mode: ro + view: default users: - user: adminuser authentication: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: sha privacy: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: aes + group: testgroup state: merged - vyos.vyos.vyos_facts: gather_network_resources: snmp_server + - debug: + var: result.commands|symmetric_difference(merged.commands) + - assert: that: - - result.commands|length == 10 + - result.commands|length == merged.commands|length - result.changed == true - result.commands|symmetric_difference(merged.commands) == [] - result.after == ansible_facts['network_resources']['snmp_server'] diff --git a/tests/integration/targets/vyos_snmp_server/tests/cli/overridden.yaml b/tests/integration/targets/vyos_snmp_server/tests/cli/overridden.yaml index 2dc6edae..83536ad4 100644 --- a/tests/integration/targets/vyos_snmp_server/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_snmp_server/tests/cli/overridden.yaml @@ -16,25 +16,31 @@ networks: [1.1.1.0/24, 12.1.1.0/24] location: RDU listen_addresses: - - address: 100.1.2.1 + - address: 192.0.2.1 port: 33 snmp_v3: + engine_id: "33" + groups: + - group: testgroup + mode: ro + view: default users: - user: adminuser - engine_id: "33" authentication: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: sha privacy: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: aes + group: testgroup - user: guestuser2 authentication: - plaintext_key: opq1234567 + encrypted_key: a1aadc2ed9912c6176939ce995367861012450a3 type: sha privacy: - plaintext_key: opq1234567 + encrypted_key: a1aadc2ed9912c6176939ce995367861012450a3 type: aes + group: testgroup views: - view: default oid: 1 diff --git a/tests/integration/targets/vyos_snmp_server/tests/cli/rendered.yaml b/tests/integration/targets/vyos_snmp_server/tests/cli/rendered.yaml index f3d92546..17334e4e 100644 --- a/tests/integration/targets/vyos_snmp_server/tests/cli/rendered.yaml +++ b/tests/integration/targets/vyos_snmp_server/tests/cli/rendered.yaml @@ -17,17 +17,25 @@ contact: admin2@ex.com listen_addresses: - address: 20.1.1.1 - - address: 100.1.2.1 + - address: 192.0.2.1 port: 33 snmp_v3: + views: + - view: default + oid: 1 + groups: + - group: testgroup + mode: ro + view: default users: - user: adminuser authentication: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: sha privacy: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: aes + group: testgroup state: rendered - assert: diff --git a/tests/integration/targets/vyos_snmp_server/tests/cli/replaced.yaml b/tests/integration/targets/vyos_snmp_server/tests/cli/replaced.yaml index 3b759922..e4270c53 100644 --- a/tests/integration/targets/vyos_snmp_server/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_snmp_server/tests/cli/replaced.yaml @@ -16,25 +16,31 @@ networks: [1.1.1.0/24, 12.1.1.0/24] location: RDU listen_addresses: - - address: 100.1.2.1 + - address: 192.0.2.1 port: 33 snmp_v3: + engine_id: "33" + groups: + - group: testgroup + mode: ro + view: default users: - user: adminuser - engine_id: "33" authentication: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: sha privacy: - plaintext_key: abc1234567 + encrypted_key: 33f8bfd6b69ee03a184818a4daea503c9e579633 type: aes + group: testgroup - user: guestuser2 authentication: - plaintext_key: opq1234567 + encrypted_key: a1aadc2ed9912c6176939ce995367861012450a3 type: sha privacy: - plaintext_key: opq1234567 + encrypted_key: a1aadc2ed9912c6176939ce995367861012450a3 type: aes + group: testgroup views: - view: default oid: 1 diff --git a/tests/integration/targets/vyos_snmp_server/vars/main.yaml b/tests/integration/targets/vyos_snmp_server/vars/main.yaml index 3034390f..4560271f 100644 --- a/tests/integration/targets/vyos_snmp_server/vars/main.yaml +++ b/tests/integration/targets/vyos_snmp_server/vars/main.yaml @@ -6,11 +6,15 @@ merged: - set service snmp community bridges client 1.1.1.1 - set service snmp community bridges client 12.1.1.10 - set service snmp listen-address 20.1.1.1 - - set service snmp listen-address 100.1.2.1 port 33 + - set service snmp listen-address 192.0.2.1 port 33 + - set service snmp v3 group testgroup mode ro + - set service snmp v3 group testgroup view default - set service snmp v3 user adminuser auth type sha - - set service snmp v3 user adminuser auth plaintext-key ******** + - set service snmp v3 user adminuser auth encrypted-password ******** - set service snmp v3 user adminuser privacy type aes - - set service snmp v3 user adminuser privacy plaintext-key ******** + - set service snmp v3 user adminuser privacy encrypted-password ******** + - set service snmp v3 user adminuser group testgroup + - set service snmp v3 view default oid 1 - set service snmp contact admin2@ex.com after: communities: @@ -22,18 +26,26 @@ merged: name: switches contact: admin2@ex.com listen_addresses: - - address: 100.1.2.1 + - address: 192.0.2.1 port: 33 - address: 20.1.1.1 snmp_v3: + groups: + - group: testgroup + mode: ro + view: default users: - - authentication: - plaintext_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER + - user: adminuser + authentication: + encrypted_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER type: sha privacy: - plaintext_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER + encrypted_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER type: aes - user: adminuser + group: testgroup + views: + - view: default + oid: "1" overridden: commands: @@ -45,9 +57,9 @@ overridden: - set service snmp community bridges network 1.1.1.0/24 - set service snmp community bridges network 12.1.1.0/24 - set service snmp v3 user guestuser2 auth type sha - - set service snmp v3 user guestuser2 auth plaintext-key ******** + - set service snmp v3 user guestuser2 auth encrypted-password ******** - set service snmp v3 user guestuser2 privacy type aes - - set service snmp v3 user guestuser2 privacy plaintext-key ******** + - set service snmp v3 user guestuser2 privacy encrypted-password ******** - set service snmp v3 view default oid 1 - set service snmp location \'RDU\' @@ -65,17 +77,17 @@ overridden: snmp_v3: users: - authentication: - plaintext_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER + encrypted_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER type: sha privacy: - plaintext_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER + encrypted_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER type: aes user: adminuser - authentication: - plaintext_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER + encrypted_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER type: sha privacy: - plaintext_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER + encrypted_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER type: aes user: guestuser2 views: diff --git a/tests/unit/modules/network/vyos/fixtures/vyos_snmp_server_config.cfg b/tests/unit/modules/network/vyos/fixtures/vyos_snmp_server_config.cfg index 689b18e2..957af9d4 100644 --- a/tests/unit/modules/network/vyos/fixtures/vyos_snmp_server_config.cfg +++ b/tests/unit/modules/network/vyos/fixtures/vyos_snmp_server_config.cfg @@ -2,11 +2,11 @@ set service snmp community bridges network 1.1.1.0/24 set service snmp community bridges network 12.1.1.0/24 set service snmp listen-address 100.1.2.1 port 33 set service snmp location RDU, NC -set service snmp v3 user admin_user auth plaintext-key abc1234567 +set service snmp v3 user admin_user auth plaintext-password abc1234567 set service snmp v3 user admin_user auth type sha -set service snmp v3 user admin_user privacy plaintext-key abc1234567 +set service snmp v3 user admin_user privacy plaintext-password abc1234567 set service snmp v3 user admin_user privacy type aes -set service snmp v3 user guest_user auth plaintext-key opq1234567 +set service snmp v3 user guest_user auth plaintext-password opq1234567 set service snmp v3 user guest_user auth type sha -set service snmp v3 user guest_user privacy plaintext-key opq1234567 +set service snmp v3 user guest_user privacy plaintext-password opq1234567 set service snmp v3 user guest_user privacy type aes diff --git a/tests/unit/modules/network/vyos/test_vyos_snmp_server.py b/tests/unit/modules/network/vyos/test_vyos_snmp_server.py index 43144653..9ac650bf 100644 --- a/tests/unit/modules/network/vyos/test_vyos_snmp_server.py +++ b/tests/unit/modules/network/vyos/test_vyos_snmp_server.py @@ -276,13 +276,13 @@ class TestVyosSnmpServerModule(TestVyosModule): "set service snmp v3 group default seclevel priv", "set service snmp v3 group default view view1", "delete service snmp v3 user admin_user auth type sha", - "delete service snmp v3 user admin_user auth plaintext-key abc1234567", + "delete service snmp v3 user admin_user auth plaintext-password abc1234567", "delete service snmp v3 user admin_user privacy type aes", - "delete service snmp v3 user admin_user privacy plaintext-key abc1234567", + "delete service snmp v3 user admin_user privacy plaintext-password abc1234567", "delete service snmp v3 user guest_user auth type sha", - "delete service snmp v3 user guest_user auth plaintext-key opq1234567", + "delete service snmp v3 user guest_user auth plaintext-password opq1234567", "delete service snmp v3 user guest_user privacy type aes", - "delete service snmp v3 user guest_user privacy plaintext-key opq1234567", + "delete service snmp v3 user guest_user privacy plaintext-password opq1234567", "set service snmp v3 engineid 34", "set service snmp contact admin@example.com", "set service snmp description snmp_config", @@ -345,13 +345,13 @@ class TestVyosSnmpServerModule(TestVyosModule): "set service snmp v3 group default seclevel priv", "set service snmp v3 group default view view1", "delete service snmp v3 user admin_user auth type sha", - "delete service snmp v3 user admin_user auth plaintext-key abc1234567", + "delete service snmp v3 user admin_user auth plaintext-password abc1234567", "delete service snmp v3 user admin_user privacy type aes", - "delete service snmp v3 user admin_user privacy plaintext-key abc1234567", + "delete service snmp v3 user admin_user privacy plaintext-password abc1234567", "delete service snmp v3 user guest_user auth type sha", - "delete service snmp v3 user guest_user auth plaintext-key opq1234567", + "delete service snmp v3 user guest_user auth plaintext-password opq1234567", "delete service snmp v3 user guest_user privacy type aes", - "delete service snmp v3 user guest_user privacy plaintext-key opq1234567", + "delete service snmp v3 user guest_user privacy plaintext-password opq1234567", "set service snmp v3 engineid 34", "set service snmp contact admin@example.com", "set service snmp description snmp_config", |