mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Fix nxos_interface multiple issues (#36827)
* fix interface_type Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix setting mtu, doc for state check param, doc for params applicable for ethernet intf Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * speed idempotence and add unittest Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fabric_forwarding_anycast_gateway applicable for svi type intf only Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix speed Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -73,3 +73,19 @@ class TestNxosInterfaceModule(TestNxosModule):
|
||||
set_module_args(dict(interface='loopback0', state='absent'))
|
||||
result = self.execute_module(changed=False)
|
||||
self.assertEqual(result['commands'], [])
|
||||
|
||||
def test_nxos_interface_type(self):
|
||||
set_module_args(dict(interface_type='loopback', state='absent'))
|
||||
result = self.execute_module(changed=True)
|
||||
self.assertEqual(result['commands'], ['no interface loopback0'])
|
||||
|
||||
def test_nxos_interface_mtu(self):
|
||||
set_module_args(dict(interface='Ethernet2/1', mode='layer2', mtu='1800'))
|
||||
result = self.execute_module(changed=True)
|
||||
self.assertEqual(result['commands'], ['interface Ethernet2/1', 'switchport', 'mtu 1800',
|
||||
'interface Ethernet2/1', 'no shutdown'])
|
||||
|
||||
def test_nxos_interface_speed_idempotence(self):
|
||||
set_module_args(dict(interface='Ethernet2/1', speed='1000'))
|
||||
result = self.execute_module(changed=False)
|
||||
self.assertEqual(result['commands'], [])
|
||||
|
||||
Reference in New Issue
Block a user