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:
Trishna Guha
2018-03-01 10:56:16 +05:30
committed by GitHub
parent e2615308f9
commit 2fbfce06e7
5 changed files with 298 additions and 33 deletions

View File

@@ -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'], [])