Assorted nxos_bgp_* fixes (#25080)

* Simplify apply_key_map

* Fix nxapi

* Clean up get_value

* Fix missing non-values

* Add test for existing bgp_af case

* Fix small issues with bgp_neighbor_af
This commit is contained in:
Nathaniel Case
2017-05-30 14:11:15 -04:00
committed by GitHub
parent a4131197e0
commit 53837c2ab0
5 changed files with 91 additions and 134 deletions

View File

@@ -5,4 +5,7 @@ router bgp 65535
event-history cli size medium
event-history detail
vrf test2
address-family ipv4 unicast
timers bgp 1 10
neighbor 3.3.3.5
address-family ipv4 unicast

View File

@@ -48,17 +48,21 @@ class TestNxosBgpAfModule(TestNxosModule):
def test_nxos_bgp_af(self):
set_module_args(dict(asn=65535, afi='ipv4', safi='unicast'))
self.execute_module(
changed=True,
changed=True, sort=False,
commands=['router bgp 65535', 'address-family ipv4 unicast']
)
def test_nxos_bgp_af_vrf(self):
set_module_args(dict(asn=65535, vrf='test', afi='ipv4', safi='unicast'))
self.execute_module(
changed=True,
changed=True, sort=False,
commands=['router bgp 65535', 'vrf test', 'address-family ipv4 unicast']
)
def test_nxos_bgp_af_vrf_exists(self):
set_module_args(dict(asn=65535, vrf='test2', afi='ipv4', safi='unicast'))
self.execute_module(changed=False, commands=[])
def test_nxos_bgp_af_dampening_routemap(self):
set_module_args(dict(asn=65535, afi='ipv4', safi='unicast',
dampening_routemap='route-map-a'))

View File

@@ -53,3 +53,14 @@ class TestNxosBgpNeighborAfModule(TestNxosModule):
'router bgp 65535', 'neighbor 3.3.3.3', 'address-family ipv4 unicast',
'route-reflector-client'
])
def test_nxos_bgp_neighbor_af_exists(self):
set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4', safi='unicast'))
self.execute_module(changed=False, commands=[])
def test_nxos_bgp_neighbor_af_absent(self):
set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4', safi='unicast', state='absent'))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'no address-family ipv4 unicast']
)