nxos_bgp_neighbor_af does not want required_together (#26370)

* nxos_bgp_neighbor_af does not want required_together

* fixup tests

* Fix max_prefix_* issues

* Require address-family

* Fix idempotency for next_hop_third_party

* Fix idempotency for allowas_in*

* Fix idempotency for *_in and *_out

* Reorder command generation again

`default` is first, then `max-prefix`, then booleans
This commit is contained in:
Nathaniel Case 2017-08-09 15:54:34 -04:00 committed by GitHub
commit a78f3faa6c
3 changed files with 72 additions and 70 deletions

View file

@ -9,3 +9,4 @@ router bgp 65535
timers bgp 1 10
neighbor 3.3.3.5
address-family ipv4 unicast
maximum-prefix 30 30

View file

@ -42,7 +42,7 @@ class TestNxosBgpNeighborAfModule(TestNxosModule):
self.mock_get_config.stop()
def load_fixtures(self, commands=None, device=''):
self.get_config.return_value = load_fixture('', 'nxos_bgp_config.cfg')
self.get_config.return_value = load_fixture('nxos_bgp', 'config.cfg')
self.load_config.return_value = []
def test_nxos_bgp_neighbor_af(self):
@ -70,7 +70,7 @@ class TestNxosBgpNeighborAfModule(TestNxosModule):
advertise_map_exist=['my_advertise_map', 'my_exist_map']))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'advertise-map my_advertise_map exist my_exist_map']
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'address-family ipv4 unicast', 'advertise-map my_advertise_map exist my_exist_map']
)
def test_nxos_bgp_neighbor_af_advertise_map_non_exist(self):
@ -78,5 +78,22 @@ class TestNxosBgpNeighborAfModule(TestNxosModule):
advertise_map_non_exist=['my_advertise_map', 'my_exist_map']))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'advertise-map my_advertise_map non-exist my_exist_map']
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'address-family ipv4 unicast', 'advertise-map my_advertise_map non-exist my_exist_map']
)
def test_nxos_bgp_neighbor_af_max_prefix_limit_default(self):
set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4',
safi='unicast', max_prefix_limit='default'))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'address-family ipv4 unicast', 'no maximum-prefix']
)
def test_nxos_bgp_neighbor_af_max_prefix(self):
set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4',
safi='unicast', max_prefix_threshold=20,
max_prefix_limit=20))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'address-family ipv4 unicast', 'maximum-prefix 20 20']
)