mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add more testcases for nxos_evpn_vni (#24996)
This commit is contained in:
parent
307fd1b3dc
commit
6a3ce18e4b
2 changed files with 19 additions and 5 deletions
|
@ -0,0 +1,8 @@
|
|||
nv overlay evpn
|
||||
feature nv overlay
|
||||
|
||||
evpn
|
||||
vni 6000 l2
|
||||
rd auto
|
||||
route-target import auto
|
||||
route-target export auto
|
|
@ -46,14 +46,20 @@ class TestNxosEvpnVniModule(TestNxosModule):
|
|||
self.mock_get_config.stop()
|
||||
|
||||
def load_fixtures(self, commands=None):
|
||||
self.get_config.return_value = load_fixture('nxos_evpn_vni_config.cfg')
|
||||
self.load_config.return_value = None
|
||||
|
||||
def test_nxos_evpn_vni_absent(self):
|
||||
set_module_args(dict(vni='6000', state='absent'))
|
||||
result = self.execute_module(changed=False)
|
||||
self.assertEqual(result['commands'], [])
|
||||
|
||||
def test_nxos_evpn_vni_present(self):
|
||||
set_module_args(dict(vni='6000', state='present'))
|
||||
result = self.execute_module(changed=True)
|
||||
self.assertEqual(result['commands'], ['evpn', 'vni 6000 l2'])
|
||||
|
||||
def test_nxos_evpn_vni_absent_not_existing(self):
|
||||
set_module_args(dict(vni='12000', state='absent'))
|
||||
result = self.execute_module(changed=False)
|
||||
self.assertEqual(result['commands'], [])
|
||||
|
||||
def test_nxos_evpn_vni_absent_existing(self):
|
||||
set_module_args(dict(vni='6000', state='absent'))
|
||||
result = self.execute_module(changed=True)
|
||||
self.assertEqual(result['commands'], ['evpn', 'no vni 6000 l2'])
|
||||
|
|
Loading…
Reference in a new issue