mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Mellanox OS name change: MLNXOS changed to ONYX (#34753)
* Mellanox OS name change: MLNXOS changed to ONYX Signed-off-by: Samer Deeb <samerd@mellanox.com> * Fix alphabetical order of modules metadata Signed-off-by: Samer Deeb <samerd@mellanox.com>
This commit is contained in:
parent
57ff84251e
commit
f8884f12bc
73 changed files with 381 additions and 383 deletions
|
@ -46,7 +46,7 @@ def load_fixture(name):
|
|||
return data
|
||||
|
||||
|
||||
class TestMlnxosModule(ModuleTestCase):
|
||||
class TestOnyxModule(ModuleTestCase):
|
||||
|
||||
def execute_module(self, failed=False, changed=False, commands=None, is_updates=False, sort=True, transport='cli'):
|
||||
|
|
@ -7,32 +7,32 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_bgp
|
||||
from ansible.modules.network.onyx import onyx_bgp
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosBgpModule(TestMlnxosModule):
|
||||
class TestOnyxBgpModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_bgp
|
||||
module = onyx_bgp
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosBgpModule, self).setUp()
|
||||
super(TestOnyxBgpModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_bgp.MlnxosBgpModule, "_get_bgp_summary")
|
||||
onyx_bgp.OnyxBgpModule, "_get_bgp_summary")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosBgpModule, self).tearDown()
|
||||
super(TestOnyxBgpModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_bgp_show.cfg'
|
||||
config_file = 'onyx_bgp_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
|
@ -22,23 +22,23 @@ __metaclass__ = type
|
|||
import json
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_command
|
||||
from ansible.modules.network.onyx import onyx_command
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosCommandModule(TestMlnxosModule):
|
||||
class TestOnyxCommandModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_command
|
||||
module = onyx_command
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosCommandModule, self).setUp()
|
||||
super(TestOnyxCommandModule, self).setUp()
|
||||
self.mock_run_commands = patch(
|
||||
'ansible.modules.network.mlnxos.mlnxos_command.run_commands')
|
||||
'ansible.modules.network.onyx.onyx_command.run_commands')
|
||||
self.run_commands = self.mock_run_commands.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosCommandModule, self).tearDown()
|
||||
super(TestOnyxCommandModule, self).tearDown()
|
||||
self.mock_run_commands.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
|
@ -53,43 +53,43 @@ class TestMlnxosCommandModule(TestMlnxosModule):
|
|||
except ValueError:
|
||||
command = item['command']
|
||||
filename = str(command).replace(' ', '_')
|
||||
filename = 'mlnxos_command_%s.txt' % filename
|
||||
filename = 'onyx_command_%s.txt' % filename
|
||||
output.append(load_fixture(filename))
|
||||
return output
|
||||
|
||||
self.run_commands.side_effect = load_from_file
|
||||
|
||||
def test_mlnxos_command_simple(self):
|
||||
def test_onyx_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('Product name'))
|
||||
|
||||
def test_mlnxos_command_multiple(self):
|
||||
def test_onyx_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('Product name'))
|
||||
|
||||
def test_mlnxos_command_wait_for(self):
|
||||
def test_onyx_command_wait_for(self):
|
||||
wait_for = 'result[0] contains "MLNX"'
|
||||
set_module_args(dict(commands=['show version'], wait_for=wait_for))
|
||||
self.execute_module()
|
||||
|
||||
def test_mlnxos_command_wait_for_fails(self):
|
||||
def test_onyx_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_mlnxos_command_retries(self):
|
||||
def test_onyx_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_mlnxos_command_match_any(self):
|
||||
def test_onyx_command_match_any(self):
|
||||
wait_for = ['result[0] contains "MLNX"',
|
||||
'result[0] contains "test string"']
|
||||
set_module_args(dict(
|
||||
|
@ -98,14 +98,14 @@ class TestMlnxosCommandModule(TestMlnxosModule):
|
|||
match='any'))
|
||||
self.execute_module()
|
||||
|
||||
def test_mlnxos_command_match_all(self):
|
||||
def test_onyx_command_match_all(self):
|
||||
wait_for = ['result[0] contains "MLNX"',
|
||||
'result[0] contains "Version summary"']
|
||||
set_module_args(
|
||||
dict(commands=['show version'], wait_for=wait_for, match='all'))
|
||||
self.execute_module()
|
||||
|
||||
def test_mlnxos_command_match_all_failure(self):
|
||||
def test_onyx_command_match_all_failure(self):
|
||||
wait_for = ['result[0] contains "MLNX"',
|
||||
'result[0] contains "test string"']
|
||||
commands = ['show version', 'show version']
|
|
@ -21,56 +21,56 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_config
|
||||
from ansible.modules.network.onyx import onyx_config
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosConfigModule(TestMlnxosModule):
|
||||
class TestOnyxConfigModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_config
|
||||
module = onyx_config
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosConfigModule, self).setUp()
|
||||
super(TestOnyxConfigModule, self).setUp()
|
||||
|
||||
self.mock_get_config = patch('ansible.modules.network.mlnxos.mlnxos_config.get_config')
|
||||
self.mock_get_config = patch('ansible.modules.network.onyx.onyx_config.get_config')
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch('ansible.modules.network.mlnxos.mlnxos_config.load_config')
|
||||
self.mock_load_config = patch('ansible.modules.network.onyx.onyx_config.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
self.mock_run_commands = patch('ansible.modules.network.mlnxos.mlnxos_config.run_commands')
|
||||
self.mock_run_commands = patch('ansible.modules.network.onyx.onyx_config.run_commands')
|
||||
self.run_commands = self.mock_run_commands.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosConfigModule, self).tearDown()
|
||||
super(TestOnyxConfigModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
self.mock_run_commands.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_config_config.cfg'
|
||||
config_file = 'onyx_config_config.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
||||
def test_mlnxos_config_unchanged(self):
|
||||
src = load_fixture('mlnxos_config_config.cfg')
|
||||
def test_onyx_config_unchanged(self):
|
||||
src = load_fixture('onyx_config_config.cfg')
|
||||
set_module_args(dict(src=src))
|
||||
self.execute_module()
|
||||
|
||||
def test_mlnxos_config_src(self):
|
||||
src = load_fixture('mlnxos_config_src.cfg')
|
||||
def test_onyx_config_src(self):
|
||||
src = load_fixture('onyx_config_src.cfg')
|
||||
set_module_args(dict(src=src))
|
||||
commands = [
|
||||
'interface mlag-port-channel 2']
|
||||
self.execute_module(changed=True, commands=commands, is_updates=True)
|
||||
|
||||
def test_mlnxos_config_backup(self):
|
||||
def test_onyx_config_backup(self):
|
||||
set_module_args(dict(backup=True))
|
||||
result = self.execute_module()
|
||||
self.assertIn('__backup__', result)
|
||||
|
||||
def test_mlnxos_config_save(self):
|
||||
def test_onyx_config_save(self):
|
||||
set_module_args(dict(save='yes'))
|
||||
self.execute_module(changed=True)
|
||||
self.assertEqual(self.run_commands.call_count, 1)
|
||||
|
@ -79,35 +79,35 @@ class TestMlnxosConfigModule(TestMlnxosModule):
|
|||
args = self.run_commands.call_args[0][1]
|
||||
self.assertIn('configuration write', args)
|
||||
|
||||
def test_mlnxos_config_lines_wo_parents(self):
|
||||
def test_onyx_config_lines_wo_parents(self):
|
||||
set_module_args(dict(lines=['hostname foo']))
|
||||
commands = ['hostname foo']
|
||||
self.execute_module(changed=True, commands=commands, is_updates=True)
|
||||
|
||||
def test_mlnxos_config_before(self):
|
||||
def test_onyx_config_before(self):
|
||||
set_module_args(dict(lines=['hostname foo'], before=['test1', 'test2']))
|
||||
commands = ['test1', 'test2', 'hostname foo']
|
||||
self.execute_module(changed=True, commands=commands, sort=False, is_updates=True)
|
||||
|
||||
def test_mlnxos_config_after(self):
|
||||
def test_onyx_config_after(self):
|
||||
set_module_args(dict(lines=['hostname foo'], after=['test1', 'test2']))
|
||||
commands = ['hostname foo', 'test1', 'test2']
|
||||
self.execute_module(changed=True, commands=commands, sort=False, is_updates=True)
|
||||
|
||||
def test_mlnxos_config_before_after(self):
|
||||
def test_onyx_config_before_after(self):
|
||||
set_module_args(dict(lines=['hostname foo'],
|
||||
before=['test1', 'test2'],
|
||||
after=['test3', 'test4']))
|
||||
commands = ['test1', 'test2', 'hostname foo', 'test3', 'test4']
|
||||
self.execute_module(changed=True, commands=commands, sort=False, is_updates=True)
|
||||
|
||||
def test_mlnxos_config_config(self):
|
||||
def test_onyx_config_config(self):
|
||||
config = 'hostname localhost'
|
||||
set_module_args(dict(lines=['hostname router'], config=config))
|
||||
commands = ['hostname router']
|
||||
self.execute_module(changed=True, commands=commands, is_updates=True)
|
||||
|
||||
def test_mlnxos_config_match_none(self):
|
||||
def test_onyx_config_match_none(self):
|
||||
lines = ['hostname router']
|
||||
set_module_args(dict(lines=lines, match='none'))
|
||||
self.execute_module(changed=True, commands=lines, is_updates=True)
|
|
@ -8,23 +8,23 @@ __metaclass__ = type
|
|||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from ansible.modules.network.mlnxos import mlnxos_facts
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
from ansible.modules.network.onyx import onyx_facts
|
||||
|
||||
|
||||
class TestMlnxosFacts(TestMlnxosModule):
|
||||
class TestOnyxFacts(TestOnyxModule):
|
||||
|
||||
module = mlnxos_facts
|
||||
module = onyx_facts
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosFacts, self).setUp()
|
||||
super(TestOnyxFacts, self).setUp()
|
||||
|
||||
self.mock_run_command = patch.object(
|
||||
mlnxos_facts.FactsBase, "_show_cmd")
|
||||
onyx_facts.FactsBase, "_show_cmd")
|
||||
self.run_command = self.mock_run_command.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosFacts, self).tearDown()
|
||||
super(TestOnyxFacts, self).tearDown()
|
||||
|
||||
self.mock_run_command.stop()
|
||||
|
||||
|
@ -32,7 +32,7 @@ class TestMlnxosFacts(TestMlnxosModule):
|
|||
|
||||
def load_from_file(*args, **kwargs):
|
||||
command = args[0]
|
||||
filename = "mlnxos_facts_%s.cfg" % command
|
||||
filename = "onyx_facts_%s.cfg" % command
|
||||
filename = filename.replace(' ', '_')
|
||||
filename = filename.replace('/', '7')
|
||||
output = load_fixture(filename)
|
||||
|
@ -40,7 +40,7 @@ class TestMlnxosFacts(TestMlnxosModule):
|
|||
|
||||
self.run_command.side_effect = load_from_file
|
||||
|
||||
def test_mlnxos_facts_version(self):
|
||||
def test_onyx_facts_version(self):
|
||||
set_module_args(dict(gather_subset='version'))
|
||||
result = self.execute_module()
|
||||
facts = result.get('ansible_facts')
|
||||
|
@ -48,7 +48,7 @@ class TestMlnxosFacts(TestMlnxosModule):
|
|||
version = facts['ansible_net_version']
|
||||
self.assertEqual(version['Product name'], 'MLNX-OS')
|
||||
|
||||
def test_mlnxos_facts_modules(self):
|
||||
def test_onyx_facts_modules(self):
|
||||
set_module_args(dict(gather_subset='modules'))
|
||||
result = self.execute_module()
|
||||
facts = result.get('ansible_facts')
|
||||
|
@ -56,7 +56,7 @@ class TestMlnxosFacts(TestMlnxosModule):
|
|||
modules = facts['ansible_net_modules']
|
||||
self.assertIn("MGMT", modules)
|
||||
|
||||
def test_mlnxos_facts_interfaces(self):
|
||||
def test_onyx_facts_interfaces(self):
|
||||
set_module_args(dict(gather_subset='interfaces'))
|
||||
result = self.execute_module()
|
||||
facts = result.get('ansible_facts')
|
||||
|
@ -64,7 +64,7 @@ class TestMlnxosFacts(TestMlnxosModule):
|
|||
interfaces = facts['ansible_net_interfaces']
|
||||
self.assertEqual(len(interfaces), 2)
|
||||
|
||||
def test_mlnxos_facts_all(self):
|
||||
def test_onyx_facts_all(self):
|
||||
set_module_args(dict(gather_subset='all'))
|
||||
result = self.execute_module()
|
||||
facts = result.get('ansible_facts')
|
|
@ -7,40 +7,40 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_interface
|
||||
from ansible.modules.network.onyx import onyx_interface
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosInterfaceModule(TestMlnxosModule):
|
||||
class TestOnyxInterfaceModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_interface
|
||||
module = onyx_interface
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosInterfaceModule, self).setUp()
|
||||
super(TestOnyxInterfaceModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_interface.MlnxosInterfaceModule, "_get_interfaces_config")
|
||||
onyx_interface.OnyxInterfaceModule, "_get_interfaces_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_get_interfaces_status = patch.object(
|
||||
mlnxos_interface.MlnxosInterfaceModule, "_get_interfaces_status")
|
||||
onyx_interface.OnyxInterfaceModule, "_get_interfaces_status")
|
||||
self.get_interfaces_status = self.mock_get_interfaces_status.start()
|
||||
|
||||
self.mock_get_interfaces_rates = patch.object(
|
||||
mlnxos_interface.MlnxosInterfaceModule, "_get_interfaces_rates")
|
||||
onyx_interface.OnyxInterfaceModule, "_get_interfaces_rates")
|
||||
self.get_interfaces_rates = self.mock_get_interfaces_rates.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosInterfaceModule, self).tearDown()
|
||||
super(TestOnyxInterfaceModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_interfaces_show.cfg'
|
||||
config_file = 'onyx_interfaces_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
||||
|
@ -97,24 +97,24 @@ class TestMlnxosInterfaceModule(TestMlnxosModule):
|
|||
|
||||
def test_oper_state_check(self):
|
||||
set_module_args(dict(name='Eth1/1', enabled=True, state='down'))
|
||||
config_file = 'mlnxos_interfaces_status.cfg'
|
||||
config_file = 'onyx_interfaces_status.cfg'
|
||||
self.get_interfaces_status.return_value = load_fixture(config_file)
|
||||
self.execute_module(changed=False)
|
||||
|
||||
def test_vlan_oper_state_check(self):
|
||||
set_module_args(dict(name='Vlan 1002', state='down'))
|
||||
config_file = 'mlnxos_interfaces_status.cfg'
|
||||
config_file = 'onyx_interfaces_status.cfg'
|
||||
self.get_interfaces_status.return_value = load_fixture(config_file)
|
||||
self.execute_module(changed=False)
|
||||
|
||||
def test_rx_rate_check(self):
|
||||
set_module_args(dict(name='Eth1/1', enabled=True, rx_rate='ge(9000)'))
|
||||
config_file = 'mlnxos_interfaces_rates.cfg'
|
||||
config_file = 'onyx_interfaces_rates.cfg'
|
||||
self.get_interfaces_rates.return_value = load_fixture(config_file)
|
||||
self.execute_module(changed=False)
|
||||
|
||||
def test_tx_rate_check(self):
|
||||
set_module_args(dict(name='Eth1/1', enabled=True, tx_rate='ge(10000)'))
|
||||
config_file = 'mlnxos_interfaces_rates.cfg'
|
||||
config_file = 'onyx_interfaces_rates.cfg'
|
||||
self.get_interfaces_rates.return_value = load_fixture(config_file)
|
||||
self.execute_module(changed=False)
|
|
@ -21,32 +21,32 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_l2_interface
|
||||
from ansible.modules.network.onyx import onyx_l2_interface
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosInterfaceModule(TestMlnxosModule):
|
||||
class TestOnyxInterfaceModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_l2_interface
|
||||
module = onyx_l2_interface
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosInterfaceModule, self).setUp()
|
||||
super(TestOnyxInterfaceModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_l2_interface.MlnxosL2InterfaceModule, "_get_switchport_config")
|
||||
onyx_l2_interface.OnyxL2InterfaceModule, "_get_switchport_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosInterfaceModule, self).tearDown()
|
||||
super(TestOnyxInterfaceModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_l2_interface_show.cfg'
|
||||
config_file = 'onyx_l2_interface_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
|
@ -7,28 +7,28 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_l3_interface
|
||||
from ansible.modules.network.onyx import onyx_l3_interface
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosL3InterfaceModule(TestMlnxosModule):
|
||||
class TestOnyxL3InterfaceModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_l3_interface
|
||||
module = onyx_l3_interface
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosL3InterfaceModule, self).setUp()
|
||||
super(TestOnyxL3InterfaceModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_l3_interface.MlnxosL3InterfaceModule,
|
||||
onyx_l3_interface.OnyxL3InterfaceModule,
|
||||
"_get_interfaces_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosL3InterfaceModule, self).tearDown()
|
||||
super(TestOnyxL3InterfaceModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
|
@ -54,11 +54,11 @@ class TestMlnxosL3InterfaceModule(TestMlnxosModule):
|
|||
self.load_config.return_value = None
|
||||
|
||||
def load_eth_ifc_fixture(self):
|
||||
config_file = 'mlnxos_l3_interface_show.cfg'
|
||||
config_file = 'onyx_l3_interface_show.cfg'
|
||||
self.load_fixture(config_file)
|
||||
|
||||
def load_vlan_ifc_fixture(self):
|
||||
config_file = 'mlnxos_l3_vlan_interface_show.cfg'
|
||||
config_file = 'onyx_l3_vlan_interface_show.cfg'
|
||||
self.load_fixture(config_file)
|
||||
|
||||
def test_vlan_ifc_no_change(self):
|
|
@ -7,28 +7,28 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_linkagg
|
||||
from ansible.modules.network.onyx import onyx_linkagg
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosLinkaggModule(TestMlnxosModule):
|
||||
class TestOnyxLinkaggModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_linkagg
|
||||
module = onyx_linkagg
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosLinkaggModule, self).setUp()
|
||||
super(TestOnyxLinkaggModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_linkagg.MlnxosLinkAggModule,
|
||||
onyx_linkagg.OnyxLinkAggModule,
|
||||
"_get_port_channels")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosLinkaggModule, self).tearDown()
|
||||
super(TestOnyxLinkaggModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
|
@ -37,11 +37,11 @@ class TestMlnxosLinkaggModule(TestMlnxosModule):
|
|||
self.load_config.return_value = None
|
||||
|
||||
def load_port_channel_fixture(self):
|
||||
config_file = 'mlnxos_port_channel_show.cfg'
|
||||
config_file = 'onyx_port_channel_show.cfg'
|
||||
self.load_fixture(config_file)
|
||||
|
||||
def load_mlag_port_channel_fixture(self):
|
||||
config_file = 'mlnxos_mlag_port_channel_show.cfg'
|
||||
config_file = 'onyx_mlag_port_channel_show.cfg'
|
||||
self.load_fixture(config_file)
|
||||
|
||||
def test_port_channel_no_change(self):
|
|
@ -23,28 +23,27 @@ __metaclass__ = type
|
|||
import json
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_lldp
|
||||
from ansible.module_utils.network.mlnxos import mlnxos as mlnxos_utils
|
||||
from ansible.modules.network.onyx import onyx_lldp
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosInterfaceModule(TestMlnxosModule):
|
||||
class TestOnyxInterfaceModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_lldp
|
||||
module = onyx_lldp
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosInterfaceModule, self).setUp()
|
||||
super(TestOnyxInterfaceModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_lldp.MlnxosLldpModule, "_get_lldp_config")
|
||||
onyx_lldp.OnyxLldpModule, "_get_lldp_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosInterfaceModule, self).tearDown()
|
||||
super(TestOnyxInterfaceModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
|
@ -52,7 +51,7 @@ class TestMlnxosInterfaceModule(TestMlnxosModule):
|
|||
if commands == ['lldp']:
|
||||
self.get_config.return_value = None
|
||||
else:
|
||||
config_file = 'mlnxos_lldp_show.cfg'
|
||||
config_file = 'onyx_lldp_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
|
@ -7,33 +7,33 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_lldp_interface
|
||||
from ansible.modules.network.onyx import onyx_lldp_interface
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosLldpInterfaceModule(TestMlnxosModule):
|
||||
class TestOnyxLldpInterfaceModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_lldp_interface
|
||||
module = onyx_lldp_interface
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosLldpInterfaceModule, self).setUp()
|
||||
super(TestOnyxLldpInterfaceModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_lldp_interface.MlnxosLldpInterfaceModule,
|
||||
onyx_lldp_interface.OnyxLldpInterfaceModule,
|
||||
"_get_lldp_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosLldpInterfaceModule, self).tearDown()
|
||||
super(TestOnyxLldpInterfaceModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_lldp_interface_show.cfg'
|
||||
config_file = 'onyx_lldp_interface_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
|
@ -7,33 +7,33 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_magp
|
||||
from ansible.modules.network.onyx import onyx_magp
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosMagpModule(TestMlnxosModule):
|
||||
class TestOnyxMagpModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_magp
|
||||
module = onyx_magp
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosMagpModule, self).setUp()
|
||||
super(TestOnyxMagpModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_magp.MlnxosMagpModule,
|
||||
onyx_magp.OnyxMagpModule,
|
||||
"_get_magp_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosMagpModule, self).tearDown()
|
||||
super(TestOnyxMagpModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_magp_show.cfg'
|
||||
config_file = 'onyx_magp_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
|
@ -7,35 +7,35 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_mlag_ipl
|
||||
from ansible.modules.network.onyx import onyx_mlag_ipl
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosMlagIplModule(TestMlnxosModule):
|
||||
class TestOnyxMlagIplModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_mlag_ipl
|
||||
module = onyx_mlag_ipl
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosMlagIplModule, self).setUp()
|
||||
super(TestOnyxMlagIplModule, self).setUp()
|
||||
self._mlag_enabled = True
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_mlag_ipl.MlnxosMlagIplModule,
|
||||
onyx_mlag_ipl.OnyxMlagIplModule,
|
||||
"_show_mlag_data")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosMlagIplModule, self).tearDown()
|
||||
super(TestOnyxMlagIplModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
if self._mlag_enabled:
|
||||
config_file = 'mlnxos_mlag_ipl_show.cfg'
|
||||
config_file = 'onyx_mlag_ipl_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
else:
|
||||
self.get_config.return_value = None
|
|
@ -7,42 +7,42 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_mlag_vip
|
||||
from ansible.modules.network.onyx import onyx_mlag_vip
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosMlagVipModule(TestMlnxosModule):
|
||||
class TestOnyxMlagVipModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_mlag_vip
|
||||
module = onyx_mlag_vip
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosMlagVipModule, self).setUp()
|
||||
super(TestOnyxMlagVipModule, self).setUp()
|
||||
self._mlag_enabled = True
|
||||
self.mock_show_mlag = patch.object(
|
||||
mlnxos_mlag_vip.MlnxosMLagVipModule,
|
||||
onyx_mlag_vip.OnyxMLagVipModule,
|
||||
"_show_mlag")
|
||||
self.show_mlag = self.mock_show_mlag.start()
|
||||
self.mock_show_mlag_vip = patch.object(
|
||||
mlnxos_mlag_vip.MlnxosMLagVipModule,
|
||||
onyx_mlag_vip.OnyxMLagVipModule,
|
||||
"_show_mlag_vip")
|
||||
self.show_mlag_vip = self.mock_show_mlag_vip.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosMlagVipModule, self).tearDown()
|
||||
super(TestOnyxMlagVipModule, self).tearDown()
|
||||
self.mock_show_mlag.stop()
|
||||
self.mock_show_mlag_vip.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
if self._mlag_enabled:
|
||||
config_file = 'mlnxos_mlag_vip_show.cfg'
|
||||
config_file = 'onyx_mlag_vip_show.cfg'
|
||||
self.show_mlag_vip.return_value = load_fixture(config_file)
|
||||
config_file = 'mlnxos_mlag_show.cfg'
|
||||
config_file = 'onyx_mlag_show.cfg'
|
||||
self.show_mlag.return_value = load_fixture(config_file)
|
||||
else:
|
||||
self.show_mlag_vip.return_value = None
|
|
@ -7,42 +7,42 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_ospf
|
||||
from ansible.modules.network.onyx import onyx_ospf
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosOspfModule(TestMlnxosModule):
|
||||
class TestOnyxOspfModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_ospf
|
||||
module = onyx_ospf
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosOspfModule, self).setUp()
|
||||
super(TestOnyxOspfModule, self).setUp()
|
||||
self._ospf_exists = True
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_ospf.MlnxosOspfModule,
|
||||
onyx_ospf.OnyxOspfModule,
|
||||
"_get_ospf_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_get_interfaces_config = patch.object(
|
||||
mlnxos_ospf.MlnxosOspfModule,
|
||||
onyx_ospf.OnyxOspfModule,
|
||||
"_get_ospf_interfaces_config")
|
||||
self.get_interfaces_config = self.mock_get_interfaces_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosOspfModule, self).tearDown()
|
||||
super(TestOnyxOspfModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
if self._ospf_exists:
|
||||
config_file = 'mlnxos_ospf_show.cfg'
|
||||
config_file = 'onyx_ospf_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
config_file = 'mlnxos_ospf_interfaces_show.cfg'
|
||||
config_file = 'onyx_ospf_interfaces_show.cfg'
|
||||
self.get_interfaces_config.return_value = load_fixture(config_file)
|
||||
else:
|
||||
self.get_config.return_value = None
|
|
@ -7,29 +7,29 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_pfc_interface
|
||||
from ansible.modules.network.onyx import onyx_pfc_interface
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosPfcInterfaceModule(TestMlnxosModule):
|
||||
class TestOnyxPfcInterfaceModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_pfc_interface
|
||||
module = onyx_pfc_interface
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosPfcInterfaceModule, self).setUp()
|
||||
super(TestOnyxPfcInterfaceModule, self).setUp()
|
||||
self._pfc_enabled = True
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_pfc_interface.MlnxosPfcInterfaceModule,
|
||||
onyx_pfc_interface.OnyxPfcInterfaceModule,
|
||||
"_get_pfc_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosPfcInterfaceModule, self).tearDown()
|
||||
super(TestOnyxPfcInterfaceModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
|
@ -38,7 +38,7 @@ class TestMlnxosPfcInterfaceModule(TestMlnxosModule):
|
|||
suffix = 'enabled'
|
||||
else:
|
||||
suffix = 'disabled'
|
||||
config_file = 'mlnxos_pfc_interface_%s.cfg' % suffix
|
||||
config_file = 'onyx_pfc_interface_%s.cfg' % suffix
|
||||
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
|
@ -7,38 +7,38 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_protocol
|
||||
from ansible.modules.network.onyx import onyx_protocol
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosProtocolModule(TestMlnxosModule):
|
||||
class TestOnyxProtocolModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_protocol
|
||||
module = onyx_protocol
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosProtocolModule, self).setUp()
|
||||
super(TestOnyxProtocolModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_protocol.MlnxosProtocolModule,
|
||||
onyx_protocol.OnyxProtocolModule,
|
||||
"_get_protocols")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_get_ip_config = patch.object(
|
||||
mlnxos_protocol.MlnxosProtocolModule,
|
||||
onyx_protocol.OnyxProtocolModule,
|
||||
"_get_ip_routing")
|
||||
self.get_ip_config = self.mock_get_ip_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosProtocolModule, self).tearDown()
|
||||
super(TestOnyxProtocolModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_protocols_show.cfg'
|
||||
config_file = 'onyx_protocols_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
self.get_ip_config.return_value = "IP routing: enabled"
|
|
@ -23,33 +23,32 @@ __metaclass__ = type
|
|||
import json
|
||||
|
||||
from ansible.compat.tests.mock import patch
|
||||
from ansible.modules.network.mlnxos import mlnxos_vlan
|
||||
from ansible.module_utils.network.mlnxos import mlnxos as mlnxos_utils
|
||||
from ansible.modules.network.onyx import onyx_vlan
|
||||
from units.modules.utils import set_module_args
|
||||
from .mlnxos_module import TestMlnxosModule, load_fixture
|
||||
from .onyx_module import TestOnyxModule, load_fixture
|
||||
|
||||
|
||||
class TestMlnxosVlanModule(TestMlnxosModule):
|
||||
class TestOnyxVlanModule(TestOnyxModule):
|
||||
|
||||
module = mlnxos_vlan
|
||||
module = onyx_vlan
|
||||
|
||||
def setUp(self):
|
||||
super(TestMlnxosVlanModule, self).setUp()
|
||||
super(TestOnyxVlanModule, self).setUp()
|
||||
self.mock_get_config = patch.object(
|
||||
mlnxos_vlan.MlnxosVlanModule, "_get_vlan_config")
|
||||
onyx_vlan.OnyxVlanModule, "_get_vlan_config")
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_load_config = patch(
|
||||
'ansible.module_utils.network.mlnxos.mlnxos.load_config')
|
||||
'ansible.module_utils.network.onyx.onyx.load_config')
|
||||
self.load_config = self.mock_load_config.start()
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMlnxosVlanModule, self).tearDown()
|
||||
super(TestOnyxVlanModule, self).tearDown()
|
||||
self.mock_get_config.stop()
|
||||
self.mock_load_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None, transport='cli'):
|
||||
config_file = 'mlnxos_vlan_show.cfg'
|
||||
config_file = 'onyx_vlan_show.cfg'
|
||||
self.get_config.return_value = load_fixture(config_file)
|
||||
self.load_config.return_value = None
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue