diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:04:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:04:41 +0000 |
commit | 975f66f2eebe9dadba04f275774d4ab83f74cf25 (patch) | |
tree | 89bd26a93aaae6a25749145b7e4bca4a1e75b2be /ansible_collections/community/ciscosmb/tests | |
parent | Initial commit. (diff) | |
download | ansible-975f66f2eebe9dadba04f275774d4ab83f74cf25.tar.xz ansible-975f66f2eebe9dadba04f275774d4ab83f74cf25.zip |
Adding upstream version 7.7.0+dfsg.upstream/7.7.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/ciscosmb/tests')
67 files changed, 4877 insertions, 0 deletions
diff --git a/ansible_collections/community/ciscosmb/tests/requirements.yml b/ansible_collections/community/ciscosmb/tests/requirements.yml new file mode 100644 index 000000000..34c53caf0 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/requirements.yml @@ -0,0 +1,4 @@ +integration_tests_dependencies: + - ansible.netcommon +unit_tests_dependencies: + - ansible.netcommon diff --git a/ansible_collections/community/ciscosmb/tests/unit/__init__.py b/ansible_collections/community/ciscosmb/tests/unit/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/__init__.py diff --git a/ansible_collections/community/ciscosmb/tests/unit/compat/__init__.py b/ansible_collections/community/ciscosmb/tests/unit/compat/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/compat/__init__.py diff --git a/ansible_collections/community/ciscosmb/tests/unit/compat/builtins.py b/ansible_collections/community/ciscosmb/tests/unit/compat/builtins.py new file mode 100644 index 000000000..d25715528 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/compat/builtins.py @@ -0,0 +1,20 @@ +# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com> +# +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type diff --git a/ansible_collections/community/ciscosmb/tests/unit/compat/mock.py b/ansible_collections/community/ciscosmb/tests/unit/compat/mock.py new file mode 100644 index 000000000..0972cd2e8 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/compat/mock.py @@ -0,0 +1,122 @@ +# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com> +# +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +''' +Compat module for Python3.x's unittest.mock module +''' +import sys + +# Python 2.7 + +# Note: Could use the pypi mock library on python3.x as well as python2.x. It +# is the same as the python3 stdlib mock library + +try: + # Allow wildcard import because we really do want to import all of mock's + # symbols into this compat shim + # pylint: disable=wildcard-import,unused-wildcard-import + from unittest.mock import * +except ImportError: + # Python 2 + # pylint: disable=wildcard-import,unused-wildcard-import + try: + from mock import * + except ImportError: + print('You need the mock library installed on python2.x to run tests') + + +# Prior to 3.4.4, mock_open cannot handle binary read_data +if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): + file_spec = None + + def _iterate_read_data(read_data): + # Helper for mock_open: + # Retrieve lines from read_data via a generator so that separate calls to + # readline, read, and readlines are properly interleaved + sep = b'\n' if isinstance(read_data, bytes) else '\n' + data_as_list = [l + sep for l in read_data.split(sep)] + + if data_as_list[-1] == sep: + # If the last line ended in a newline, the list comprehension will have an + # extra entry that's just a newline. Remove this. + data_as_list = data_as_list[:-1] + else: + # If there wasn't an extra newline by itself, then the file being + # emulated doesn't have a newline to end the last line remove the + # newline that our naive format() added + data_as_list[-1] = data_as_list[-1][:-1] + + for line in data_as_list: + yield line + + def mock_open(mock=None, read_data=''): + """ + A helper function to create a mock to replace the use of `open`. It works + for `open` called directly or used as a context manager. + + The `mock` argument is the mock object to configure. If `None` (the + default) then a `MagicMock` will be created for you, with the API limited + to methods or attributes available on standard file handles. + + `read_data` is a string for the `read` methoddline`, and `readlines` of the + file handle to return. This is an empty string by default. + """ + def _readlines_side_effect(*args, **kwargs): + if handle.readlines.return_value is not None: + return handle.readlines.return_value + return list(_data) + + def _read_side_effect(*args, **kwargs): + if handle.read.return_value is not None: + return handle.read.return_value + return type(read_data)().join(_data) + + def _readline_side_effect(): + if handle.readline.return_value is not None: + while True: + yield handle.readline.return_value + for line in _data: + yield line + + global file_spec + if file_spec is None: + import _io + file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO)))) + + if mock is None: + mock = MagicMock(name='open', spec=open) + + handle = MagicMock(spec=file_spec) + handle.__enter__.return_value = handle + + _data = _iterate_read_data(read_data) + + handle.write.return_value = None + handle.read.return_value = None + handle.readline.return_value = None + handle.readlines.return_value = None + + handle.read.side_effect = _read_side_effect + handle.readline.side_effect = _readline_side_effect() + handle.readlines.side_effect = _readlines_side_effect + + mock.return_value = handle + return mock diff --git a/ansible_collections/community/ciscosmb/tests/unit/compat/unittest.py b/ansible_collections/community/ciscosmb/tests/unit/compat/unittest.py new file mode 100644 index 000000000..98f08ad6a --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/compat/unittest.py @@ -0,0 +1,38 @@ +# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com> +# +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +''' +Compat module for Python2.7's unittest module +''' + +import sys + +# Allow wildcard import because we really do want to import all of +# unittests's symbols into this compat shim +# pylint: disable=wildcard-import,unused-wildcard-import +if sys.version_info < (2, 7): + try: + # Need unittest2 on python2.6 + from unittest2 import * + except ImportError: + print('You need unittest2 installed on python2.6.x to run tests') +else: + from unittest import * diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/__init__.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/__init__.py diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/__init__.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/__init__.py diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/__init__.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/__init__.py diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/ciscosmb_module.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/ciscosmb_module.py new file mode 100644 index 000000000..9bbaaa252 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/ciscosmb_module.py @@ -0,0 +1,88 @@ +# (c) 2016 Red Hat Inc. +# +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +import os +import json + +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase + + +fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') +fixture_data = {} + + +def load_fixture(name): + path = os.path.join(fixture_path, name) + + if path in fixture_data: + return fixture_data[path] + + with open(path) as f: + data = f.read() + + try: + data = json.loads(data) + except Exception: + pass + + fixture_data[path] = data + return data + + +class TestCiscoSMBModule(ModuleTestCase): + + def execute_module(self, failed=False, changed=False, commands=None, sort=True, defaults=False): + + self.load_fixtures(commands) + + if failed: + result = self.failed() + self.assertTrue(result['failed'], result) + else: + result = self.changed(changed) + self.assertEqual(result['changed'], changed, result) + + if commands is not None: + if sort: + self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) + else: + self.assertEqual(commands, result['commands'], result['commands']) + + return result + + def failed(self): + with self.assertRaises(AnsibleFailJson) as exc: + self.module.main() + + result = exc.exception.args[0] + self.assertTrue(result['failed'], result) + return result + + def changed(self, changed=False): + with self.assertRaises(AnsibleExitJson) as exc: + self.module.main() + + result = exc.exception.args[0] + self.assertEqual(result['changed'], changed, result) + return result + + def load_fixtures(self, commands=None): + pass diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-CBS350-24P-4G-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-CBS350-24P-4G-show_version new file mode 100644 index 000000000..bcb9b2d5a --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-CBS350-24P-4G-show_version @@ -0,0 +1,10 @@ +Active-image: flash://system/images/image1.bin + Version: 3.0.0.61 + MD5 Digest: 9703a2dea9e4c07c5cb22bc6c0235bcf + Date: 18-Jun-2020 + Time: 20:38:40 +Inactive-image: flash://system/images/_image1.bin + Version: 3.0.0.61 + MD5 Digest: 9703a2dea9e4c07c5cb22bc6c0235bcf + Date: 18-Jun-2020 + Time: 20:38:40 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG350-28-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG350-28-K9-show_version new file mode 100644 index 000000000..c17f21e07 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG350-28-K9-show_version @@ -0,0 +1,11 @@ +Active-image: flash://system/images/image_tesla_hybrid_2.4.5.71_release_cisco_signed.bin + Version: 2.4.5.71 + MD5 Digest: 2dff89efdb2a0ec2f9a2c414ff7d401c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.2.8.4 + MD5 Digest: d75d9f2e1a06e99ba793af2418470df1 + Date: 21-Dec-2016 + Time: 22:03:09 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG500-52-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG500-52-K9-show_version new file mode 100644 index 000000000..73037a269 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG500-52-K9-show_version @@ -0,0 +1,3 @@ +SW version 1.4.8.6 ( date 10-Jul-2017 time 17:07:33 ) +Boot version 1.3.7.01 ( date 04-Dec-2013 time 13:48:27 ) +HW version V02 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG550X-24MP-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG550X-24MP-K9-show_version new file mode 100644 index 000000000..e6a0a6308 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-SG550X-24MP-K9-show_version @@ -0,0 +1,10 @@ +Active-image: flash://system/images/sx550X_tesla_hybrid_2.4.5.71_release_cisco_signed.bin + Version: 2.4.5.71 + MD5 Digest: 2dff89efdb2a0ec2f9a2c414ff7d401c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.3.0.130 + MD5 Digest: 079b10248b0cc997da651d255ac0ed15 + Date: 10-May-2017 + Time: 01:08:28 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-stackSG550X-48-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-stackSG550X-48-show_version new file mode 100644 index 000000000..f996b84b3 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_command-stackSG550X-48-show_version @@ -0,0 +1,10 @@ +Active-image: flash://system/images/image1.bin + Version: 2.5.0.83 + MD5 Digest: 07968d912499cff5e8b07fdc24779854 + Date: 18-Jun-2019 + Time: 16:49:35 +Inactive-image: flash://system/images/_image1.bin + Version: 2.5.0.83 + MD5 Digest: 07968d912499cff5e8b07fdc24779854 + Date: 18-Jun-2019 + Time: 16:49:35 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-dir b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-dir new file mode 100644 index 000000000..ad02aa9a8 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-dir @@ -0,0 +1,11 @@ +Permissions + d-directory + r-readable + w-writable + x-executable +125856K of 223636K are free +Directory of flash:// + +Permission File Size Last Modified File Name +---------- --------- -------------------- -------------------------------------- + dr-- 1312 05-Feb-2021 11:01:04 system diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_cpu_utilization b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_cpu_utilization new file mode 100644 index 000000000..b6b389cc4 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_cpu_utilization @@ -0,0 +1,5 @@ +CPU utilization service is on. + +CPU utilization +--------------- +five seconds: 20%; one minute: 8%; five minutes: 3% diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_inventory b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_inventory new file mode 100644 index 000000000..b9b719f67 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_inventory @@ -0,0 +1,2 @@ +NAME: 1 DESCR: CBS350-24P-4G 24-Port Gigabit PoE Managed Switch +PID: CBS350-24P-4G VID: V01 SN: FOC2222291D diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_running-config_detailed b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_running-config_detailed new file mode 100644 index 000000000..90726eafc --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_running-config_detailed @@ -0,0 +1,395 @@ +config-file-header +sw-example +v3.0.0.61 / RCBS3.0_930_770_007 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cxxxxxxxxxxa1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +vlan database +vlan 20,90 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone +voice vlan oui-table add 00036b Cisco_phone +voice vlan oui-table add 00096e Avaya +voice vlan oui-table add 000fe2 H3C_Aolynk +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone +voice vlan oui-table add 00e075 Polycom/Veritel_phone +voice vlan oui-table add 00e0bb 3Com_phone +bonjour interface range vlan 1 +hostname sw-example +passwords complexity min-classes 1 +passwords aging 0 +username admin password encrypted xxxxxxxxxxghTlqmJOK9lcFBN7Qw== privilege 15 +username klima password encrypted xxxxxxxxxxpv+TTFr8AFivLAEqLbuIbA6Zi47sUAjWsjT3ZgH83/d2zIkbZorN/ycex1Q+6omIfCuE5e3jQTw== privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth +ip domain name example.net +ip telnet server +! +interface vlan 1 + no ip address dhcp +! +interface vlan 20 + name LAN-example1 + ip address 20.30.40.50 255.128.0.0 +! +interface vlan 90 + name LAN-example2 + ip address 12.13.14.15 255.255.255.0 +! +interface GigabitEtherne1 + switchport access vlan 90 +! +interface GigabitEthernet2 + switchport access vlan 90 +! +interface GigabitEthernet3 + switchport access vlan 90 +! +interface GigabitEthernet4 + switchport access vlan 90 +! +interface GigabitEthernet5 + switchport access vlan 90 +! +interface GigabitEthernet6 + switchport access vlan 90 +! +interface GigabitEthernet7 + switchport access vlan 90 +! +interface GigabitEthernet8 + switchport access vlan 90 +! +interface GigabitEthernet9 + switchport access vlan 90 +! +interface GigabitEthernet10 + switchport access vlan 90 +! +interface GigabitEthernet11 + switchport access vlan 90 +! +interface GigabitEthernet12 + switchport access vlan 90 +! +interface GigabitEthernet13 + switchport access vlan 90 +! +interface GigabitEthernet14 + switchport access vlan 90 +! +interface GigabitEthernet15 + switchport access vlan 90 +! +interface GigabitEthernet16 + switchport access vlan 90 +! +interface GigabitEthernet17 + switchport access vlan 90 +! +interface GigabitEthernet18 + switchport access vlan 90 +! +interface GigabitEthernet19 + switchport access vlan 20 +! +interface GigabitEthernet20 + switchport access vlan 20 +! +interface GigabitEthernet21 + switchport access vlan 20 +! +interface GigabitEthernet22 + switchport access vlan 20 +! +interface GigabitEthernet23 + switchport access vlan 20 +! +interface GigabitEthernet24 + switchport access vlan 20 +! +exit +ip default-gateway 12.13.14.10 +Comment: RSA Private Key +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxx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xxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +-----END CERTIFICATE----- +. diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_system b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_system new file mode 100644 index 000000000..6d79e27e5 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_system @@ -0,0 +1,20 @@ +System Description: CBS350-24P-4G 24-Port Gigabit PoE Managed Switch +System Up Time (days,hour:min:sec): 21,05:26:26 +System Contact: Somemail@example.com +System Name: sw-example +System Location: +System MAC Address: aa:bb:11:22:3c:4d +System Object ID: 1.3.6.1.4.1.9.6.1.1004.28.5 + +Unit Type +---- ---------------------- + 1 CBS350-24P-4G + + +Unit Fans Status +---- ------------------------------------- + 1 Fans status is N/A + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 63 OK diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_version new file mode 100644 index 000000000..bcb9b2d5a --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-CBS350-24P-4G-show_version @@ -0,0 +1,10 @@ +Active-image: flash://system/images/image1.bin + Version: 3.0.0.61 + MD5 Digest: 9703a2dea9e4c07c5cb22bc6c0235bcf + Date: 18-Jun-2020 + Time: 20:38:40 +Inactive-image: flash://system/images/_image1.bin + Version: 3.0.0.61 + MD5 Digest: 9703a2dea9e4c07c5cb22bc6c0235bcf + Date: 18-Jun-2020 + Time: 20:38:40 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_cpu_utilization b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_cpu_utilization new file mode 100644 index 000000000..7d6f1b463 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_cpu_utilization @@ -0,0 +1,5 @@ +CPU utilization service is on. + +CPU utilization +--------------- +five seconds: 11%; one minute: 10%; five minutes: 10% diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_inventory b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_inventory new file mode 100644 index 000000000..ab4458f5c --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_inventory @@ -0,0 +1,8 @@ + +NAME: "1" DESCR: "SG350-28 28-Port Gigabit Managed Switch" +PID: SG350-28-K9 VID: V01 SN: ABC1234567A + + +NAME: "GigabitEthernet28" DESCR: "SFP-1000Base-SX" +PID: SFP-1000-SX VID: Information Unavailable SN: A123456 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_system b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_system new file mode 100644 index 000000000..c07201a6c --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_system @@ -0,0 +1,21 @@ +System Description: SG350-28 28-Port Gigabit Managed Switch +System Up Time (days,hour:min:sec): 10,07:27:25 +System Contact: +System Name: sw-ab-abcdefg-1 +System Location: Abcde Fghijk - Lmnop +System MAC Address: aa:11:bb:22:c3:4d +System Object ID: 1.3.6.1.4.1.9.6.1.95.28.1 + +Unit Type +---- ---------------------- + 1 SG350-28 + + +Unit Fans Status +---- ------------------------------------- + 1 Fans status is N/A + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 53 OK + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_version new file mode 100644 index 000000000..c17f21e07 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG350-28-K9-show_version @@ -0,0 +1,11 @@ +Active-image: flash://system/images/image_tesla_hybrid_2.4.5.71_release_cisco_signed.bin + Version: 2.4.5.71 + MD5 Digest: 2dff89efdb2a0ec2f9a2c414ff7d401c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.2.8.4 + MD5 Digest: d75d9f2e1a06e99ba793af2418470df1 + Date: 21-Dec-2016 + Time: 22:03:09 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-dir b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-dir new file mode 100644 index 000000000..bea9188b8 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-dir @@ -0,0 +1,18 @@ +Directory of flash: + + File Name Permission Flash Size Data Size Modified +------------------- ---------- ---------- --------- ----------------------- +backuplo rw 655200 26 12-Jan-2014 18:08:41 +debug rw 65520 65520 03-Jun-2018 23:53:59 +dhcpdb.sys r- 65520 -- 12-Jan-2014 18:08:23 +dhcpsn.prv -- 65520 -- 12-Jan-2014 18:08:23 +directry.prv -- 65520 -- 12-Jan-2014 18:08:23 +image-1 rw 10009546 10009546 02-May-2013 14:56:48 +image-2 rw 10558664 10558664 12-Jan-2014 18:16:50 +mirror-config rw 1048320 6551 01-Jul-2018 05:26:13 +startup-config rw 1048320 19079 30-Jun-2018 05:26:18 +syslog1.sys r- 131040 -- 02-May-2013 14:56:48 +syslog2.sys r- 131040 -- 02-May-2013 14:56:48 + +Total size of flash: 32899072 bytes +Free size of flash: 7154750 bytes diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_cpu_utilization b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_cpu_utilization new file mode 100644 index 000000000..c9a1463d2 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_cpu_utilization @@ -0,0 +1,5 @@ +CPU utilization service is on. + +CPU utilization +--------------- +five seconds: 6%; one minute: 7%; five minutes: 5% diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_configuration b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_configuration new file mode 100644 index 000000000..cb6a3da14 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_configuration @@ -0,0 +1,91 @@ + Flow Admin Back Mdix +Port Type Duplex Speed Neg control State Pressure Mode +-------- ------------ ------ ----- -------- ------- ----- -------- ---- +gi1/1 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/2 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/3 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/4 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/5 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/6 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/7 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/8 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/9 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/10 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/11 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/12 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/13 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/14 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/15 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/16 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/17 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/18 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/19 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/20 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/21 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/22 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/23 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/24 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/25 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/26 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/27 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/28 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/29 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/30 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/31 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/32 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/33 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/34 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/35 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/36 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/37 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/38 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/39 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/40 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/41 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/42 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/43 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/44 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/45 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/46 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/47 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/48 1G-Copper Full 1000 Enabled Off Up Disabled Auto +gi1/49 1G-Combo-C Full 1000 Enabled Off Up Disabled Auto +gi1/50 1G-Combo-C Full 1000 Enabled Off Up Disabled Auto +gi1/51 1G-Fiber Full 1000 Disabled Off Up Disabled Auto +gi1/52 1G-Fiber Full 1000 Disabled Off Up Disabled Auto + + Flow Admin +Ch Type Speed Neg control State +-------- ------- ----- -------- ------- ----- +Po1 1G 1000 Enabled Off Up +Po2 -- -- Enabled Off Up +Po3 -- -- Enabled Off Up +Po4 -- -- Enabled Off Up +Po5 -- -- Enabled Off Up +Po6 -- -- Enabled Off Up +Po7 -- -- Enabled Off Up +Po8 -- -- Enabled Off Up +Po9 -- -- Enabled Off Up +Po10 -- -- Enabled Off Up +Po11 -- -- Enabled Off Up +Po12 -- -- Enabled Off Up +Po13 -- -- Enabled Off Up +Po14 -- -- Enabled Off Up +Po15 -- -- Enabled Off Up +Po16 -- -- Enabled Off Up +Po17 -- -- Enabled Off Up +Po18 -- -- Enabled Off Up +Po19 -- -- Enabled Off Up +Po20 -- -- Enabled Off Up +Po21 -- -- Enabled Off Up +Po22 -- -- Enabled Off Up +Po23 -- -- Enabled Off Up +Po24 -- -- Enabled Off Up +Po25 -- -- Enabled Off Up +Po26 -- -- Enabled Off Up +Po27 -- -- Enabled Off Up +Po28 -- -- Enabled Off Up +Po29 -- -- Enabled Off Up +Po30 -- -- Enabled Off Up +Po31 -- -- Enabled Off Up +Po32 -- -- Enabled Off Up diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_description b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_description new file mode 100644 index 000000000..5b2722ac7 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_description @@ -0,0 +1,89 @@ +Port Description +------- ----------- +gi1/1 Wifi Controller +gi1/2 WiFi AP +gi1/3 WiFi AP +gi1/4 WiFi AP +gi1/5 Access port +gi1/6 Access port +gi1/7 Access port +gi1/8 Access port +gi1/9 Access port +gi1/10 Access port +gi1/11 Plain VoIP +gi1/12 Access port +gi1/13 Access port +gi1/14 Access port +gi1/15 Access port +gi1/16 Access port +gi1/17 Access port +gi1/18 Plug 7B - sw tests +gi1/19 Access port +gi1/20 +gi1/21 Access port +gi1/22 Access port +gi1/23 Access port +gi1/24 Access port +gi1/25 Access port +gi1/26 Access port +gi1/27 Access port +gi1/28 Access port +gi1/29 Access port +gi1/30 Access port +gi1/31 Access port +gi1/32 Access port +gi1/33 Access port +gi1/34 Access port +gi1/35 Access port +gi1/36 Access port +gi1/37 Access port +gi1/38 Access port +gi1/39 Access port +gi1/40 Plug 7A dock +gi1/41 Access port +gi1/42 Access port +gi1/43 Access port +gi1/44 Access port +gi1/45 Access port +gi1/46 Access port +gi1/47 Access port +gi1/48 Access port +gi1/49 Po1 to sw-ab-cdef-1 +gi1/50 Po1 to sw-ab-cdef-1 +gi1/51 Access port +gi1/52 Access port + +Ch Description +------- ----------- +Po1 Trunk sw-ab-cdef-1 +Po2 +Po3 +Po4 +Po5 +Po6 +Po7 +Po8 +Po9 +Po10 +Po11 +Po12 +Po13 +Po14 +Po15 +Po16 +Po17 +Po18 +Po19 +Po20 +Po21 +Po22 +Po23 +Po24 +Po25 +Po26 +Po27 +Po28 +Po29 +Po30 +Po31 +Po32 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_status b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_status new file mode 100644 index 000000000..88cbc0ad8 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_interfaces_status @@ -0,0 +1,91 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/1 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/2 1G-Copper -- -- -- -- Down -- -- +gi1/3 1G-Copper -- -- -- -- Down -- -- +gi1/4 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/5 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/6 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/7 1G-Copper -- -- -- -- Down -- -- +gi1/8 1G-Copper -- -- -- -- Down -- -- +gi1/9 1G-Copper -- -- -- -- Down -- -- +gi1/10 1G-Copper -- -- -- -- Down -- -- +gi1/11 1G-Copper -- -- -- -- Down -- -- +gi1/12 1G-Copper -- -- -- -- Down -- -- +gi1/13 1G-Copper -- -- -- -- Down -- -- +gi1/14 1G-Copper -- -- -- -- Down -- -- +gi1/15 1G-Copper -- -- -- -- Down -- -- +gi1/16 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/17 1G-Copper -- -- -- -- Down -- -- +gi1/18 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/19 1G-Copper -- -- -- -- Down -- -- +gi1/20 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/21 1G-Copper -- -- -- -- Down -- -- +gi1/22 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/23 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/24 1G-Copper -- -- -- -- Down -- -- +gi1/25 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/26 1G-Copper Full 10 Enabled Off Up Disabled Off +gi1/27 1G-Copper -- -- -- -- Down -- -- +gi1/28 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/29 1G-Copper -- -- -- -- Down -- -- +gi1/30 1G-Copper -- -- -- -- Down -- -- +gi1/31 1G-Copper -- -- -- -- Down -- -- +gi1/32 1G-Copper -- -- -- -- Down -- -- +gi1/33 1G-Copper -- -- -- -- Down -- -- +gi1/34 1G-Copper -- -- -- -- Down -- -- +gi1/35 1G-Copper -- -- -- -- Down -- -- +gi1/36 1G-Copper -- -- -- -- Down -- -- +gi1/37 1G-Copper -- -- -- -- Down -- -- +gi1/38 1G-Copper -- -- -- -- Down -- -- +gi1/39 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/40 1G-Copper -- -- -- -- Down -- -- +gi1/41 1G-Copper -- -- -- -- Down -- -- +gi1/42 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/43 1G-Copper -- -- -- -- Down -- -- +gi1/44 1G-Copper -- -- -- -- Down -- -- +gi1/45 1G-Copper -- -- -- -- Down -- -- +gi1/46 1G-Copper -- -- -- -- Down -- -- +gi1/47 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/48 1G-Copper -- -- -- -- Down -- -- +gi1/49 1G-Combo-C Full 1000 Enabled Off Up Disabled Off +gi1/50 1G-Combo-C Full 1000 Enabled Off Up Disabled On +gi1/51 1G-Fiber -- -- -- -- Down -- -- +gi1/52 1G-Fiber -- -- -- -- Down -- -- + + Flow Link +Ch Type Duplex Speed Neg control State +-------- ------- ------ ----- -------- ------- ----------- +Po1 1G Full 1000 Enabled Off Up +Po2 -- -- -- -- -- Not Present +Po3 -- -- -- -- -- Not Present +Po4 -- -- -- -- -- Not Present +Po5 -- -- -- -- -- Not Present +Po6 -- -- -- -- -- Not Present +Po7 -- -- -- -- -- Not Present +Po8 -- -- -- -- -- Not Present +Po9 -- -- -- -- -- Not Present +Po10 -- -- -- -- -- Not Present +Po11 -- -- -- -- -- Not Present +Po12 -- -- -- -- -- Not Present +Po13 -- -- -- -- -- Not Present +Po14 -- -- -- -- -- Not Present +Po15 -- -- -- -- -- Not Present +Po16 -- -- -- -- -- Not Present +Po17 -- -- -- -- -- Not Present +Po18 -- -- -- -- -- Not Present +Po19 -- -- -- -- -- Not Present +Po20 -- -- -- -- -- Not Present +Po21 -- -- -- -- -- Not Present +Po22 -- -- -- -- -- Not Present +Po23 -- -- -- -- -- Not Present +Po24 -- -- -- -- -- Not Present +Po25 -- -- -- -- -- Not Present +Po26 -- -- -- -- -- Not Present +Po27 -- -- -- -- -- Not Present +Po28 -- -- -- -- -- Not Present +Po29 -- -- -- -- -- Not Present +Po30 -- -- -- -- -- Not Present +Po31 -- -- -- -- -- Not Present +Po32 -- -- -- -- -- Not Present diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_inventory b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_inventory new file mode 100644 index 000000000..e6eee7ef7 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_inventory @@ -0,0 +1,4 @@ + +NAME: "1" DESCR: "SG500-52 52-Port Gigabit Stackable Managed Switch" +PID: SG500-52-K9 VID: V02 SN: ABC12345678 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ip_interface b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ip_interface new file mode 100644 index 000000000..b4a5c3360 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ip_interface @@ -0,0 +1,13 @@ + + + IP Address I/F I/F Status Type Redirect Status + admin/oper +------------------ --------- ---------- ------- -------- ------ +11.30.5.12/18 vlan 1 UP/UP Static enable Valid + + + Gateway IP Address Type +----------------------- -------- +11.30.5.11 static + + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ip_route b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ip_route new file mode 100644 index 000000000..b2fae4d92 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ip_route @@ -0,0 +1,8 @@ +Maximum Parallel Paths: 1 (1 after reset) +IP Forwarding: disabled +Codes: > - best, C - connected, S - static + + +S 0.0.0.0/0 [1/1] via 11.13.1.1, 26:03:44, vlan 1 +C 11.13.1.0/18 is directly connected, vlan 1 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ipv6_interface_brief b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ipv6_interface_brief new file mode 100644 index 000000000..8bb80c45e --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ipv6_interface_brief @@ -0,0 +1,7 @@ + +Interface Interface IPv6 Link Local MLD Number of + State State IPv6 Address Version Global Addresses +---------- --------- --------- ------------------------- ------- ---------------- + vlan 1 up/up enabled fe80::36db:fdff:fe64:5bce 2 0 + + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_lldp_neighbors b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_lldp_neighbors new file mode 100644 index 000000000..973bb7fe2 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_lldp_neighbors @@ -0,0 +1,28 @@ + +System capability legend: +B - Bridge; R - Router; W - Wlan Access Point; T - telephone; +D - DOCSIS Cable Device; H - Host; r - Repeater; +TP - Two Ports MAC Relay; S - S-VLAN; C - C-VLAN; O - Other + + Port Device ID Port ID System Name Capabilities TTL +--------- ----------------- ------------- ----------------- ------------ ----- +gi1/4 b0:ba:6a:c2:41:80 b0:ba:6a:c2:4 b0:ba:6a:c2:41:80 W 106 + 1:80 +gi1/5 3a:e6:da:4a:52:1e 3a:e6:da:4a:5 O 3092 + 2:1e +gi1/18 00:1a:a9:49:2d:80 Gi0/2 sw-xy-zxxqwe-4.es B 119 + .example.com +gi1/20 dc:4a:3e:56:8d:45 dc:4a:3e:56:8 O 2690 + d:45 +gi1/23 aa:4c:ca:91:06:f2 aa:4c:ca:91:0 O 2816 + 6:f2 +gi1/39 aa:1f:72:91:f9:a2 aa:1f:72:91:f O 3495 + 9:a2 +gi1/47 ea:5a:ea:8c:ad:1b ea:5a:ea:8c:a O 2692 + d:1b +gi1/49 bc:ea:fa:ba:1a:a0 Ten-GigabitEt sw-ab-cdef-1 B, R, C 101 + hernet1/0/44 +gi1/50 bc:ea:fa:ba:1a:a0 Ten-GigabitEt sw-ab-cdef-1 B, R, C 100 + hernet2/0/44 + + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ports_jumbo-frame b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ports_jumbo-frame new file mode 100644 index 000000000..4aafdc06e --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_ports_jumbo-frame @@ -0,0 +1,3 @@ + + Jumbo frames are disabled + Jumbo frames will be disabled after reset diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_running-config_detailed b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_running-config_detailed new file mode 100644 index 000000000..b71e330f2 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_running-config_detailed @@ -0,0 +1,680 @@ +config-file-header +sw-ab-cd-1 +v1.4.8.6 / R800_NIK_1_4_202_008 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree mst configuration +instance 1 vlan 910,920,999 +name FIP +exit +port jumbo-frame +vlan database +vlan 7-8,30-31,100 +exit +voice vlan id 7 +voice vlan state disabled +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +port-channel load-balance src-dst-mac-ip +lldp chassis-id host-name +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +ip access-list extended VTY-IN +permit ip 11.23.0.0 0.0.255.255 any ace-priority 20 +exit +hostname sw-ab-cd-1 +line ssh +exec-timeout 60 +exit +line telnet +exec-timeout 60 +exit +logging host 11.23.1.55 +logging host 11.23.1.45 +logging buffered debugging +enable password level 15 encrypted 1234567890123456789012345678901234567890 +no passwords complexity enable +passwords aging 0 +username root password encrypted 1234567890123456789012345678901234567890 privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key root rsa +key-string row 1234567890123456789012345678901234567890 +key-string row 1234567890123456789012345678901234567890 +key-string row 1234567890123456789012345678901234567890 +key-string row VefEkyDGNlWj+qEIiCm/DSZurzWPgtdS +key-string row 1234567890123456789012345678901234567890 +key-string row 1234567890123456789012345678901234567890 +key-string row 1234567890123456789012345678901234567890 +key-string row 1234567890123456789012345678901234567890 +key-string row 1234567890123456789012345678901234567890 +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "XZ ZZ 34, aaaa" +snmp-server community example rw view Default +snmp-server host 11.23.1.45 traps version 1 example +snmp-server host 11.23.1.46 traps version 1 example +snmp-server host 11.23.1.55 traps version 1 example +clock timezone UTC 0 +clock summer-time web recurring us +clock source sntp +sntp unicast client enable +sntp unicast client poll +sntp server ntp1.example.cz +sntp server ntp2.example.cz +ip domain name example.cz +ip name-server 11.23.1.55 11.23.1.40 +ip host tftp 11.23.1.55 +ip telnet server +! +interface vlan 1 + ip address 11.23.0.34 255.255.128.0 + no ip address dhcp +! +interface vlan 7 + name IP +! +interface vlan 8 + name A_DMZ +! +interface vlan 30 + name B_DMZ +! +interface vlan 31 + name C_DMZ +! +interface gigabitethernet1/1 + description "Wifi Controller" + switchport mode general + switchport general allowed vlan add 100 tagged +! +interface gigabitethernet1/2 + description "WiFi AP" + storm-control broadcast level 1 + switchport mode general +! +interface gigabitethernet1/3 + description "WiFi AP" + storm-control broadcast level 1 + switchport mode general +! +interface gigabitethernet1/4 + description "WiFi AP" + storm-control broadcast level 1 + switchport mode general +! +interface gigabitethernet1/5 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/6 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/7 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/8 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/9 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/10 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/11 + description "Plain VoIP" + storm-control broadcast level 1 + switchport mode access + switchport access vlan 7 +! +interface gigabitethernet1/12 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/13 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/14 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/15 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/16 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/17 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/18 + description "Zásuvka 7B - sw pokusy" + storm-control broadcast level 1 + switchport trunk allowed vlan add 7-8,30-31,100 +! +interface gigabitethernet1/19 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/20 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/21 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/22 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/23 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged + no macro auto smartport + !next command is internal. + macro auto smartport dynamic_type unknown +! +interface gigabitethernet1/24 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/25 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/26 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/27 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/28 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/29 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/30 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/31 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/32 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/33 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/34 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/35 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/36 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/37 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/38 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/39 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/40 + description "Zasuvka 7A dock" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/41 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/42 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/43 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/44 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/45 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/46 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/47 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/48 + description "Access port" + storm-control broadcast level 1 + switchport mode general + switchport general allowed vlan add 7 tagged +! +interface gigabitethernet1/49 + description "Po1 to sw-ab-cdef-1" + channel-group 1 mode auto +! +interface gigabitethernet1/50 + description "Po1 to sw-ab-cdef-1" + channel-group 1 mode auto +! +interface gigabitethernet1/51 + description "Access port" + storm-control broadcast level 1 +! +interface gigabitethernet1/52 + description "Access port" + storm-control broadcast level 1 +! +interface Port-channel1 + description "Trunk sw-ab-cdef-1" + switchport trunk allowed vlan add 7-8,30-31,100 +! +exit +macro auto disabled +ip default-gateway 11.23.0.1 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +12345678901234567890123456789012345678905zNJXu3L73W/5zvZYV8Wc1746kSnbq +1234567890123456789012345678901234567890DWqu0xqBtNWuYvKexKvS7gNYbuV8HM +1234567890123456789012345678901234567890X6hoSqCmgK4x/YASwjBBKIpWffC//X +1234567890123456789012345678901234567890COvM0/aqfiyTHdGph8FTuQEvLDbHWG +1234567890123456789012345678901234567890nSxo7DY0tNmgyVBVcepD2wTAQq4TFd +1234567890123456789012345678901234567890vRl/Dvz0Rp4nbeEMLijp/bAh7dZdYQ +1234567890123456789012345678901234567890w52eWgGTy3QF3A9eIO30EA41sROQjE +1234567890123456789012345678901234567890XomCQN/xA9nwkTlLYGgaHP6Wt+r9Vh +1234567890123456789012345678901234567890Fw/rGj1C8Rp/k4VysR1IrZXJZaxnO3 +1234567890123456789012345678901234567890L6z0dwHQVak7HNGKpYki5anLpzjJst +12345678901234567890123456789012345678907dN7JF4by0jAvtKQuiRoqolsAEseqh +1234567890123456789012345678901234567890Kfg2MIwYKgij4dQa7AjW7Vgj8EQLYn +1234567890123456789012345678901234567890iavrjETqdPCR4Hc4U/POsXTHyvguXj +1234567890123456789012345678901234567890reo3HHH0Lnt0wq+SwrNN1RfTFQZo5E +1234567890123456789012345678901234567890Vv67YHXvP/iLbc3+9xo3PSNxgFWwjy +1234567890123456789012345678901234567890x3i9pMIaJZ5O2ywds73vsfg3A6Y/oP +wVMpK+sPJKc= +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +1234567890123456789012345678901234567890c9hLiNTzlYGXRVggJEUXWXRY21lXwv +1234567890123456789012345678901234567890SvZCclrLCa5ncWTNQcNFLwiAXFOt6R +12345678901234567890123456789012345678908wXFvceF9NBsqpcfnKxT6Q== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +1234567890123456789012345678901234567890lwbGLnnc2odh09m/YQk7tEyUFKv8NX +1234567890123456789012345678901234567890d03NyoZz8hkaFYxbuy8QCZ3v0s+XVq +1234567890123456789012345678901234567890hyhuIDHhd/LhS1CYhcRv5MwrPOvOKa +1234567890123456789012345678901234567890mrdTJBkIJqXLCK22JJbUVUZawxxdgM +12345678901234567890123456789012345678908AC3sLQyCF4d7D2t25QQ+NG6g4WiSN +1234567890123456789012345678901234567890j39MN0+YvVuL/I9f40i92grsKmO1Hc +12345678901234567890123456789012345678908i+7ZXqZ8vx3BfhOWx6yJG8e9PvgF2 +12345678901234567890123456789012345678904iGgL1uZ94i0mgkd3MTw9ldtHT0++k +1234567890123456789012345678901234567890+LenB3zKzUuP262qKIkJY3oDp/cxLy +1234567890123456789012345678901234567890Iz46XiRjKTyVM8BPuGHYnlVymI47y3 +1234567890123456789012345678901234567890PLYp4hmPr43q49MemVs6S7g4T7YytF +1234567890123456789012345678901234567890BsLmOOlKozX7SCyQOCDTNj +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +1234567890123456789012345678901234567890G6C0n4ue91syXMTIPzib4YOs12KsiT +1234567890123456789012345678901234567890MlZsz4d6V+7TmEFcjuOJymH2gi5VbL +1234567890123456789012345678901234567890Au8jZp761DPLAAAAFQCZyKr3VDTgqN +1234567890123456789012345678901234567890r2lVAC6KbI2afT87iKcQed4UHzUT7Z +1234567890123456789012345678901234567890ebiduIflrS+hQqVwwxm2ZwUmqnlltq +1234567890123456789012345678901234567890FCafeTPRKzPAAAAIA+E9jPuyDrFhes +123456789012345678901234567890123456789083U1C3nQ+j3YFWAI9FOGW4DDkRskO6 +1234567890123456789012345678901234567890wxR8bhS7La05qTSFsUEUuPgDGxPmIi +FPihI5jxRAPB4kGcGQ== +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import rsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +1234567890123456789012345678901234567890MwkpsUsJ2dEKBzts8cA++GnCSL2l2u +1234567890123456789012345678901234567890uHRoIfDWp1NL45atpzvvQ7LRdiIocx +1234567890123456789012345678901234567890ThFsejjvUrz+fHy06wBWZo+Rx0s16z +1234567890123456789012345678901234567890qdMwgGo4nDmtvbjELMAzQ7tLSWahYp +1234567890123456789012345678901234567890zD4hzosSmja6fdiXoKtt+Gb1iEj3Ak +1234567890123456789012345678901234567890EIiFYOlNIPLNcQBeMIrCfwPA2s9JvZ +1234567890123456789012345678901234567890ZCvPbK57aC8IMteEjdXAHp8pP+WDSQ +1234567890123456789012345678901234567890ER03mWAtUlLfRULtbawxZdl0chZfZg +1234567890123456789012345678901234567890y0xG4tSDHi8M7GwJ+i9aNMojDjuia3 +1234567890123456789012345678901234567890t2JD0wEu9eqawFvq3V6Q9qebLSl8qI +1234567890123456789012345678901234567890g+EZdShf20tkHCkUNRXF1+wQkWc2n/ +1234567890123456789012345678901234567890RmpcGUB1Z9xBHsfnBA106NknDuorXI +1234567890123456789012345678901234567890S503biaIXoU/uTMtYWLfF4uSwx6gnd +1234567890123456789012345678901234567890DMJG6454Tw4KjJGrI1wimzOPzmqbz2 +1234567890123456789012345678901234567890lvfGQ2ATMI/MiUQAfSbKvbRYengzG/ +1234567890123456789012345678901234567890k+3vIGMuCSZ5KYMvNcKA== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +12345678901234567890123456789012345678903umukC9Oxi/NXMAXLyIL7ZQNttzR/2 +1234567890123456789012345678901234567890jp/23pSaO3uZGZSRweKPPNCyjvig3D +1234567890123456789012345678901234567890BYy7UzzhCCqmBxiKa3eY+Q== +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import dsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +1234567890123456789012345678901234567890F27gE+Os8AMM1y5fv1Z5+Rz4c+/N2o +1234567890123456789012345678901234567890y+E7G8nFFtcBrigzgEFDh5cafSPunk +1234567890123456789012345678901234567890wB5eUuZtrsmqnOdv+XWyOU6TX0BkpB +1234567890123456789012345678901234567890poOMyoRTKqSwZdKknbOPUH8LNBb92g +12345678901234567890123456789012345678900n75V6Bvv/K/etMQezeHYCA3LCx61D +1234567890123456789012345678901234567890h3UgxeP1Y3OY5ATCzYdCDSI/6qPrAR +1234567890123456789012345678901234567890iYb8pplVI5PyZkKXT9eQVn8CZNxGax +1234567890123456789012345678901234567890Lk4S1B461LNwfUv+e8Tr12RO6hjtKl +1234567890123456789012345678901234567890G+zpASTXdPmIqLGyD5P8Fotse28wlQ +1234567890123456789012345678901234567890ayJR1o1LNUoJyWGv8a2CyNOoqAFnzC +1234567890123456789012345678901234567890fJaVGmmVABWe8zcWGWd8dp4OK9eKdt +1234567890123456789012345678901234567890BpAeMlBgyujcUpkOwcaZCE +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +1234567890123456789012345678901234567890WYJPIo9ZtVQqVMeRppNoTaDk8/FGpw +1234567890123456789012345678901234567890yVUQ6kmC+0JnooQfbBIT5ZRaSajdhS +1234567890123456789012345678901234567890EW15Fc+z9XYdAAAAFQDZR536b1HCPN +1234567890123456789012345678901234567890ABZkoEcWGYbp1dw8UrTCnk9Jep/Ug5 +1234567890123456789012345678901234567890rHwJW/bwbcNZGIpE5YdiwQGz1uOUuz +1234567890123456789012345678901234567890emVq/4PVythgAAAIALFKdpGk9Om4m+ +1234567890123456789012345678901234567890j6l5YQHXZWnfIQf4ntelMyeiYf31ml +1234567890123456789012345678901234567890fhBUBSJ7Z4cjdOFmWsrsK5216eOe4V +ad5dDLouV0h6h6LmUg== +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto certificate 1 import +-----BEGIN RSA ENCRYPTED PRIVATE KEY----- +1234567890123456789012345678901234567890EpXmv4hO09D94NBL4DqUtxF1ygvCDk +1234567890123456789012345678901234567890AU97eLtVRmIkpvsWFoTKT4hUtZrJD6 +12345678901234567890123456789012345678902ICMqNkmz+x9B1C8F3JbLMRfUUbuRU +1234567890123456789012345678901234567890veL9+HLS9x5EoVVZOHfmLP9Suh0Qtx +12345678901234567890123456789012345678906bBBtgeWFU2wWiTZIfWAbojHUIdxzp +1234567890123456789012345678901234567890Rz3RsnrspfH1+pmZirl7PW4JBEtgJk +1234567890123456789012345678901234567890fxfeYQxQj/3OJArNFK6072BRcO+RN8 +1234567890123456789012345678901234567890yqljtKK8e2mOLk9l47TWpH0UvT+p/Y +1234567890123456789012345678901234567890u+CLZxhY4mwMYUuWSe1ggAlzHkqvl9 +12345678901234567890123456789012345678907Ybm2XHZBSoy4/YvsEz99TZVHi+dBX +1234567890123456789012345678901234567890UYzjy92tnsZL3UXRKIRb7Exg6TFZTk +1234567890123456789012345678901234567890iUl5STn1JL4OeeK/Xg65vydJACh/JB +1234567890123456789012345678901234567890Ots6pEqdGDptojpBhSIz677DVd8T6L +1234567890123456789012345678901234567890tyTVU44k7Y2XSDjna+nsrxQ8JxXtM9 +1234567890123456789012345678901234567890zimJ8p4DnqvfCWHsIuofNKk/jtOBj2 +1234567890123456789012345678901234567890v3Ft8NfBIh0lHJAGEPUVzhW4xL9eo5 +1234567890123456789012345678901234567890Rt0OoKAJjfHLDt16ENkiVCEHq6TXI9 +1234567890123456789012345678901234567890XbRj5gFd5xOWlVY6I7IWYckW9MEdu+ +1234567890123456789012345678901234567890N3VGe4EiGQ8BSPDGZcwUyhw5AeGfWH +1234567890123456789012345678901234567890itfUn1vuT70RtnS4aLNRLkvH4TuleY +12345678901234567890123456789012345678907ZUkPrIwePdXQLLBV8I1Y777dzIDSB +12345678901234567890123456789012345678902lrLWZhvcNc4Z6HxVyWOpCInHMHSE2 +12345678901234567890123456789012345678900RzsJLGOpNi8rCplDgB5ouFZkQvEzB +1234567890123456789012345678901234567890Fxg4TFoKGhgOwwgE6TxtKltcLwBei3 +1234567890123456789012345678901234567890V427pdFdlEllUo9fV1zwlzMrNOpECz +12345678901234567890123456789012345678907H1cSHkRGfy7Uk3ypOlDPkvlIy2rJY +1234567890123456789012345678901234567890FE7zlnlOfeoJX+Rne+PugHvFeY+uEc +1234567890123456789012345678901234567890Rl2J8JbcFhhSvNiGwVEmNF5w/WAEbj +1234567890123456789012345678901234567890q7skQ8MTCrrA6fq2p31djnPHRmEP9l +12345678901234567890123456789012345678901WLYunFy5J2uo3aeOkpYxAq55VdpEH +1234567890123456789012345678901234567890X0BLMB77ErmHFoQ= +-----END RSA PRIVATE KEY----- +-----BEGIN RSA PUBLIC KEY----- +1234567890123456789012345678901234567890FpUxCyclO0IRa43hqJoeJnqmos7qIN +1234567890123456789012345678901234567890wY+OEJom2YKDJbxAjyFNPgmp11V39d +1234567890123456789012345678901234567890qYn5ETIUqu3/jbCnAbkeApiPkUFWqC +1234567890123456789012345678901234567890VsDQLIgQLzGQB8zO8pjY7ULyqVv2Rp +1234567890123456789012345678901234567890+xyYAFhvaeD1y6pGrPQXUZQMEXmVyX +OnUQIDAQAB +-----END RSA PUBLIC KEY----- +-----BEGIN CERTIFICATE----- +1234567890123456789012345678901234567890ADCBlTELMAkGA1UEBhMCQ1ox +1234567890123456789012345678901234567890VQQHDBBDZXNrZSBCdWRlam92 +1234567890123456789012345678901234567890A1UECwwCSVQxEjAQBgNVBAMM +1234567890123456789012345678901234567890bWFkZXRhLmN6MB4XDTE2MDky +1234567890123456789012345678901234567890BgNVBAYTAkNaMRcwFQYDVQQI +1234567890123456789012345678901234567890a2UgQnVkZWpvdmljZTEUMBIG +1234567890123456789012345678901234567890MRcwFQYDVQQDFA4qLmNiLm1h +1234567890123456789012345678901234567890ZXRhLmN6MIIBIjANBgkqhkiG +1234567890123456789012345678901234567890q7hKCzKk07i0o4dbFpUxCycl +1234567890123456789012345678901234567890TdHJn7chiGFdcNCLbMXYAtwY +1234567890123456789012345678901234567890t5jtwPUoPSCLiU1OnwSN5REH +1234567890123456789012345678901234567890TE8rJ/L4uXe7YQxSRSeRUMdp +1234567890123456789012345678901234567890k5dYl1cbXJ/suCRE4hpoBfhf +1234567890123456789012345678901234567890EXmVyXOnUQIDAQABo4ICQjCC +1234567890123456789012345678901234567890Y3qCDiouaXQubWFkZXRhLmN6 +1234567890123456789012345678901234567890Y3qCDiouamgubWFkZXRhLmN6 +1234567890123456789012345678901234567890Y3qCDioucmkubWFkZXRhLmN6 +1234567890123456789012345678901234567890Y3qCCW1hZGV0YS5jeoIMaXQu +1234567890123456789012345678901234567890ZGV0YS5jeoIMamgubWFkZXRh +1234567890123456789012345678901234567890eoIMcmkubWFkZXRhLmN6ggxj +1234567890123456789012345678901234567890HRMEAjAAMDUGCWCGSAGG+EIB +1234567890123456789012345678901234567890ZCBDZXJ0aWZpY2F0ZTCBwgYD +12345678901234567890123456789012345678904KGBm6SBmDCBlTELMAkGA1UE +1234567890123456789012345678901234567890MRkwFwYDVQQHDBBDZXNrZSBC +1234567890123456789012345678901234567890LjELMAkGA1UECwwCSVQxEjAQ +1234567890123456789012345678901234567890ARYMaXRAbWFkZXRhLmN6ggEA +1234567890123456789012345678901234567890IZxS5GHb6ozjYK3AxYT1gbIo +1234567890123456789012345678901234567890al222jwAEze0JbZa84ZfiQuy +1234567890123456789012345678901234567890A6oplHgd9k/ffhR0e/kkW33X +GBFc +-----END CERTIFICATE----- +. +encrypted crypto certificate 2 import +-----BEGIN RSA ENCRYPTED PRIVATE KEY----- +1234567890123456789012345678901234567890EpXmv4hO09D94NBL4DqUtxF1ygvCDk +1234567890123456789012345678901234567890AU97eLtVRmIkpvsWFoTKT4hUtZrJD6 +12345678901234567890123456789012345678902ICMqNkmz+x9B1C8F3JbLMRfUUbuRU +1234567890123456789012345678901234567890veL9+HLS9x5EoVVZOHfmLP9Suh0Qtx +12345678901234567890123456789012345678906bBBtgeWFU2wWiTZIfWAbojHUIdxzp +1234567890123456789012345678901234567890Rz3RsnrspfH1+pmZirl7PW4JBEtgJk +1234567890123456789012345678901234567890fxfeYQxQj/3OJArNFK6072BRcO+RN8 +1234567890123456789012345678901234567890yqljtKK8e2mOLk9l47TWpH0UvT+p/Y +1234567890123456789012345678901234567890u+CLZxhY4mwMYUuWSe1ggAlzHkqvl9 +12345678901234567890123456789012345678907Ybm2XHZBSoy4/YvsEz99TZVHi+dBX +1234567890123456789012345678901234567890UYzjy92tnsZL3UXRKIRb7Exg6TFZTk +1234567890123456789012345678901234567890iUl5STn1JL4OeeK/Xg65vydJACh/JB +1234567890123456789012345678901234567890Ots6pEqdGDptojpBhSIz677DVd8T6L +1234567890123456789012345678901234567890tyTVU44k7Y2XSDjna+nsrxQ8JxXtM9 +1234567890123456789012345678901234567890zimJ8p4DnqvfCWHsIuofNKk/jtOBj2 +1234567890123456789012345678901234567890v3Ft8NfBIh0lHJAGEPUVzhW4xL9eo5 +1234567890123456789012345678901234567890Rt0OoKAJjfHLDt16ENkiVCEHq6TXI9 +1234567890123456789012345678901234567890XbRj5gFd5xOWlVY6I7IWYckW9MEdu+ +1234567890123456789012345678901234567890N3VGe4EiGQ8BSPDGZcwUyhw5AeGfWH +1234567890123456789012345678901234567890itfUn1vuT70RtnS4aLNRLkvH4TuleY +12345678901234567890123456789012345678907ZUkPrIwePdXQLLBV8I1Y777dzIDSB +12345678901234567890123456789012345678902lrLWZhvcNc4Z6HxVyWOpCInHMHSE2 +12345678901234567890123456789012345678900RzsJLGOpNi8rCplDgB5ouFZkQvEzB +1234567890123456789012345678901234567890Fxg4TFoKGhgOwwgE6TxtKltcLwBei3 +1234567890123456789012345678901234567890V427pdFdlEllUo9fV1zwlzMrNOpECz +12345678901234567890123456789012345678907H1cSHkRGfy7Uk3ypOlDPkvlIy2rJY +1234567890123456789012345678901234567890FE7zlnlOfeoJX+Rne+PugHvFeY+uEc +1234567890123456789012345678901234567890Rl2J8JbcFhhSvNiGwVEmNF5w/WAEbj +1234567890123456789012345678901234567890q7skQ8MTCrrA6fq2p31djnPHRmEP9l +12345678901234567890123456789012345678901WLYunFy5J2uo3aeOkpYxAq55VdpEH +1234567890123456789012345678901234567890X0BLMB77ErmHFoQ= +-----END RSA PRIVATE KEY----- +-----BEGIN RSA PUBLIC KEY----- +1234567890123456789012345678901234567890FpUxCyclO0IRa43hqJoeJnqmos7qIN +1234567890123456789012345678901234567890wY+OEJom2YKDJbxAjyFNPgmp11V39d +1234567890123456789012345678901234567890qYn5ETIUqu3/jbCnAbkeApiPkUFWqC +1234567890123456789012345678901234567890VsDQLIgQLzGQB8zO8pjY7ULyqVv2Rp +1234567890123456789012345678901234567890+xyYAFhvaeD1y6pGrPQXUZQMEXmVyX +OnUQIDAQAB +-----END RSA PUBLIC KEY----- +-----BEGIN CERTIFICATE----- +1234567890123456789012345678901234567890ADCBlTELMAkGA1UEBhMCQ1ox +1234567890123456789012345678901234567890VQQHDBBDZXNrZSBCdWRlam92 +1234567890123456789012345678901234567890A1UECwwCSVQxEjAQBgNVBAMM +1234567890123456789012345678901234567890bWFkZXRhLmN6MB4XDTE2MDky +1234567890123456789012345678901234567890BgNVBAYTAkNaMRcwFQYDVQQI +1234567890123456789012345678901234567890a2UgQnVkZWpvdmljZTEUMBIG +1234567890123456789012345678901234567890MRcwFQYDVQQDFA4qLmNiLm1h +1234567890123456789012345678901234567890ZXRhLmN6MIIBIjANBgkqhkiG +1234567890123456789012345678901234567890q7hKCzKk07i0o4dbFpUxCycl +1234567890123456789012345678901234567890TdHJn7chiGFdcNCLbMXYAtwY +1234567890123456789012345678901234567890t5jtwPUoPSCLiU1OnwSN5REH +1234567890123456789012345678901234567890TE8rJ/L4uXe7YQxSRSeRUMdp +1234567890123456789012345678901234567890k5dYl1cbXJ/suCRE4hpoBfhf +1234567890123456789012345678901234567890EXmVyXOnUQIDAQABo4ICQjCC +1234567890123456789012345678901234567890Y3qCDiouaXQubWFkZXRhLmN6 +1234567890123456789012345678901234567890Y3qCDiouamgubWFkZXRhLmN6 +1234567890123456789012345678901234567890Y3qCDioucmkubWFkZXRhLmN6 +1234567890123456789012345678901234567890Y3qCCW1hZGV0YS5jeoIMaXQu +1234567890123456789012345678901234567890ZGV0YS5jeoIMamgubWFkZXRh +1234567890123456789012345678901234567890eoIMcmkubWFkZXRhLmN6ggxj +1234567890123456789012345678901234567890HRMEAjAAMDUGCWCGSAGG+EIB +1234567890123456789012345678901234567890ZCBDZXJ0aWZpY2F0ZTCBwgYD +12345678901234567890123456789012345678904KGBm6SBmDCBlTELMAkGA1UE +1234567890123456789012345678901234567890MRkwFwYDVQQHDBBDZXNrZSBC +1234567890123456789012345678901234567890LjELMAkGA1UECwwCSVQxEjAQ +1234567890123456789012345678901234567890ARYMaXRAbWFkZXRhLmN6ggEA +1234567890123456789012345678901234567890IZxS5GHb6ozjYK3AxYT1gbIo +1234567890123456789012345678901234567890al222jwAEze0JbZa84ZfiQuy +1234567890123456789012345678901234567890A6oplHgd9k/ffhR0e/kkW33X +GBFc +-----END CERTIFICATE----- +. diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_system b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_system new file mode 100644 index 000000000..a2146db03 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_system @@ -0,0 +1,10 @@ +System Description: SG500-52 52-Port Gigabit Stackable Managed Switch +System Up Time (days,hour:min:sec): 483,01:39:47 +System Contact: +System Name: sw-abcdefg-1 +System Location: Abc Dedgh - Ijklmnd 23 +System MAC Address: aa:11:bb:22:3c:d4 +System Object ID: 1.3.6.1.4.1.9.6.1.81.52.1 + +Fans Status: OK + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_version new file mode 100644 index 000000000..73037a269 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG500-52-K9-show_version @@ -0,0 +1,3 @@ +SW version 1.4.8.6 ( date 10-Jul-2017 time 17:07:33 ) +Boot version 1.3.7.01 ( date 04-Dec-2013 time 13:48:27 ) +HW version V02 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-dir b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-dir new file mode 100644 index 000000000..45e26f35d --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-dir @@ -0,0 +1,13 @@ +Permissions + d-directory + r-readable + w-writable + x-executable +125468K of 224552K are free +Directory of flash:// + +Permission File Size Last Modified File Name +---------- --------- -------------------- -------------------------------------- + dr-- 1376 04-Nov-2018 07:42:07 system + + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_cpu_utilization b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_cpu_utilization new file mode 100644 index 000000000..3d5285c79 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_cpu_utilization @@ -0,0 +1,5 @@ +CPU utilization service is on. + +CPU utilization +--------------- +five seconds: 8%; one minute: 8%; five minutes: 9% diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_inventory b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_inventory new file mode 100644 index 000000000..e2a4ba8f7 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_inventory @@ -0,0 +1,12 @@ + +NAME: "1" DESCR: "SG550X-24MP 24-Port Gigabit PoE Stackable Managed Switch" +PID: SG550X-24MP-K9 VID: V02 SN: ABC123456AB + + +NAME: "TengigabitEthernet1/0/3" DESCR: "SFP-1000Base-SX" +PID: SFP-1000-SX VID: Information Unavailable SN: A1234567890 + + +NAME: "TengigabitEthernet1/0/4" DESCR: "SFP-1000Base-SX" +PID: SFP-1000-SX VID: Information Unavailable SN: A123456789 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_running-config_detailed b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_running-config_detailed new file mode 100644 index 000000000..34cc62be0 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_running-config_detailed @@ -0,0 +1,372 @@ +config-file-header +switch-c +v192.168.0.71 / RTESLA2.4.5_930_181_144 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink te +unit-type unit 2 network gi uplink te +unit-type unit 3 network gi uplink te +unit-type unit 4 network gi uplink te +unit-type unit 5 network gi uplink te +unit-type unit 6 network gi uplink te +unit-type unit 7 network gi uplink te +unit-type unit 8 network gi uplink te +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +port jumbo-frame +vlan database +vlan 7-8,30-31,100,910,920,999 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +lldp chassis-id host-name +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +link-flap prevention disable +bonjour interface range vlan 1 +ip access-list extended VTY-IN +permit ip 192.168.0.0 192.168.0.255 any ace-priority 20 +exit +hostname switch-c +line console +exec-timeout 60 +exit +line ssh +exec-timeout 60 +exit +line telnet +exec-timeout 60 +exit +logging host 192.168.0.2 +logging host 192.168.0.3 +logging host 192.168.0.4 +enable password level 15 encrypted <remove> +no passwords complexity enable +passwords aging 0 +username adm1 password encrypted <remove> 15 +username adm2 password encrypted <remove> 7 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth +crypto key pubkey-chain ssh +user-key adm2 rsa +key-string row 2222B1Nz2C1yc1E2222BIw222QE2rgMdfpc1NU1L +key-string row 1gO1hqlcOK2KNviXk1D11Z1dmG+jDwIK1g1BQGlB +key-string row 2jfbRWpZEyUBX+ckWb2wgBBBs211bfRQDtU1sg2v +key-string row VefEkyDGNlWj+qEIiCm/DSZurzWPgtdS +key-string row Og11q1uH/1nKPR12gfJyN11o11nYZjclVSXW+VS1 +key-string row 1b1cRHP1L+n1lqkKHs1u+T11zwEHWO1yWQ/dirg1 +key-string row 11kUSOgv11lj1UwqeSxBDGWVb1Qd211+oTfMZRDF +key-string row 1NxezpW/yE1CVMNQ/rFu11mcooyXLH1OnMyls1Cv +key-string row huhqDjqUgeoGhRKerVkCh1OHrQc11YxIINJVB1mV +key-string row SWtO1EiL1pTczbwxGw== +exit +exit +snmp-server server +snmp-server location some place +snmp-server community example rw view Default +snmp-server host 192.168.0.3 traps version 1 example +snmp-server host 192.168.0.2 traps version 1 example +ip https certificate 2 +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server ntpserver.example.net +sntp server ntpserver.example.net +no sntp server ntpserver.example.net +ip name-server dnsserver.example.net +ip host tftp 192.168.0.2 +ip telnet server +! +interface vlan 1 + ip address 192.168.0.27 192.168.0.0 + no ip address dhcp +! +interface vlan 7 + name vlan_example1 +! +interface vlan 8 + name vlan_example2 +! +interface vlan 30 + name vlan_example3 +! +interface vlan 31 + name vlan_example4 +! +interface vlan 100 + name vlan_example5 +! +interface vlan 910 + name vlan_example6 +! +interface vlan 920 + name vlan_example7 +! +interface vlan 999 + name vlan_example8 +! +interface GigabitEthernet1/0/1 + description "some description" + spanning-tree link-type point-to-point + switchport mode trunk + macro description ap + !next command is internal. + macro auto smartport dynamic_type ap +! +interface GigabitEthernet1/0/2 + description "some description" + spanning-tree link-type point-to-point + switchport mode trunk + macro description ap + !next command is internal. + macro auto smartport dynamic_type ap +! +interface GigabitEthernet1/0/3 + description "some description" + spanning-tree link-type point-to-point + switchport mode trunk + macro description ap + !next command is internal. + macro auto smartport dynamic_type ap +! +interface GigabitEthernet1/0/4 + spanning-tree link-type point-to-point + switchport mode trunk + macro description ap + !next command is internal. + macro auto smartport dynamic_type ap +! +interface GigabitEthernet1/0/6 + speed 100 +! +interface GigabitEthernet1/0/24 + spanning-tree link-type point-to-point + switchport mode trunk + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface TengigabitEthernet1/0/1 + description "some description" + spanning-tree link-type point-to-point + switchport mode trunk + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface TengigabitEthernet1/0/4 + description "some description" + spanning-tree link-type point-to-point + switchport mode trunk + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +exit +ip default-gateway 192.168.0.1 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +1aaa1aaaa1aaaa/a1aaaaa1aaaa1aaaaa+aaaaaaa1aaaaaaaaaaa1aaaaaaaaaaa1aaa1 +aaaaaaaaaaa1aaaaa11a1aa1+aaaaaaaaa/aa1aaaaaaaaa1aaaaaaa11aaa/aaaaaaaa1 +aaaa1aaaaaaaa/aaaaaa1aaa1aaaaaaaaaaa11aaaaaaa/aaa1a1aa1aaaaaaaaaaaa11a +aaaa/a1aaaaaaaaa/aaaaa1aa1aaaaaaaa1111a1a1aaaaa11aa/aaaa1aaaaaaaaaaaaa +aaaaaaaa1a1aaaaaaaaaaaa1a+a1a1aaa/a/aaaaaaaa1a1a1aaaaa1aaaaaaaaaa1aaa+ +aaaaaaaaa1aaaaa+aaaaaaa1aaaaaaaaaaaa1a+aa1aaa1aaaaaaaaaaa1a1aaaaaaaa1a +1aaaaaa1/aa1/aaaaaaaaaaaaaaaaa1aaaaaaaaaaa1aaaa1/1a1a1aa1aaaa1aaa1aaaa +11aaaaaa1aaa1aaaaa1a1aaaaa11aaa1aaaaaaaaaaaa1aaa1a1aaaaaaaaaaaaaaaa1aa +11aaaaaa/aa1aaaaaaa1a1aaaaaaaaa11aaaaaaaaa1aa11aaaaaaaa1aaaa11aaaa1aaa +aaaa1aaa11aaaaaaaaaa1aaa1+aaaaaaaaa11aa1aa11aaaaaaaaaa1aaaaaaaaaaaa1a1 +aaaa1aaa11aaa1aaaa+aaaaaaa1a11aaa1aaaa1aaaaaaaaaaaa1a1aaaaaaaaaaa1a1aa +aaaaa1aaa1aaaaaaaaa1aaaaaaaa1aaaaaaaaaa1/aa1a1aaa1aaaaaaaa/111aaaaaaaa +aaaaaaaaaaaa1aaaa/aa1aa1aaaaaaaaaaaaaaa/a//aaaaa1aaaa11aa11aa1aaa11aaa +aaaaaaaa11aaaaaaaa1aaaa+aa1aaaaaaaa1aaaaaaaaaaa11aaaaaaaaa1aa1aaaaa1aa +aa1aaaaaa+aaa1aa/a1aaaaaaaaaaaaaaaaa1aaaaaaaaaaaa1aaaa1aaaaa1/aaa1aaaa +aaaaaaaaaaaaaaaaaaaaaaa1aaaaaaaaa/a1aaa1aaaaaa1a1aaaaaaaaaa1== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +aaaaa1aaaa1aa1aaaaaaaaaaaaaaaaaaaa/a1aaaaaa+aaaaaaaaaaa/aaaaaa1aaaaaaa +aa1a1aaaa1aaaaaaaaaaaaaaa1a1/aaaaaaa1a+1aa1aaaaaaa1a1aa1aaaaa1aaaa1aaa +aaaaaaaaaa1aaaaaaaa/a1+1aaaa11aa1aaaaaaaaaaaa1aaa1aaaaaaaaaaaa== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +a+aaaaaaaa1aaaaaaaaaaaaaaa1aaaa1aaa1a1aaa1aaaaaaa1a1aaaaaaaa1aa1aaaaaa +aaaa1aaaaa11aaaa1aaaaaaaa+aaaa1aaa11aa1aa1aaaaa1aaaaa/a1aaaa1aaaaaaaaa +aaaaa1aaaaa1aaaaaaa1aaaa+aaaaaaaaaaaaa11aaaaaaaaa1aaa1a11aaaa1aaaaa1/a +aaaaaaaa111111aa/aaaaaa1aaa11aaaa+aaa +aaaa1a1aaa1aaaaaaaaaaaaaaa1a1aaaaaa11aaaaaaaaaa/aaa1a111aaaaaaaaaaaaaa +a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1aaaaa1aaaa1+aaaaa1aaaa1aaaaaaaa1aaaaaaa1aaaa//a1aaaaaaa +1aaaaaaa1aaa111aa1aaaa1aaaaaaaaaaaaaaaaaa1aaa1aa11aaaa1a/a1aaaa1aaa+aa +1+aaa/a/aa+aaaaaaaa1aaaaaaaaaaaaa1aaaaaaaaa+1aaa1aaaaaaaaaa1aaaaaaaaaa +aaaaaaaaaaa1aaaaaaaaaaaaa11aaaaaaa1aaaa/aaa1aa1aaaaaaa1a/a1a== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +aaaaa1aaaa1aa1aaaaaaaaaaaaaaaaaaaaaaa1a1aaaaaaaaa111aaaaaaaaaaaaaaaaaa +aaaaa1aaaaa/aaaaaaaa1aa1aaa11a/aaaaa1aaaa1aaa1aaaaaa1aa1aaaaaaa1aa+a1a +aaa1aaaaaaaaaaa1a1aaaa1a1aaa+aaaaaaa11a1111a1aaa11aaaaa1aa1/aa== +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import dsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +aaa1aaaa/aaaaaaaaaaaa+111aaaaaaaaaa1aaaaaaaa1aa+aaaaaaaaaaaaaaaaaa1aaa +aaaaaaaaa1aaaaaaa1aaaaaaa1aaaa1aaaaa1a/aaaaaaaaaaaa1aaaaaaaaaaa+a1aaaa +aaaaaaaa1a1+a/aaaaaaaaaaaa1a1aaaaaaaaaaaaa1a+a1aaa1aaa111aa1aaaaaa/aaa +aa1aaa1aa1aaaaaaaaaa1a1aaa11a/aaaa1+a1aaa+aa1aaa1a1aaaa1aaaa+aaaaaaaaa +a1a1aaa1aa1aaa/aaaaa1aaaaaaaaaaa1aaaaaaaa1a1aaaaa1aaaaa1aaa1aa1aaa11aa +aaaaaa1+aaaaaaaaa/a1aaaa1a1aaaaaa1aaa1aaaaaa1aaaaaa1aaaaaaaaa1aa11aaa1 +1aaaa1aaaa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aaa1aaaaaaaaaaaaaaaaa1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaa11aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1aaaaaaaaaa1aaaaaaaaaaaaaa +aaaaaaaaaa1aaaaaaaaaaaaaaaaaaaaaaaa1aaaaaaaaaaaaaaaaaaaaaaa1aaaa +aa1aaaaaaaa1aaaaaaaaa1aaaaaaaaaaaaaaa1aaaaaa1aaa1aaaaa1aaaa1aaaa +1a1a11aaaaaaaa11aaa11aaa1a1aaaaa1a1a1aaaaa111aaaaaa1aaaa11aaaaaa +aaa1aa1aaa1aaaaaaaaaaaaaaaaaaaaaaaa1aaaaa1aaaaaa1a/aaaa1a/aaa11a +aaaa +-----END CERTIFICATE----- +. diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_system b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_system new file mode 100644 index 000000000..8441e2672 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_system @@ -0,0 +1,25 @@ +System Description: SG550X-24MP 24-Port Gigabit PoE Stackable Managed Switch +System Up Time (days,hour:min:sec): 105,15:23:35 +System Contact: +System Name: sw-abcdefgh +System Location: Abcd Efghijk - Lmnop 12 +System MAC Address: aa:11:bb:22:c3:4d +System Object ID: 1.3.6.1.4.1.9.6.1.93.24.6 + +Unit Type +---- ---------------------- + 1 SG550X-24MP + + +Unit Main Power Supply Redundant Power Supply +---- ----------------- ---------------------- + 1 Active Not Connected + +Unit Fans Status +---- ------------------------------------- + 1 FANs OK, redundant fan Ready + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 37 OK + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_version new file mode 100644 index 000000000..e6a0a6308 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SG550X-24MP-K9-show_version @@ -0,0 +1,10 @@ +Active-image: flash://system/images/sx550X_tesla_hybrid_2.4.5.71_release_cisco_signed.bin + Version: 2.4.5.71 + MD5 Digest: 2dff89efdb2a0ec2f9a2c414ff7d401c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.3.0.130 + MD5 Digest: 079b10248b0cc997da651d255ac0ed15 + Date: 10-May-2017 + Time: 01:08:28 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_cpu_utilization b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_cpu_utilization new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_cpu_utilization diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_inventory b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_inventory new file mode 100644 index 000000000..d786c0085 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_inventory @@ -0,0 +1,46 @@ +NAME: "1" DESCR: "SX550X-24F 24-Port 10G SFP+ Stackable Managed Switch" +PID: SX550X-24F-K9 VID: V02 SN: DNI22500E5F + + +NAME: "TenGigabitEthernet1/0/11" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V02 SN: CS101K63284 + + +NAME: "TenGigabitEthernet1/0/14" DESCR: "SFP-10GBase-SR" +PID: SFP-10G-SR VID: V03 SN: CSG101KB2848 + + +NAME: "TenGigabitEthernet1/0/15" DESCR: "SFP-10GBase-SR" +PID: SFP-10G-SR VID: V03 SN: CSSSRJC2101 + + +NAME: "TenGigabitEthernet1/0/16" DESCR: "SFP-10GBase-SR" +PID: SFP-10G-SR VID: V03 SN: CSSSRJC2119 + + +NAME: "TenGigabitEthernet1/0/17" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V02 SN: CSS2003194730 + + +NAME: "TenGigabitEthernet1/0/18" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V02 SN: CSS2003194736 + + +NAME: "TenGigabitEthernet1/0/19" DESCR: "SFP-10GBase-SR" +PID: SFP-10G-SR VID: V03 SN: CSSSRJC2093 + + +NAME: "TenGigabitEthernet1/0/20" DESCR: "SFP-10GBase-SR" +PID: SFP-10G-SR VID: V03 SN: CSSSRJC2115 + + +NAME: "TenGigabitEthernet1/0/22" DESCR: "Cisco SFP-10Gbase-CX1" +PID: SFP-H10GB-CU3M VID: V03 SN: MOC1906A079 + + +NAME: "TenGigabitEthernet1/0/23" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V02 SN: CSS2003194783 + + +NAME: "TenGigabitEthernet1/0/24" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V02 SN: CSS2003194782
\ No newline at end of file diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_system b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_system new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_system diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_version new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-SX550X-24F-K9-show_version diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-dir b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-dir new file mode 100644 index 000000000..e0afb663f --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-dir @@ -0,0 +1,13 @@ +Permissions + d-directory + r-readable + w-writable + x-executable +109064K of 224324K are free +Directory of flash:// + +Permission File Size Last Modified File Name +---------- --------- -------------------- -------------------------------------- + -rw- 1960 27-Jul-2020 07:40:50 sw-pl-s5hlavni-1.conf + dr-- 1376 21-Feb-2021 05:32:07 system + -rw- 18055 18-Jun-2019 05:17:35 zaloha.conf diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_cpu_utilization b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_cpu_utilization new file mode 100644 index 000000000..a9fad825a --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_cpu_utilization @@ -0,0 +1,5 @@ +CPU utilization service is on. + +CPU utilization +--------------- +five seconds: 9%; one minute: 10%; five minutes: 10% diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_inventory b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_inventory new file mode 100644 index 000000000..e1b1b0dd2 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_inventory @@ -0,0 +1,24 @@ + +NAME: "1" DESCR: "SG550X-48P 48-Port Gigabit PoE Stackable Managed Switch" +PID: SG550X-48P-K9 VID: V04 SN: ABC1234567A + + +NAME: "TenGigabitEthernet1/0/1" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V03 SN: AB12345678 + + +NAME: "TenGigabitEthernet1/0/2" DESCR: "SFP-1000Base-LX" +PID: GLC-LH-SMD VID: Information Unavailable SN: AB12345678 + + +NAME: "2" DESCR: "SG550X-48 48-Port Gigabit Stackable Managed Switch" +PID: SG550X-48-K9 VID: V02 SN: ABC123456AB + + +NAME: "TenGigabitEthernet2/0/1" DESCR: "SFP-10G-LR" +PID: SFP-10G-LR VID: V03 SN: AB12345678 + + +NAME: "TenGigabitEthernet2/0/2" DESCR: "SFP-1000Base-LX" +PID: GLC-LH-SMD VID: Information Unavailable SN: AB12345678 + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_system b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_system new file mode 100644 index 000000000..d292d2b21 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_system @@ -0,0 +1,29 @@ +System Description: SG550X-48P 48-Port Gigabit PoE Stackable Managed Switch +System Up Time (days,hour:min:sec): 64,02:08:19 +System Contact: +System Name: sw-abcdefgh-1 +System Location: +System MAC Address: 11:aa:22:bb:3c:d4 +System Object ID: 1.3.6.1.4.1.9.6.1.93.48.5 + +Unit Type +---- ---------------------- + 1 SG550X-48P + 2 SG550X-48 + + +Unit Main Power Supply Redundant Power Supply +---- ----------------- ---------------------- + 1 Active Not Connected + 2 Active Not Connected + +Unit Fans Status +---- ------------------------------------- + 1 FANs OK, redundant fan Ready + 2 FANs OK, redundant fan Ready + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 55 OK + 2 67 OK + diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_version b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_version new file mode 100644 index 000000000..f996b84b3 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/fixtures/ciscosmb_facts-stackSG550X-48-show_version @@ -0,0 +1,10 @@ +Active-image: flash://system/images/image1.bin + Version: 2.5.0.83 + MD5 Digest: 07968d912499cff5e8b07fdc24779854 + Date: 18-Jun-2019 + Time: 16:49:35 +Inactive-image: flash://system/images/_image1.bin + Version: 2.5.0.83 + MD5 Digest: 07968d912499cff5e8b07fdc24779854 + Date: 18-Jun-2019 + Time: 16:49:35 diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-CBS350-24P-4G.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-CBS350-24P-4G.py new file mode 100644 index 000000000..49195402f --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-CBS350-24P-4G.py @@ -0,0 +1,112 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + +from ansible_collections.community.ciscosmb.plugins.modules import command + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = command + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.command.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module, commands = args + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_command-CBS350-24P-4G-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_command_simple(self): + set_module_args(dict(commands=["show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 1) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_multiple(self): + set_module_args(dict(commands=["show version", "show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 2) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_wait_for(self): + wait_for = 'result[0] contains "3.0.0.61"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module() + + def test_ciscosmb_command_wait_for_fails(self): + wait_for = 'result[0] contains "test string"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 10) + + def test_ciscosmb_command_retries(self): + wait_for = 'result[0] contains "test string"' + set_module_args( + dict(commands=["show version"], wait_for=wait_for, retries=2) + ) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 2) + + def test_ciscosmb_command_match_any(self): + wait_for = [ + 'result[0] contains "3.0.0.61"', + 'result[0] contains "test string"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="any") + ) + self.execute_module() + + def test_ciscosmb_command_match_all(self): + wait_for = [ + 'result[0] contains "Active-image"', + 'result[0] contains "3.0.0.61"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="all") + ) + self.execute_module() + + def test_ciscosmb_command_match_all_failure(self): + wait_for = [ + 'result[0] contains "3.0.0.61"', + 'result[0] contains "test string"', + ] + commands = ["show version", "show version"] + set_module_args( + dict(commands=commands, wait_for=wait_for, match="all") + ) + self.execute_module(failed=True) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG350-28-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG350-28-K9.py new file mode 100644 index 000000000..95cbbea9b --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG350-28-K9.py @@ -0,0 +1,112 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + +from ansible_collections.community.ciscosmb.plugins.modules import command + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = command + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.command.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module, commands = args + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_command-SG350-28-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_command_simple(self): + set_module_args(dict(commands=["show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 1) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_multiple(self): + set_module_args(dict(commands=["show version", "show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 2) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_wait_for(self): + wait_for = 'result[0] contains "image_tesla"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module() + + def test_ciscosmb_command_wait_for_fails(self): + wait_for = 'result[0] contains "test string"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 10) + + def test_ciscosmb_command_retries(self): + wait_for = 'result[0] contains "test string"' + set_module_args( + dict(commands=["show version"], wait_for=wait_for, retries=2) + ) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 2) + + def test_ciscosmb_command_match_any(self): + wait_for = [ + 'result[0] contains "image_tesla"', + 'result[0] contains "test string"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="any") + ) + self.execute_module() + + def test_ciscosmb_command_match_all(self): + wait_for = [ + 'result[0] contains "Active-image"', + 'result[0] contains "image_tesla"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="all") + ) + self.execute_module() + + def test_ciscosmb_command_match_all_failure(self): + wait_for = [ + 'result[0] contains "image_tesla"', + 'result[0] contains "test string"', + ] + commands = ["show version", "show version"] + set_module_args( + dict(commands=commands, wait_for=wait_for, match="all") + ) + self.execute_module(failed=True) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG500-52-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG500-52-K9.py new file mode 100644 index 000000000..c5b1e8afe --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG500-52-K9.py @@ -0,0 +1,112 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + +from ansible_collections.community.ciscosmb.plugins.modules import command + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = command + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.command.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module, commands = args + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_command-SG500-52-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_command_simple(self): + set_module_args(dict(commands=["show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 1) + self.assertTrue(result["stdout"][0].startswith("SW version")) + + def test_ciscosmb_command_multiple(self): + set_module_args(dict(commands=["show version", "show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 2) + self.assertTrue(result["stdout"][0].startswith("SW version")) + + def test_ciscosmb_command_wait_for(self): + wait_for = 'result[0] contains "Boot version"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module() + + def test_ciscosmb_command_wait_for_fails(self): + wait_for = 'result[0] contains "test string"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 10) + + def test_ciscosmb_command_retries(self): + wait_for = 'result[0] contains "test string"' + set_module_args( + dict(commands=["show version"], wait_for=wait_for, retries=2) + ) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 2) + + def test_ciscosmb_command_match_any(self): + wait_for = [ + 'result[0] contains "Boot version"', + 'result[0] contains "test string"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="any") + ) + self.execute_module() + + def test_ciscosmb_command_match_all(self): + wait_for = [ + 'result[0] contains "SW version"', + 'result[0] contains "Boot version"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="all") + ) + self.execute_module() + + def test_ciscosmb_command_match_all_failure(self): + wait_for = [ + 'result[0] contains "Boot version"', + 'result[0] contains "test string"', + ] + commands = ["show version", "show version"] + set_module_args( + dict(commands=commands, wait_for=wait_for, match="all") + ) + self.execute_module(failed=True) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG550X-24MP-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG550X-24MP-K9.py new file mode 100644 index 000000000..a9687d6bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-SG550X-24MP-K9.py @@ -0,0 +1,112 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + +from ansible_collections.community.ciscosmb.plugins.modules import command + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = command + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.command.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module, commands = args + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_command-SG550X-24MP-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_command_simple(self): + set_module_args(dict(commands=["show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 1) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_multiple(self): + set_module_args(dict(commands=["show version", "show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 2) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_wait_for(self): + wait_for = 'result[0] contains "tesla_hybrid"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module() + + def test_ciscosmb_command_wait_for_fails(self): + wait_for = 'result[0] contains "test string"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 10) + + def test_ciscosmb_command_retries(self): + wait_for = 'result[0] contains "test string"' + set_module_args( + dict(commands=["show version"], wait_for=wait_for, retries=2) + ) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 2) + + def test_ciscosmb_command_match_any(self): + wait_for = [ + 'result[0] contains "tesla_hybrid"', + 'result[0] contains "test string"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="any") + ) + self.execute_module() + + def test_ciscosmb_command_match_all(self): + wait_for = [ + 'result[0] contains "Active-image"', + 'result[0] contains "tesla_hybrid"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="all") + ) + self.execute_module() + + def test_ciscosmb_command_match_all_failure(self): + wait_for = [ + 'result[0] contains "tesla_hybrid"', + 'result[0] contains "test string"', + ] + commands = ["show version", "show version"] + set_module_args( + dict(commands=commands, wait_for=wait_for, match="all") + ) + self.execute_module(failed=True) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-stackSG550X-48.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-stackSG550X-48.py new file mode 100644 index 000000000..824221ad9 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_command-stackSG550X-48.py @@ -0,0 +1,112 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + +from ansible_collections.community.ciscosmb.plugins.modules import command + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = command + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.command.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module, commands = args + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_command-stackSG550X-48-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_command_simple(self): + set_module_args(dict(commands=["show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 1) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_multiple(self): + set_module_args(dict(commands=["show version", "show version"])) + result = self.execute_module() + self.assertEqual(len(result["stdout"]), 2) + self.assertTrue(result["stdout"][0].startswith("Active-image: flash:")) + + def test_ciscosmb_command_wait_for(self): + wait_for = 'result[0] contains "system/images"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module() + + def test_ciscosmb_command_wait_for_fails(self): + wait_for = 'result[0] contains "test string"' + set_module_args(dict(commands=["show version"], wait_for=wait_for)) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 10) + + def test_ciscosmb_command_retries(self): + wait_for = 'result[0] contains "test string"' + set_module_args( + dict(commands=["show version"], wait_for=wait_for, retries=2) + ) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 2) + + def test_ciscosmb_command_match_any(self): + wait_for = [ + 'result[0] contains "Active-image"', + 'result[0] contains "test string"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="any") + ) + self.execute_module() + + def test_ciscosmb_command_match_all(self): + wait_for = [ + 'result[0] contains "Active-image"', + 'result[0] contains "system/images"', + ] + set_module_args( + dict(commands=["show version"], wait_for=wait_for, match="all") + ) + self.execute_module() + + def test_ciscosmb_command_match_all_failure(self): + wait_for = [ + 'result[0] contains "system/images"', + 'result[0] contains "test string"', + ] + commands = ["show version", "show version"] + set_module_args( + dict(commands=commands, wait_for=wait_for, match="all") + ) + self.execute_module(failed=True) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-CBS350-24P-4G.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-CBS350-24P-4G.py new file mode 100644 index 000000000..5ecda0bab --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-CBS350-24P-4G.py @@ -0,0 +1,348 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.plugins.modules import facts +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = facts + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.facts.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module = args + commands = kwargs['commands'] + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_facts-CBS350-24P-4G-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_facts_default_version(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_version'], '3.0.0.61' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hw_version'], 'V01' + ) + + def test_ciscosmb_facts_default_system_info(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_uptime'], 1833986 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hostname'], 'sw-example' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_cpu_load'], '8' + ) + + def test_ciscosmb_facts_default_inventory(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + + self.assertEqual( + result['ansible_facts']['ansible_net_model'], 'CBS350-24P-4G' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_serialnum'], 'FOC2222291D' + ) + + def test_ciscosmb_facts_hardware(self): + set_module_args(dict(gather_subset='hardware')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_spacefree_mb'], 122.9 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_spacetotal_mb'], 218.4 + ) + + def test_ciscosmb_facts_config(self): + set_module_args(dict(gather_subset='config')) + result = self.execute_module() + self.assertIsInstance( + result['ansible_facts']['ansible_net_config'], str + ) + +# def test_ciscosmb_facts_interfaces(self): +# set_module_args(dict(gather_subset='interfaces')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['10.37.129.3', '10.37.0.0', '192.168.88.1'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'], ['fe80::21c:42ff:fe36:5290'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'][0], +# result['ansible_facts']['ansible_net_interfaces']['ether1']['ipv6'][0]['address'] +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_interfaces'].keys()), 11 +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_neighbors']), 4 +# ) +# +# def test_ciscosmb_facts_interfaces_no_ipv6(self): +# fixture = load_fixture( +# 'ciscosmb_facts/ipv6_address_print_detail_without-paging_no-ipv6' +# ) +# interfaces = self.module.Interfaces(module=self.module) +# addresses = interfaces.parse_detail(data=fixture) +# result = interfaces.populate_addresses(data=addresses, family='ipv6') +# +# self.assertEqual(result, None) +# +# def test_ciscosmb_facts_routing(self): +# set_module_args(dict(gather_subset='routing')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['instance'], ['MAIN_AS_STARKDV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-address'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-as'], ['64520'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['nexthop-choice'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['multihop'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['route-reflect'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['hold-time'], ['3m'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['ttl'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['address-families'], ['ip'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['update-source'], ['LAN_KHV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['default-originate'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remove-private-as'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['as-override'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['passive'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['use-bfd'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['route-distinguisher'], ['64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['dst-address'], ['10.10.66.8/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['gateway'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['in-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['out-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-local-pref'], ['100'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-origin'], ['incomplete'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-ext-communities'], ['RT:64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['as'], ['65530'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['router-id'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-other-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['client-to-client-reflection'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['ignore-as-path-len'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['dst-address'], ['10.10.66.0/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['pref-src'], ['10.10.66.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway-status'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['distance'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['scope'], ['10'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['routing-mark'], ['altegro'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['router-id'], ['10.10.50.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['distribute-default'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-other-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-default'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-connected'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-static'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-rip'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-bgp'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-other-ospf'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['in-filter'], ['ospf-in'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['out-filter'], ['ospf-out'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['instance'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['router-id'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['address'], ['10.10.1.2'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['priority'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['backup-dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state'], ['Full'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state-changes'], ['15'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-retransmits'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-requests'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['db-summaries'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['adjacency'], ['6h8m46s'] +# ) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG350-28-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG350-28-K9.py new file mode 100644 index 000000000..24749ebb2 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG350-28-K9.py @@ -0,0 +1,370 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.plugins.modules import facts +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = facts + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.facts.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module = args + commands = kwargs['commands'] + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_facts-SG350-28-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_facts_default(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_version'], '2.4.5.71' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_boot_version'], None + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hw_version'], 'V01' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_uptime'], 890845 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hostname'], 'sw-ab-abcdefg-1' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_cpu_load'], '10' + ) + + self.assertEqual( + result['ansible_facts']['ansible_net_hw_modules'], + { + "1": + { + "descr": "SG350-28 28-Port Gigabit Managed Switch", + "name": "1", + "pid": "SG350-28-K9", + "sn": "ABC1234567A", + "vid": "V01" + }, + "GigabitEthernet28": + { + "descr": "SFP-1000Base-SX", + "name": "GigabitEthernet28", + "pid": "SFP-1000-SX", + "sn": "A123456", + "vid": "Information Unavailable" + } + } + ) + self.assertEqual( + result['ansible_facts']['ansible_net_model'], 'SG350-28-K9' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_serialnum'], 'ABC1234567A' + ) + +# TODO with self.assertRaises(KeyError) as cm: +# TODO len(result['ansible_facts']['ansible_net_stacked_models']) +# TODO the_exception = cm.exception +# TODO self.assertIsInstance(the_exception, KeyError) + +# def test_ciscosmb_facts_hardware(self): +# set_module_args(dict(gather_subset='hardware')) +# result = self.execute_module() +# self.assertEqual( +# result['ansible_facts']['ansible_net_spacefree_mb'], 122.5 +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_spacetotal_mb'], 65024.0 +# ) + +# +# def test_ciscosmb_facts_config(self): +# set_module_args(dict(gather_subset='config')) +# result = self.execute_module() +# self.assertIsInstance( +# result['ansible_facts']['ansible_net_config'], str +# ) +# +# def test_ciscosmb_facts_interfaces(self): +# set_module_args(dict(gather_subset='interfaces')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['10.37.129.3', '10.37.0.0', '192.168.88.1'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'], ['fe80::21c:42ff:fe36:5290'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'][0], +# result['ansible_facts']['ansible_net_interfaces']['ether1']['ipv6'][0]['address'] +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_interfaces'].keys()), 11 +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_neighbors']), 4 +# ) +# +# def test_ciscosmb_facts_interfaces_no_ipv6(self): +# fixture = load_fixture( +# 'ciscosmb_facts/ipv6_address_print_detail_without-paging_no-ipv6' +# ) +# interfaces = self.module.Interfaces(module=self.module) +# addresses = interfaces.parse_detail(data=fixture) +# result = interfaces.populate_addresses(data=addresses, family='ipv6') +# +# self.assertEqual(result, None) +# +# def test_ciscosmb_facts_routing(self): +# set_module_args(dict(gather_subset='routing')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['instance'], ['MAIN_AS_STARKDV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-address'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-as'], ['64520'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['nexthop-choice'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['multihop'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['route-reflect'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['hold-time'], ['3m'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['ttl'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['address-families'], ['ip'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['update-source'], ['LAN_KHV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['default-originate'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remove-private-as'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['as-override'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['passive'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['use-bfd'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['route-distinguisher'], ['64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['dst-address'], ['10.10.66.8/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['gateway'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['in-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['out-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-local-pref'], ['100'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-origin'], ['incomplete'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-ext-communities'], ['RT:64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['as'], ['65530'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['router-id'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-other-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['client-to-client-reflection'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['ignore-as-path-len'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['dst-address'], ['10.10.66.0/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['pref-src'], ['10.10.66.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway-status'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['distance'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['scope'], ['10'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['routing-mark'], ['altegro'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['router-id'], ['10.10.50.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['distribute-default'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-other-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-default'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-connected'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-static'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-rip'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-bgp'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-other-ospf'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['in-filter'], ['ospf-in'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['out-filter'], ['ospf-out'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['instance'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['router-id'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['address'], ['10.10.1.2'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['priority'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['backup-dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state'], ['Full'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state-changes'], ['15'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-retransmits'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-requests'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['db-summaries'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['adjacency'], ['6h8m46s'] +# ) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG500-52-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG500-52-K9.py new file mode 100644 index 000000000..98a185dd7 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG500-52-K9.py @@ -0,0 +1,334 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.plugins.modules import facts +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = facts + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.facts.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module = args + commands = kwargs['commands'] + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_facts-SG500-52-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_facts_default(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_version'], '1.4.8.6' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_boot_version'], '1.3.7.01' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hw_version'], 'V02' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_uptime'], 41737187 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hostname'], 'sw-abcdefg-1' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_cpu_load'], '7' + ) + + self.assertEqual( + result['ansible_facts']['ansible_net_model'], 'SG500-52-K9' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_serialnum'], 'ABC12345678' + ) + + def test_ciscosmb_facts_hardware(self): + set_module_args(dict(gather_subset='hardware')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_spacefree_mb'], 6.8 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_spacetotal_mb'], 31.4 + ) + + def test_ciscosmb_facts_config(self): + set_module_args(dict(gather_subset='config')) + result = self.execute_module() + self.assertIsInstance( + result['ansible_facts']['ansible_net_config'], str + ) + + def test_ciscosmb_facts_interfaces(self): + set_module_args(dict(gather_subset='interfaces')) + result = self.execute_module() + + self.assertIn( + result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['11.30.5.12'] + ) + self.assertEqual( + result['ansible_facts']['ansible_net_all_ipv6_addresses'], ['fe80::36db:fdff:fe64:5bce'] + ) + self.assertEqual( + result['ansible_facts']['ansible_net_all_ipv6_addresses'][0], + result['ansible_facts']['ansible_net_interfaces']['vlan1']['ipv6'][0]['address'] + ) + self.assertEqual( + len(result['ansible_facts']['ansible_net_interfaces'].keys()), 85 + ) + self.assertEqual( + len(result['ansible_facts']['ansible_net_neighbors']), 9 + ) + +# def test_ciscosmb_facts_routing(self): +# set_module_args(dict(gather_subset='routing')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['instance'], ['MAIN_AS_STARKDV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-address'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-as'], ['64520'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['nexthop-choice'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['multihop'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['route-reflect'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['hold-time'], ['3m'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['ttl'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['address-families'], ['ip'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['update-source'], ['LAN_KHV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['default-originate'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remove-private-as'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['as-override'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['passive'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['use-bfd'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['route-distinguisher'], ['64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['dst-address'], ['10.10.66.8/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['gateway'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['in-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['out-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-local-pref'], ['100'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-origin'], ['incomplete'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-ext-communities'], ['RT:64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['as'], ['65530'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['router-id'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-other-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['client-to-client-reflection'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['ignore-as-path-len'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['dst-address'], ['10.10.66.0/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['pref-src'], ['10.10.66.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway-status'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['distance'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['scope'], ['10'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['routing-mark'], ['altegro'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['router-id'], ['10.10.50.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['distribute-default'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-other-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-default'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-connected'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-static'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-rip'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-bgp'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-other-ospf'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['in-filter'], ['ospf-in'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['out-filter'], ['ospf-out'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['instance'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['router-id'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['address'], ['10.10.1.2'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['priority'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['backup-dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state'], ['Full'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state-changes'], ['15'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-retransmits'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-requests'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['db-summaries'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['adjacency'], ['6h8m46s'] +# ) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG550X-24MP-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG550X-24MP-K9.py new file mode 100644 index 000000000..12e7bb4cf --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SG550X-24MP-K9.py @@ -0,0 +1,340 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.plugins.modules import facts +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = facts + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.facts.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module = args + commands = kwargs['commands'] + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_facts-SG550X-24MP-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_facts_default(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_version'], '2.4.5.71' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hw_version'], 'V02' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_uptime'], 9127415 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hostname'], 'sw-abcdefgh' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_cpu_load'], '8' + ) + + self.assertEqual( + result['ansible_facts']['ansible_net_model'], 'SG550X-24MP-K9' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_serialnum'], 'ABC123456AB' + ) + + def test_ciscosmb_facts_hardware(self): + set_module_args(dict(gather_subset='hardware')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_spacefree_mb'], 122.5 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_spacetotal_mb'], 219.3 + ) + + def test_ciscosmb_facts_config(self): + set_module_args(dict(gather_subset='config')) + result = self.execute_module() + self.assertIsInstance( + result['ansible_facts']['ansible_net_config'], str + ) + +# def test_ciscosmb_facts_interfaces(self): +# set_module_args(dict(gather_subset='interfaces')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['10.37.129.3', '10.37.0.0', '192.168.88.1'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'], ['fe80::21c:42ff:fe36:5290'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'][0], +# result['ansible_facts']['ansible_net_interfaces']['ether1']['ipv6'][0]['address'] +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_interfaces'].keys()), 11 +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_neighbors']), 4 +# ) +# +# def test_ciscosmb_facts_interfaces_no_ipv6(self): +# fixture = load_fixture( +# 'ciscosmb_facts/ipv6_address_print_detail_without-paging_no-ipv6' +# ) +# interfaces = self.module.Interfaces(module=self.module) +# addresses = interfaces.parse_detail(data=fixture) +# result = interfaces.populate_addresses(data=addresses, family='ipv6') +# +# self.assertEqual(result, None) +# +# def test_ciscosmb_facts_routing(self): +# set_module_args(dict(gather_subset='routing')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['instance'], ['MAIN_AS_STARKDV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-address'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-as'], ['64520'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['nexthop-choice'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['multihop'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['route-reflect'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['hold-time'], ['3m'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['ttl'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['address-families'], ['ip'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['update-source'], ['LAN_KHV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['default-originate'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remove-private-as'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['as-override'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['passive'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['use-bfd'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['route-distinguisher'], ['64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['dst-address'], ['10.10.66.8/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['gateway'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['in-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['out-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-local-pref'], ['100'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-origin'], ['incomplete'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-ext-communities'], ['RT:64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['as'], ['65530'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['router-id'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-other-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['client-to-client-reflection'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['ignore-as-path-len'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['dst-address'], ['10.10.66.0/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['pref-src'], ['10.10.66.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway-status'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['distance'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['scope'], ['10'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['routing-mark'], ['altegro'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['router-id'], ['10.10.50.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['distribute-default'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-other-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-default'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-connected'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-static'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-rip'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-bgp'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-other-ospf'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['in-filter'], ['ospf-in'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['out-filter'], ['ospf-out'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['instance'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['router-id'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['address'], ['10.10.1.2'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['priority'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['backup-dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state'], ['Full'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state-changes'], ['15'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-retransmits'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-requests'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['db-summaries'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['adjacency'], ['6h8m46s'] +# ) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SX550X-24F-K9.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SX550X-24F-K9.py new file mode 100644 index 000000000..b52bdb2d5 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-SX550X-24F-K9.py @@ -0,0 +1,64 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.plugins.modules import facts +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = facts + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.facts.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module = args + commands = kwargs['commands'] + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_facts-SX550X-24F-K9-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_facts_default(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + + self.assertEqual( + result['ansible_facts']['ansible_net_hw_version'], 'V02' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_model'], 'SX550X-24F-K9' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_serialnum'], 'DNI22500E5F' + ) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-stackSG550X-48.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-stackSG550X-48.py new file mode 100644 index 000000000..ff70a3cd4 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/ciscosmb/test_ciscosmb_facts-stackSG550X-48.py @@ -0,0 +1,393 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see <http://www.gnu.org/licenses/>. + +# Make coding more python3-ish +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible_collections.community.ciscosmb.plugins.modules import facts +from ansible_collections.community.ciscosmb.tests.unit.plugins.modules.utils import set_module_args +from .ciscosmb_module import TestCiscoSMBModule, load_fixture + + +class TestCiscoSMBFactsModule(TestCiscoSMBModule): + + module = facts + + def setUp(self): + super(TestCiscoSMBFactsModule, self).setUp() + self.mock_run_commands = patch('ansible_collections.community.ciscosmb.plugins.modules.facts.run_commands') + self.run_commands = self.mock_run_commands.start() + + def tearDown(self): + super(TestCiscoSMBFactsModule, self).tearDown() + self.mock_run_commands.stop() + + def load_fixtures(self, commands=None): + def load_from_file(*args, **kwargs): + module = args + commands = kwargs['commands'] + output = list() + + for command in commands: + filename = str(command).split(' | ', 1)[0].replace(' ', '_') + output.append(load_fixture('ciscosmb_facts-stackSG550X-48-%s' % filename)) + return output + + self.run_commands.side_effect = load_from_file + + def test_ciscosmb_facts_default(self): + set_module_args(dict(gather_subset='default')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_version'], '2.5.0.83' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_uptime'], 5537299 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hostname'], 'sw-abcdefgh-1' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_cpu_load'], '10' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_stacked_models'], ['SG550X-48P-K9', 'SG550X-48-K9'] + ) + self.assertEqual( + result['ansible_facts']['ansible_net_stacked_serialnums'], ['ABC1234567A', 'ABC123456AB'] + ) + self.assertEqual( + result['ansible_facts']['ansible_net_model'], 'Stack SG550X' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_serialnum'], 'ABC1234567A' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hw_version'], 'V04' + ) + self.assertEqual( + result['ansible_facts']['ansible_net_hw_modules'], + { + "1": { + "descr": "SG550X-48P 48-Port Gigabit PoE Stackable Managed Switch", + "name": "1", + "pid": "SG550X-48P-K9", + "sn": "ABC1234567A", + "vid": "V04" + }, + "2": { + "descr": "SG550X-48 48-Port Gigabit Stackable Managed Switch", + "name": "2", + "pid": "SG550X-48-K9", + "sn": "ABC123456AB", + "vid": "V02" + }, + "TenGigabitEthernet1/0/1": { + "descr": "SFP-10G-LR", + "name": "TenGigabitEthernet1/0/1", + "pid": "SFP-10G-LR", + "sn": "AB12345678", + "vid": "V03" + }, + "TenGigabitEthernet1/0/2": { + "descr": "SFP-1000Base-LX", + "name": "TenGigabitEthernet1/0/2", + "pid": "GLC-LH-SMD", + "sn": "AB12345678", + "vid": "Information Unavailable" + }, + "TenGigabitEthernet2/0/1": { + "descr": "SFP-10G-LR", + "name": "TenGigabitEthernet2/0/1", + "pid": "SFP-10G-LR", + "sn": "AB12345678", + "vid": "V03" + }, + "TenGigabitEthernet2/0/2": { + "descr": "SFP-1000Base-LX", + "name": "TenGigabitEthernet2/0/2", + "pid": "GLC-LH-SMD", + "sn": "AB12345678", + "vid": "Information Unavailable" + } + } + + ) + + def test_ciscosmb_facts_hardware(self): + set_module_args(dict(gather_subset='hardware')) + result = self.execute_module() + self.assertEqual( + result['ansible_facts']['ansible_net_spacefree_mb'], 106.5 + ) + self.assertEqual( + result['ansible_facts']['ansible_net_spacetotal_mb'], 219.1 + ) + +# def test_ciscosmb_facts_config(self): +# set_module_args(dict(gather_subset='config')) +# result = self.execute_module() +# self.assertIsInstance( +# result['ansible_facts']['ansible_net_config'], str +# ) +# +# def test_ciscosmb_facts_interfaces(self): +# set_module_args(dict(gather_subset='interfaces')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['10.37.129.3', '10.37.0.0', '192.168.88.1'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'], ['fe80::21c:42ff:fe36:5290'] +# ) +# self.assertEqual( +# result['ansible_facts']['ansible_net_all_ipv6_addresses'][0], +# result['ansible_facts']['ansible_net_interfaces']['ether1']['ipv6'][0]['address'] +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_interfaces'].keys()), 11 +# ) +# self.assertEqual( +# len(result['ansible_facts']['ansible_net_neighbors']), 4 +# ) +# +# def test_ciscosmb_facts_interfaces_no_ipv6(self): +# fixture = load_fixture( +# 'ciscosmb_facts/ipv6_address_print_detail_without-paging_no-ipv6' +# ) +# interfaces = self.module.Interfaces(module=self.module) +# addresses = interfaces.parse_detail(data=fixture) +# result = interfaces.populate_addresses(data=addresses, family='ipv6') +# +# self.assertEqual(result, None) +# +# def test_ciscosmb_facts_routing(self): +# set_module_args(dict(gather_subset='routing')) +# result = self.execute_module() +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['instance'], ['MAIN_AS_STARKDV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-address'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remote-as'], ['64520'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['nexthop-choice'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['multihop'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['route-reflect'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['hold-time'], ['3m'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['ttl'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['address-families'], ['ip'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['update-source'], ['LAN_KHV'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['default-originate'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['remove-private-as'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['as-override'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['passive'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['use-bfd'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['route-distinguisher'], ['64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['dst-address'], ['10.10.66.8/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['gateway'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['in-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['out-label'], ['6136'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-local-pref'], ['100'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-origin'], ['incomplete'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_vpnv4_route']['GRE_TYRMA']['bgp-ext-communities'], ['RT:64520:666'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['as'], ['65530'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['router-id'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['redistribute-other-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['client-to-client-reflection'], ['yes'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_bgp_instance']['default']['ignore-as-path-len'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['dst-address'], ['10.10.66.0/30'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['pref-src'], ['10.10.66.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['gateway-status'], ['bridge1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['distance'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['scope'], ['10'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_route']['altegro']['routing-mark'], ['altegro'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['name'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['router-id'], ['10.10.50.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['distribute-default'], ['never'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-connected'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-static'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-rip'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-bgp'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['redistribute-other-ospf'], ['no'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-default'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-connected'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-static'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-rip'], ['20'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-bgp'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['metric-other-ospf'], ['auto'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['in-filter'], ['ospf-in'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_instance']['default']['out-filter'], ['ospf-out'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['instance'], ['default'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['router-id'], ['10.10.100.1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['address'], ['10.10.1.2'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['interface'], ['GRE_TYRMA'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['priority'], ['1'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['backup-dr-address'], ['0.0.0.0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state'], ['Full'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['state-changes'], ['15'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-retransmits'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['ls-requests'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['db-summaries'], ['0'] +# ) +# self.assertIn( +# result['ansible_facts']['ansible_net_ospf_neighbor']['default']['adjacency'], ['6h8m46s'] +# ) diff --git a/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/utils.py b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/utils.py new file mode 100644 index 000000000..915b462d9 --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/plugins/modules/utils.py @@ -0,0 +1,50 @@ +from __future__ import absolute_import, division, print_function +__metaclass__ = type + +import json + +from ansible_collections.community.ciscosmb.tests.unit.compat import unittest +from ansible_collections.community.ciscosmb.tests.unit.compat.mock import patch +from ansible.module_utils import basic +from ansible.module_utils._text import to_bytes + + +def set_module_args(args): + if '_ansible_remote_tmp' not in args: + args['_ansible_remote_tmp'] = '/tmp' + if '_ansible_keep_remote_files' not in args: + args['_ansible_keep_remote_files'] = False + + args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) + basic._ANSIBLE_ARGS = to_bytes(args) + + +class AnsibleExitJson(Exception): + pass + + +class AnsibleFailJson(Exception): + pass + + +def exit_json(*args, **kwargs): + if 'changed' not in kwargs: + kwargs['changed'] = False + raise AnsibleExitJson(kwargs) + + +def fail_json(*args, **kwargs): + kwargs['failed'] = True + raise AnsibleFailJson(kwargs) + + +class ModuleTestCase(unittest.TestCase): + + def setUp(self): + self.mock_module = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) + self.mock_module.start() + self.mock_sleep = patch('time.sleep') + self.mock_sleep.start() + set_module_args({}) + self.addCleanup(self.mock_module.stop) + self.addCleanup(self.mock_sleep.stop) diff --git a/ansible_collections/community/ciscosmb/tests/unit/requirements.txt b/ansible_collections/community/ciscosmb/tests/unit/requirements.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ansible_collections/community/ciscosmb/tests/unit/requirements.txt |