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

T5725: Improve protocol IS-IS config validation #3643

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

HollyGurza
Copy link
Contributor

Change Summary

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)

Related PR(s)

Component(s) name

Proposed changes

How to test

set interfaces dummy dum0 address '203.0.113.254/32'
set interfaces dummy dum0 description 'dum0'
set interfaces ethernet eth1 address '192.0.2.5/24'
set interfaces ethernet eth1 description 'LAN'

set interfaces tunnel tun0 address '10.0.0.2/30'
set interfaces tunnel tun0 description 'tun-to-192.0.2.1'
set interfaces tunnel tun0 encapsulation 'gre'
set interfaces tunnel tun0 source-address '192.0.2.5'

set protocols isis interface eth1
set protocols isis interface tun0
set protocols isis lsp-mtu '1460'
set protocols isis net '49.0001.1920.0200.0011.00'
set protocols isis redistribute ipv4 connected level-2
commit
# here we get error
# Option remote for interface tun0 is required.

set interfaces tunnel tun0 remote '192.0.2.1'
commit
# commit is success

check frr config:

vyos@vyos# vtysh -c "show run isisd"
Building configuration...

Current configuration:
!
frr version 7.5.1-20240509-02-gc9dd2977e
frr defaults traditional
hostname vyos
log syslog
log facility local7
service integrated-vtysh-config
!
interface eth1
 ip router isis VyOS
 ipv6 router isis VyOS
!
interface tun0
 ip router isis VyOS
 ipv6 router isis VyOS
!
router isis VyOS
 net 49.0001.1920.0200.0011.00
 lsp-mtu 1460
 redistribute ipv4 connected level-2
!
line vty
!
end

Smoketest result

vyos@vyos:~$ python3 /usr/libexec/vyos/tests/smoke/cli/test_protocols_isis.py 
test_isis_01_redistribute (__main__.TestProtocolsISIS) ... ok
test_isis_02_zebra_route_map (__main__.TestProtocolsISIS) ... ok
test_isis_03_default_information (__main__.TestProtocolsISIS) ... ok
test_isis_04_password (__main__.TestProtocolsISIS) ... 
Can use either md5 or plaintext-password for area-password!


Can use either md5 or plaintext-password for domain-password!

ok
test_isis_06_spf_delay (__main__.TestProtocolsISIS) ... 
All types of delay must be specified: long-delay, time-to-learn, init-
delay, short-delay


All types of delay must be specified: long-delay, time-to-learn, short-
delay


All types of delay must be specified: time-to-learn, short-delay


All types of delay must be specified: time-to-learn

ok
test_isis_06_tunnel_interface (__main__.TestProtocolsISIS) ... 
Option remote for interface tun0 is required.

ok

----------------------------------------------------------------------
Ran 6 tests in 39.461s

OK

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

@github-actions github-actions bot added the equuleus VyOS 1.3 LTS label Jun 12, 2024
@c-po c-po requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team June 12, 2024 19:11
@c-po
Copy link
Member

c-po commented Jun 12, 2024

This check is not present on current it should/must be implemented there first end then backported to sagitta and equuleus branch

@@ -69,6 +69,15 @@ def get_config(config=None):
# Merge policy dict into "regular" config dict
isis = dict_merge(tmp, isis)

for interface in isis.get('interface'):
# when we use tunnel interface necessary additional config validate
if 'tun' in interface:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use: if interface.startswith('tun') instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -103,6 +112,10 @@ def verify(isis):
f'Recommended area lsp-mtu {recom_area_mtu} or less ' \
'(calculated on MTU size).')

if 'tun' in interface:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use: if interface.startswith('tun') instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -103,6 +112,10 @@ def verify(isis):
f'Recommended area lsp-mtu {recom_area_mtu} or less ' \
'(calculated on MTU size).')

if 'tun' in interface:
if not isis.get('tunnel_config').get(interface).get('remote'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please stick to the common pattern and use vyos.utils.dict_search()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@HollyGurza
Copy link
Contributor Author

This check is not present on current it should/must be implemented there first end then backported to sagitta and equuleus branch

this problem reproduces only in 1.3 version, current and sagitta works fine without this check.

Copy link
Member

@c-po c-po left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug only present with FRR 7.5.

Working with FRR 9.1+

@dmbaturin dmbaturin merged commit 64d6752 into vyos:equuleus Jun 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
equuleus VyOS 1.3 LTS
Development

Successfully merging this pull request may close these issues.

3 participants