diff options
author | Christian Breunig <christian@breunig.cc> | 2023-09-28 17:24:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-28 17:24:26 +0200 |
commit | 5fc286ae5262477ffd35c91044adfad0d6d59bd4 (patch) | |
tree | 653ad1f3bd4e2aa2e6b75b56c161752b8aa42b55 /smoketest/scripts/cli/test_policy.py | |
parent | ef94ff7f9959b9f3dcef398f8d85355d143ac73b (diff) | |
parent | 8953f97829b1ae583d5b9b2bd47edc8095a8f144 (diff) | |
download | vyos-1x-5fc286ae5262477ffd35c91044adfad0d6d59bd4.tar.gz vyos-1x-5fc286ae5262477ffd35c91044adfad0d6d59bd4.zip |
Merge pull request #2319 from vyos/mergify/bp/sagitta/pr-2313
T5165: Add option protocol for policy local-route (backport #2313)
Diffstat (limited to 'smoketest/scripts/cli/test_policy.py')
-rwxr-xr-x | smoketest/scripts/cli/test_policy.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_policy.py b/smoketest/scripts/cli/test_policy.py index 354f791bd..e868895ce 100755 --- a/smoketest/scripts/cli/test_policy.py +++ b/smoketest/scripts/cli/test_policy.py @@ -1519,6 +1519,28 @@ class TestPolicy(VyOSUnitTestSHIM.TestCase): self.assertEqual(sort_ip(tmp), sort_ip(original)) + # Test set table for destination and protocol + def test_protocol_destination_table_id(self): + path = base_path + ['local-route'] + + dst = '203.0.113.12' + rule = '85' + table = '104' + proto = 'tcp' + + self.cli_set(path + ['rule', rule, 'set', 'table', table]) + self.cli_set(path + ['rule', rule, 'destination', dst]) + self.cli_set(path + ['rule', rule, 'protocol', proto]) + + self.cli_commit() + + original = """ + 85: from all to 203.0.113.12 ipproto tcp lookup 104 + """ + tmp = cmd('ip rule show prio 85') + + self.assertEqual(sort_ip(tmp), sort_ip(original)) + # Test set table for sources with fwmark def test_fwmark_sources_table_id(self): path = base_path + ['local-route'] |