summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-17 19:21:57 +0200
committerChristian Poessinger <christian@poessinger.com>2021-06-17 19:21:57 +0200
commit635eed0452f15b18b8125e831b48582fa093c125 (patch)
treeac78747c07fd1cc71cbcea38125263fba458afe0 /smoketest
parent6cfcf7a761adb3e51f9279611435a39a1424e9c9 (diff)
parent13f0bf83f67a90e8164dec84ed0aced2440688fb (diff)
downloadvyos-1x-635eed0452f15b18b8125e831b48582fa093c125.tar.gz
vyos-1x-635eed0452f15b18b8125e831b48582fa093c125.zip
Merge branch 'route-map-extcommunity' into current
* route-map-extcommunity: policy: T3631: migrate "set extcommunity-rt|soo" to "set extcommunity rt|soo" route-map: T3632: fix invalid validation regex for extcommunity-rt|soo bgp: T3624: add "bandwidth" bestpath option policy: T3624: remove duplicate CLI node for "bgp-extcommunity-rt" policy: T3624: add extended community bandwith support to route-map policy: T3631: migrate "set extcommunity-rt/soo" to "set extcommunity rt|soo"
Diffstat (limited to 'smoketest')
-rw-r--r--smoketest/configs/bgp-rpki7
-rwxr-xr-xsmoketest/scripts/cli/test_policy.py27
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py7
3 files changed, 41 insertions, 0 deletions
diff --git a/smoketest/configs/bgp-rpki b/smoketest/configs/bgp-rpki
index e11ec9e72..dffab4c69 100644
--- a/smoketest/configs/bgp-rpki
+++ b/smoketest/configs/bgp-rpki
@@ -34,6 +34,13 @@ policy {
local-preference 100
}
}
+ rule 40 {
+ action permit
+ set {
+ extcommunity-rt 192.0.2.100:100
+ extcommunity-soo 64500:100
+ }
+ }
}
}
protocols {
diff --git a/smoketest/scripts/cli/test_policy.py b/smoketest/scripts/cli/test_policy.py
index 59425b789..2d7b78048 100755
--- a/smoketest/scripts/cli/test_policy.py
+++ b/smoketest/scripts/cli/test_policy.py
@@ -773,6 +773,9 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase):
'as-path-prepend' : '1234567890 987654321',
'atomic-aggregate' : '',
'distance' : '110',
+ 'extcommunity-bw' : '20000',
+ 'extcommunity-rt' : '123:456',
+ 'extcommunity-soo' : '456:789',
'ipv6-next-hop-global': '2001::1',
'ipv6-next-hop-local' : 'fe80::1',
'ip-next-hop' : '192.168.1.1',
@@ -789,6 +792,18 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase):
},
},
},
+ 'bandwidth-configuration' : {
+ 'rule' : {
+ '10' : {
+ 'action' : 'deny',
+ 'set' : {
+ 'as-path-prepend' : '100 100',
+ 'distance' : '200',
+ 'extcommunity-bw' : 'num-multipaths',
+ },
+ },
+ },
+ },
}
self.cli_set(['policy', 'access-list', access_list, 'rule', '10', 'action', 'permit'])
@@ -896,6 +911,12 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase):
self.cli_set(path + ['rule', rule, 'set', 'atomic-aggregate'])
if 'distance' in rule_config['set']:
self.cli_set(path + ['rule', rule, 'set', 'distance', rule_config['set']['distance']])
+ if 'extcommunity-bw' in rule_config['set']:
+ self.cli_set(path + ['rule', rule, 'set', 'extcommunity', 'bandwidth', rule_config['set']['extcommunity-bw']])
+ if 'extcommunity-rt' in rule_config['set']:
+ self.cli_set(path + ['rule', rule, 'set', 'extcommunity', 'rt', rule_config['set']['extcommunity-rt']])
+ if 'extcommunity-soo' in rule_config['set']:
+ self.cli_set(path + ['rule', rule, 'set', 'extcommunity', 'soo', rule_config['set']['extcommunity-soo']])
if 'ipv6-next-hop-global' in rule_config['set']:
self.cli_set(path + ['rule', rule, 'set', 'ipv6-next-hop', 'global', rule_config['set']['ipv6-next-hop-global']])
if 'ipv6-next-hop-local' in rule_config['set']:
@@ -1035,6 +1056,12 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase):
tmp += 'atomic-aggregate'
elif 'distance' in rule_config['set']:
tmp += 'distance ' + rule_config['set']['distance']
+ elif 'extcommunity-bw' in rule_config['set']:
+ tmp += 'extcommunity bandwidth' + rule_config['set']['extcommunity-bw']
+ elif 'extcommunity-rt' in rule_config['set']:
+ tmp += 'extcommunity rt' + rule_config['set']['extcommunity-rt']
+ elif 'extcommunity-soo' in rule_config['set']:
+ tmp += 'extcommunity rt' + rule_config['set']['extcommunity-soo']
elif 'ip-next-hop' in rule_config['set']:
tmp += 'ip next-hop ' + rule_config['set']['ip-next-hop']
elif 'ipv6-next-hop-global' in rule_config['set']:
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 10adc06e1..c51d83875 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -224,6 +224,10 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.cli_set(base_path + ['parameters', 'graceful-shutdown'])
self.cli_set(base_path + ['parameters', 'ebgp-requires-policy'])
+ self.cli_set(base_path + ['parameters', 'bestpath', 'as-path', 'multipath-relax'])
+ self.cli_set(base_path + ['parameters', 'bestpath', 'bandwidth', 'default-weight-for-missing'])
+ self.cli_set(base_path + ['parameters', 'bestpath', 'compare-routerid'])
+
# AFI maximum path support
self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths', 'ebgp', max_path_v4])
self.cli_set(base_path + ['address-family', 'ipv4-unicast', 'maximum-paths', 'ibgp', max_path_v4ibgp])
@@ -242,6 +246,9 @@ class TestProtocolsBGP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f' no bgp default ipv4-unicast', frrconfig)
self.assertIn(f' bgp graceful-restart stalepath-time {stalepath_time}', frrconfig)
self.assertIn(f' bgp graceful-shutdown', frrconfig)
+ self.assertIn(f' bgp bestpath as-path multipath-relax', frrconfig)
+ self.assertIn(f' bgp bestpath bandwidth default-weight-for-missing', frrconfig)
+ self.assertIn(f' bgp bestpath compare-routerid', frrconfig)
self.assertNotIn(f'bgp ebgp-requires-policy', frrconfig)
afiv4_config = self.getFRRconfig(' address-family ipv4 unicast')