diff options
| author | l0crian1 <143656816+l0crian1@users.noreply.github.com> | 2025-09-14 04:52:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-14 10:52:09 +0200 |
| commit | eb3c88023c7768ac9cbb5a84f78a71edcb798137 (patch) | |
| tree | 98a329e32e29301c3137e642d927af93ce290109 /smoketest/scripts/cli | |
| parent | ad686a956cc8f6f14452798f3d77da2320956b54 (diff) | |
| download | vyos-1x-eb3c88023c7768ac9cbb5a84f78a71edcb798137.tar.gz vyos-1x-eb3c88023c7768ac9cbb5a84f78a71edcb798137.zip | |
route-map: T1124: Allow matching RPKI OVS extended community (#4699)
- Added 'rpki-extcommunity' match condition
- Added test to test_policy.py smoketest for rpki-extcommunity match
Diffstat (limited to 'smoketest/scripts/cli')
| -rwxr-xr-x | smoketest/scripts/cli/test_policy.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_policy.py b/smoketest/scripts/cli/test_policy.py index 8849ee182..58d00c3eb 100755 --- a/smoketest/scripts/cli/test_policy.py +++ b/smoketest/scripts/cli/test_policy.py @@ -938,6 +938,12 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase): 'tag': tag, }, }, + '7' : { + 'action' : 'deny', + 'match' : { + 'rpki-comm-invalid': '', + }, + }, '10' : { 'action' : 'permit', 'match' : { @@ -946,6 +952,12 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase): 'rpki-not-found': '', }, }, + '12' : { + 'action' : 'permit', + 'match' : { + 'rpki-comm-not-found': '', + }, + }, '15' : { 'action' : 'permit', 'match' : { @@ -956,6 +968,12 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase): 'next' : '', }, }, + '17' : { + 'action' : 'permit', + 'match' : { + 'rpki-comm-valid': '', + }, + }, '20' : { 'action' : 'permit', 'match' : { @@ -1268,6 +1286,12 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase): self.cli_set(path + ['rule', rule, 'match', 'rpki', 'notfound']) if 'rpki-valid' in rule_config['match']: self.cli_set(path + ['rule', rule, 'match', 'rpki', 'valid']) + if 'rpki-comm-invalid' in rule_config['match']: + self.cli_set(path + ['rule', rule, 'match', 'rpki-extcommunity', 'invalid']) + if 'rpki-comm-not-found' in rule_config['match']: + self.cli_set(path + ['rule', rule, 'match', 'rpki-extcommunity', 'notfound']) + if 'rpki-comm-valid' in rule_config['match']: + self.cli_set(path + ['rule', rule, 'match', 'rpki-extcommunity', 'valid']) if 'protocol' in rule_config['match']: self.cli_set(path + ['rule', rule, 'match', 'protocol', rule_config['match']['protocol']]) if 'source-vrf' in rule_config['match']: @@ -1450,6 +1474,15 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase): if 'rpki-valid' in rule_config['match']: tmp = f'match rpki valid' self.assertIn(tmp, config) + if 'rpki-comm-invalid' in rule_config['match']: + tmp = f'match rpki-extcommunity invalid' + self.assertIn(tmp, config) + if 'rpki-comm-not-found' in rule_config['match']: + tmp = f'match rpki-extcommunity notfound' + self.assertIn(tmp, config) + if 'rpki-comm-valid' in rule_config['match']: + tmp = f'match rpki-extcommunity valid' + self.assertIn(tmp, config) if 'source-vrf' in rule_config['match']: tmp = f'match source-vrf {rule_config["match"]["source-vrf"]}' self.assertIn(tmp, config) |
