Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: T4515: T4219: policy local-route6 and inbound-interface support #1219

Merged
merged 5 commits into from
Feb 19, 2022

Conversation

hensur
Copy link
Contributor

@hensur hensur commented Feb 14, 2022

Change Summary

Backport of policy local-route6 and policy local-route(6) inbound-interface.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

Proposed changes

How to test

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Adds support for `ip -6 rule` policy based routing.
Also, extends the existing ipv4 implemenation with a
`destination` key, which is translated as
`ip rule add to x.x.x.x/x` rules.

https://phabricator.vyos.net/T4151
.sort() is an inplace operation and return None...
src/conf_mode/policy-local-route.py Outdated Show resolved Hide resolved
@c-po c-po merged commit 6066cef into vyos:equuleus Feb 19, 2022
@c-po
Copy link
Member

c-po commented Feb 22, 2022

reverting this in equuleus as multiple tests failed.

06:37:05  DEBUG - Running Testcase: /usr/libexec/vyos/tests/smoke/cli/test_policy.py
06:37:17  DEBUG - test_access_list (__main__.TestPolicy) ... ok
06:37:24  DEBUG - test_access_list6 (__main__.TestPolicy) ... ok
06:37:32  DEBUG - test_as_path_list (__main__.TestPolicy) ... ok
06:37:37  DEBUG - test_community_list (__main__.TestPolicy) ... ok
06:37:38  DEBUG - test_delete_ipv4_ipv6_table_id (__main__.TestPolicy) ... ERROR
06:37:42  DEBUG - test_destination_ipv6_table_id (__main__.TestPolicy) ... ok
06:37:46  DEBUG - test_destination_table_id (__main__.TestPolicy) ... ok
06:37:54  DEBUG - test_extended_community_list (__main__.TestPolicy) ... ok
06:37:56  DEBUG - test_fwmark_ipv6_table_id (__main__.TestPolicy) ... ok
06:38:00  DEBUG - test_fwmark_sources_destination_ipv6_table_id (__main__.TestPolicy) ... ok
06:38:01  DEBUG - test_fwmark_sources_destination_table_id (__main__.TestPolicy) ... ERROR
06:38:05  DEBUG - test_fwmark_sources_ipv6_table_id (__main__.TestPolicy) ... ok
06:38:05  DEBUG - test_fwmark_sources_table_id (__main__.TestPolicy) ... ERROR
06:38:05  DEBUG - test_fwmark_table_id (__main__.TestPolicy) ... ERROR
06:38:10  DEBUG - test_iif_sources_ipv6_table_id (__main__.TestPolicy) ... ok
06:38:13  DEBUG - test_iif_sources_table_id (__main__.TestPolicy) ... ok
06:38:16  DEBUG - test_ipv6_table_id (__main__.TestPolicy) ... ok
06:38:23  DEBUG - test_large_community_list (__main__.TestPolicy) ... ok
06:38:28  DEBUG - test_multiple_commit_ipv4_table_id (__main__.TestPolicy) ... ok
06:38:35  DEBUG - test_prefix_list (__main__.TestPolicy) ... ok
06:38:41  DEBUG - test_prefix_list6 (__main__.TestPolicy) ... ok
06:38:46  DEBUG - test_table_id (__main__.TestPolicy) ... ok
06:38:46  DEBUG - 
06:38:46  DEBUG - ======================================================================
06:38:46  DEBUG - ERROR: test_delete_ipv4_ipv6_table_id (__main__.TestPolicy)
06:38:46  DEBUG - ----------------------------------------------------------------------
06:38:46  DEBUG - Traceback (most recent call last):
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_policy.py", line 960, in test_delete_ipv4_ipv6_table_id
06:38:46  DEBUG -     self.cli_set(path + ['rule', rule, 'fwmark', fwmk])
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 66, in cli_set
06:38:46  DEBUG -     self._session.set(config)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 147, in set
06:38:46  DEBUG -     self.__run_command([SET] + path + value)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 136, in __run_command
06:38:46  DEBUG -     raise ConfigSessionError(output)
06:38:46  DEBUG - vyos.configsession.ConfigSessionError: Configuration path: [policy local-route rule 103 fwmark 23] is not valid
06:38:46  DEBUG - 
06:38:46  DEBUG - Set failed
06:38:46  DEBUG - 
06:38:46  DEBUG - 
06:38:46  DEBUG - ======================================================================
06:38:46  DEBUG - ERROR: test_fwmark_sources_destination_table_id (__main__.TestPolicy)
06:38:46  DEBUG - ----------------------------------------------------------------------
06:38:46  DEBUG - Traceback (most recent call last):
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_policy.py", line 792, in test_fwmark_sources_destination_table_id
06:38:46  DEBUG -     self.cli_set(path + ['rule', rule, 'fwmark', fwmk])
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 66, in cli_set
06:38:46  DEBUG -     self._session.set(config)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 147, in set
06:38:46  DEBUG -     self.__run_command([SET] + path + value)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 136, in __run_command
06:38:46  DEBUG -     raise ConfigSessionError(output)
06:38:46  DEBUG - vyos.configsession.ConfigSessionError: Configuration path: [policy local-route rule 103 fwmark 23] is not valid
06:38:46  DEBUG - 
06:38:46  DEBUG - Set failed
06:38:46  DEBUG - 
06:38:46  DEBUG - 
06:38:46  DEBUG - ======================================================================
06:38:46  DEBUG - ERROR: test_fwmark_sources_table_id (__main__.TestPolicy)
06:38:46  DEBUG - ----------------------------------------------------------------------
06:38:46  DEBUG - Traceback (most recent call last):
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_policy.py", line 740, in test_fwmark_sources_table_id
06:38:46  DEBUG -     self.cli_set(path + ['rule', rule, 'fwmark', fwmk])
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 66, in cli_set
06:38:46  DEBUG -     self._session.set(config)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 147, in set
06:38:46  DEBUG -     self.__run_command([SET] + path + value)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 136, in __run_command
06:38:46  DEBUG -     raise ConfigSessionError(output)
06:38:46  DEBUG - vyos.configsession.ConfigSessionError: Configuration path: [policy local-route rule 100 fwmark 23] is not valid
06:38:46  DEBUG - 
06:38:46  DEBUG - Set failed
06:38:46  DEBUG - 
06:38:46  DEBUG - 
06:38:46  DEBUG - ======================================================================
06:38:46  DEBUG - ERROR: test_fwmark_table_id (__main__.TestPolicy)
06:38:46  DEBUG - ----------------------------------------------------------------------
06:38:46  DEBUG - Traceback (most recent call last):
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_policy.py", line 698, in test_fwmark_table_id
06:38:46  DEBUG -     self.cli_set(path + ['rule', rule, 'fwmark', fwmk])
06:38:46  DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/base_vyostest_shim.py", line 66, in cli_set
06:38:46  DEBUG -     self._session.set(config)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 147, in set
06:38:46  DEBUG -     self.__run_command([SET] + path + value)
06:38:46  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 136, in __run_command
06:38:46  DEBUG -     raise ConfigSessionError(output)
06:38:46  DEBUG - vyos.configsession.ConfigSessionError: Configuration path: [policy local-route rule 101 fwmark 24] is not valid
06:38:46  DEBUG - 
06:38:46  DEBUG - Set failed
06:38:46  DEBUG - 

@hensur
Copy link
Contributor Author

hensur commented Feb 23, 2022

@c-po I'll look into it.
Although I'm a bit confused about the error message. It seems to fail during config validation already?
The XML seems fine to me... But I will test this in a vyos 1.3 VM again.

@hensur
Copy link
Contributor Author

hensur commented Feb 23, 2022

Okay, I think I found the issue. These changes are missing in 1.3:
#944
#973

I cherry-picked those as well. I didn't notice before because I thought fwmark was already supported in 1.3. I didn't think to check if there were any other previous changes that my PR relied on.

New PR:
#1235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants