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

T4583: Rewrite VRRP op-mode to vyos.opmode format #4155

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

HollyGurza
Copy link
Contributor

@HollyGurza HollyGurza commented Oct 15, 2024

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

configure vrrp:

set high-availability vrrp group Foo address 192.0.2.1/24
set high-availability vrrp group Foo interface 'eth1'
set high-availability vrrp group Foo vrid '20'
set high-availability vrrp group Foo2 address 192.3.2.1/24
set high-availability vrrp group Foo2 interface 'eth1'
set high-availability vrrp group Foo2 vrid '30'
set high-availability vrrp group Foo3 address 192.4.2.1/24
set high-availability vrrp group Foo3 address 192.2.2.1/24
set high-availability vrrp group Foo3 address 192.3.2.1/24
set high-availability vrrp group Foo3 excluded-address 192.6.6.6
set high-availability vrrp group Foo3 interface 'eth0'
set high-availability vrrp group Foo3 vrid '40'

run op mode commands:

vyos@vyos# run show vrrp
Name    Interface      VRID  State      Priority  Last Transition
------  -----------  ------  -------  ----------  -----------------
Foo     eth1             20  MASTER          100  6s
Foo2    eth1             30  MASTER          100  6s
Foo3    eth0             40  MASTER          100  6s


vyos@vyos# run show vrrp detail 

 VRRP Instance: Foo
   VRRP Version: 2
   State: MASTER
   Wantstate: MASTER
   Last transition: 1728992115.291447
   Interface: eth1
   Gratuitous ARP delay: 5
   Gratuitous ARP repeat: 5
   Gratuitous ARP refresh: 0
   Gratuitous ARP refresh repeat: 1
   Gratuitous ARP lower priority delay: 5
   Gratuitous ARP lower priority repeat: 5
   Send advert after receive lower priority advert: true
   Send advert after receive higher priority advert: false
   Virtual Router ID: 20
   Priority: 100
   Effective priority: 100
   Advert interval: 1 sec
   Accept: Enabled
   Preempt: Enabled
   Promote secondaries: Disabled
   Authentication type: NONE
   
   Virtual IP (1):
       192.0.2.1/24 dev eth1 scope global set
       
   Using smtp notification: no
   Notify deleted: Fault

 VRRP Instance: Foo2
   VRRP Version: 2
   State: MASTER
   Wantstate: MASTER
   Last transition: 1728992115.292016
   Interface: eth1
   Gratuitous ARP delay: 5
   Gratuitous ARP repeat: 5
   Gratuitous ARP refresh: 0
   Gratuitous ARP refresh repeat: 1
   Gratuitous ARP lower priority delay: 5
   Gratuitous ARP lower priority repeat: 5
   Send advert after receive lower priority advert: true
   Send advert after receive higher priority advert: false
   Virtual Router ID: 30
   Priority: 100
   Effective priority: 100
   Advert interval: 1 sec
   Accept: Enabled
   Preempt: Enabled
   Promote secondaries: Disabled
   Authentication type: NONE
   
   Virtual IP (1):
       192.3.2.1/24 dev eth1 scope global set
       
   Using smtp notification: no
   Notify deleted: Fault

 VRRP Instance: Foo3
   VRRP Version: 2
   State: MASTER
   Wantstate: MASTER
   Last transition: 1728992115.291822
   Interface: eth0
   Gratuitous ARP delay: 5
   Gratuitous ARP repeat: 5
   Gratuitous ARP refresh: 0
   Gratuitous ARP refresh repeat: 1
   Gratuitous ARP lower priority delay: 5
   Gratuitous ARP lower priority repeat: 5
   Send advert after receive lower priority advert: true
   Send advert after receive higher priority advert: false
   Virtual Router ID: 40
   Priority: 100
   Effective priority: 100
   Advert interval: 1 sec
   Accept: Enabled
   Preempt: Enabled
   Promote secondaries: Disabled
   Authentication type: NONE
   
   Virtual IP (3):
       192.2.2.1/24 dev eth0 scope global set
       192.3.2.1/24 dev eth0 scope global set
       192.4.2.1/24 dev eth0 scope global set
       
   Virtual IP Excluded:
       192.6.6.6 dev eth0 scope global set
       
   Using smtp notification: no
   Notify deleted: Fault


vyos@vyos# run show vrrp statistics 

VRRP Instance: Foo
  Advertisements:
    Received: 0
    Sent: 28
  Became master: 1
  Released master: 0
  Packet Errors:
    Length: 0
    TTL: 0
    Invalid Type: 0
    Advertisement Interval: 0
    Address List: 0
  Authentication Errors:
    Invalid Type: 0
    Type Mismatch: 0
    Failure: 0
  Priority Zero:
    Received: 0
    Sent: 0

VRRP Instance: Foo2
  Advertisements:
    Received: 0
    Sent: 28
  Became master: 1
  Released master: 0
  Packet Errors:
    Length: 0
    TTL: 0
    Invalid Type: 0
    Advertisement Interval: 0
    Address List: 0
  Authentication Errors:
    Invalid Type: 0
    Type Mismatch: 0
    Failure: 0
  Priority Zero:
    Received: 0
    Sent: 0

VRRP Instance: Foo3
  Advertisements:
    Received: 0
    Sent: 28
  Became master: 1
  Released master: 0
  Packet Errors:
    Length: 0
    TTL: 0
    Invalid Type: 0
    Advertisement Interval: 0
    Address List: 0
  Authentication Errors:
    Invalid Type: 0
    Type Mismatch: 0
    Failure: 0
  Priority Zero:
    Received: 0
    Sent: 0

also available filter by group name:

vyos@vyos# run show vrrp Foo detail

 VRRP Instance: Foo
   VRRP Version: 2
   State: MASTER
   Wantstate: MASTER
   Last transition: 1728992115.291447
   Interface: eth1
   Gratuitous ARP delay: 5
   Gratuitous ARP repeat: 5
   Gratuitous ARP refresh: 0
   Gratuitous ARP refresh repeat: 1
   Gratuitous ARP lower priority delay: 5
   Gratuitous ARP lower priority repeat: 5
   Send advert after receive lower priority advert: true
   Send advert after receive higher priority advert: false
   Virtual Router ID: 20
   Priority: 100
   Effective priority: 100
   Advert interval: 1 sec
   Accept: Enabled
   Preempt: Enabled
   Promote secondaries: Disabled
   Authentication type: NONE
   
   Virtual IP (1):
       192.0.2.1/24 dev eth1 scope global set
       
   Using smtp notification: no
   Notify deleted: Fault

vyos@vyos# run show vrrp Foo statistics 

VRRP Instance: Foo
  Advertisements:
    Received: 0
    Sent: 435
  Became master: 1
  Released master: 0
  Packet Errors:
    Length: 0
    TTL: 0
    Invalid Type: 0
    Advertisement Interval: 0
    Address List: 0
  Authentication Errors:
    Invalid Type: 0
    Type Mismatch: 0
    Failure: 0
  Priority Zero:
    Received: 0
    Sent: 0

Smoketest result

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

Copy link

github-actions bot commented Oct 15, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Oct 15, 2024

✅ No issues found in unused-imports check.. Please refer the workflow run

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

Looks good to me, we just need to be a bit more careful with exceptions and unify all raised exceptions to subclasses of vyos.opmode.Error.

src/op_mode/vrrp.py Outdated Show resolved Hide resolved
src/op_mode/vrrp.py Outdated Show resolved Hide resolved
Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@c-po c-po merged commit ceb64f3 into vyos:current Oct 24, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants