mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Add mlnxos_config module (#33356)
* Add new module mlnxos_config Signed-off-by: Samer Deeb <samerd@mellanox.com> * Add unit-test for mlnxos_config module Signed-off-by: Samer Deeb <samerd@mellanox.com>
This commit is contained in:
committed by
John R Barker
parent
addb882138
commit
717b6e7c1a
@@ -24,7 +24,6 @@ import os
|
||||
|
||||
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase
|
||||
|
||||
|
||||
fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures')
|
||||
fixture_data = {}
|
||||
|
||||
@@ -49,7 +48,7 @@ def load_fixture(name):
|
||||
|
||||
class TestMlnxosModule(ModuleTestCase):
|
||||
|
||||
def execute_module(self, failed=False, changed=False, commands=None, inputs=None, sort=True, defaults=False, transport='cli'):
|
||||
def execute_module(self, failed=False, changed=False, commands=None, is_updates=False, sort=True, transport='cli'):
|
||||
|
||||
self.load_fixtures(commands, transport=transport)
|
||||
|
||||
@@ -61,10 +60,14 @@ class TestMlnxosModule(ModuleTestCase):
|
||||
self.assertEqual(result['changed'], changed, result)
|
||||
|
||||
if commands is not None:
|
||||
if sort:
|
||||
self.assertEqual(sorted(commands), sorted(result['commands']), result['commands'])
|
||||
if is_updates:
|
||||
commands_res = result.get('updates')
|
||||
else:
|
||||
self.assertEqual(commands, result['commands'], result['commands'])
|
||||
commands_res = result.get('commands')
|
||||
if sort:
|
||||
self.assertEqual(sorted(commands), sorted(commands_res), commands_res)
|
||||
else:
|
||||
self.assertEqual(commands, commands_res, commands_res)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user