summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-12-12 13:44:20 +0100
committerChristian Poessinger <christian@poessinger.com>2021-12-12 15:03:43 +0100
commit37410a6285223a871700698f11a12a6856b7b3c7 (patch)
treec42ce3a98d4e9667efe17040c899994920f55488 /smoketest/scripts/cli
parent2c96336702b1f08a2c6f997463a0aa48b0d8c0af (diff)
downloadvyos-1x-37410a6285223a871700698f11a12a6856b7b3c7.tar.gz
vyos-1x-37410a6285223a871700698f11a12a6856b7b3c7.zip
bgp: smoketest: add proper peer-group assignment tests
In the past a peer-group was only assigned to the BGP process but not bound to any neighbor. This has been changed. (cherry picked from commit ab27bb6edd44e5ab49c1bab28c9a6bc2cafb2e36)
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 073064939..afb74f2a5 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -46,6 +46,7 @@ neighbor_config = {
'no_cap_nego' : '',
'port' : '667',
'cap_strict' : '',
+ 'peer_group' : 'foo',
},
'192.0.2.3' : {
# XXX: not available in current Perl backend
@@ -54,6 +55,7 @@ neighbor_config = {
'passive' : '',
'multi_hop' : '5',
'update_src' : 'lo',
+ 'peer_group' : 'foo_bar_baz',
},
}
@@ -67,7 +69,8 @@ peer_group_config = {
# XXX: not available in current Perl backend
# 'ttl_security': '5',
},
- 'bar' : {
+# XXX: Perl backend supports no hyphens in peer-group names
+ 'foo_bar' : {
# XXX: not available in current Perl backend
# 'description' : 'foo peer bar group',
'remote_as' : '200',
@@ -75,7 +78,8 @@ peer_group_config = {
'no_cap_nego' : '',
'local_as' : '300',
},
- 'baz' : {
+# XXX: Perl backend supports no hyphens in peer-group names
+ 'foo_bar_baz' : {
'cap_dynamic' : '',
'cap_ext_next': '',
'remote_as' : '200',
@@ -85,6 +89,7 @@ peer_group_config = {
},
}
+
def getFRRBGPconfig():
return cmd(f'vtysh -c "show run" | sed -n "/router bgp {ASN}/,/^!/p"')
@@ -231,6 +236,10 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
if 'update_src' in config:
self.cli_set(base_path + ['peer-group', peer_group, 'update-source', config["update_src"]])
+ for peer, peer_config in neighbor_config.items():
+ if 'peer_group' in peer_config:
+ self.cli_set(base_path + ['neighbor', peer, 'peer-group', peer_config['peer_group']])
+
# commit changes
self.cli_commit()
@@ -242,6 +251,10 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' neighbor {peer_group} peer-group', frrconfig)
self.verify_frr_config(peer, peer_config, frrconfig)
+ for peer, peer_config in neighbor_config.items():
+ if 'peer_group' in peer_config:
+ self.assertIn(f' neighbor {peer} peer-group {peer_config["peer_group"]}', frrconfig)
+
def test_bgp_04_afi_ipv4(self):
networks = {
@@ -313,7 +326,7 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
'network', network])
if 'summary_only' in network_config:
self.cli_set(base_path + ['address-family', 'ipv6-unicast',
- 'aggregate-address', network, 'summary-only'])
+ 'aggregate-address', network, 'summary-only'])
# commit changes
self.cli_commit()