Skip to content

Commit

Permalink
add more testcases for nxos_evpn_vni (#24996)
Browse files Browse the repository at this point in the history
  • Loading branch information
trishnaguha committed May 25, 2017
1 parent 307fd1b commit 6a3ce18
Show file tree
Hide file tree
Showing 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
16 changes: 11 additions & 5 deletions test/units/modules/network/nxos/test_nxos_evpn_vni.py
Expand Up @@ -46,14 +46,20 @@ def tearDown(self):
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'])

0 comments on commit 6a3ce18

Please sign in to comment.