mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Enable vyos_linkagg integration tests and test with 3 NICs (#26519)
This commit is contained in:
parent
ba60ac04fc
commit
9a9b1db62b
2 changed files with 19 additions and 22 deletions
|
@ -4,12 +4,16 @@
|
||||||
name: bond0
|
name: bond0
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Remove linkagg
|
||||||
|
vyos_linkagg:
|
||||||
|
name: bond1
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Create linkagg
|
- name: Create linkagg
|
||||||
vyos_linkagg:
|
vyos_linkagg:
|
||||||
name: bond0
|
name: bond0
|
||||||
members:
|
members:
|
||||||
- eth1
|
- eth1
|
||||||
- eth2
|
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -18,14 +22,12 @@
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- '"set interfaces bonding bond0 mode 802.3ad" in result.commands'
|
- '"set interfaces bonding bond0 mode 802.3ad" in result.commands'
|
||||||
- '"set interfaces ethernet eth1 bond-group bond0" in result.commands'
|
- '"set interfaces ethernet eth1 bond-group bond0" in result.commands'
|
||||||
- '"set interfaces ethernet eth2 bond-group bond0" in result.commands'
|
|
||||||
|
|
||||||
- name: Create linkagg again (idempotent)
|
- name: Create linkagg again (idempotent)
|
||||||
vyos_linkagg:
|
vyos_linkagg:
|
||||||
name: bond0
|
name: bond0
|
||||||
members:
|
members:
|
||||||
- eth1
|
- eth1
|
||||||
- eth2
|
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -37,20 +39,20 @@
|
||||||
vyos_linkagg:
|
vyos_linkagg:
|
||||||
name: bond0
|
name: bond0
|
||||||
members:
|
members:
|
||||||
- eth3
|
- eth2
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- '"set interfaces ethernet eth3 bond-group bond0" in result.commands'
|
- '"set interfaces ethernet eth2 bond-group bond0" in result.commands'
|
||||||
|
|
||||||
- name: Add linkagg member again (idempotent)
|
- name: Add linkagg member again (idempotent)
|
||||||
vyos_linkagg:
|
vyos_linkagg:
|
||||||
name: bond0
|
name: bond0
|
||||||
members:
|
members:
|
||||||
- eth3
|
- eth2
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -111,7 +113,6 @@
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- '"delete interfaces ethernet eth1 bond-group" in result.commands'
|
- '"delete interfaces ethernet eth1 bond-group" in result.commands'
|
||||||
- '"delete interfaces ethernet eth2 bond-group" in result.commands'
|
- '"delete interfaces ethernet eth2 bond-group" in result.commands'
|
||||||
- '"delete interfaces ethernet eth3 bond-group" in result.commands'
|
|
||||||
- '"delete interfaces bonding bond0" in result.commands'
|
- '"delete interfaces bonding bond0" in result.commands'
|
||||||
|
|
||||||
- name: Remove linkagg again (idempotent)
|
- name: Remove linkagg again (idempotent)
|
||||||
|
@ -127,8 +128,8 @@
|
||||||
- name: Create collection of linkagg definitions
|
- name: Create collection of linkagg definitions
|
||||||
vyos_linkagg:
|
vyos_linkagg:
|
||||||
collection:
|
collection:
|
||||||
- { name: bond0, members: [eth1, eth2] }
|
- { name: bond0, members: [eth1] }
|
||||||
- { name: bond1, members: [eth3, eth4] }
|
- { name: bond1, members: [eth2] }
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -137,16 +138,14 @@
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- '"set interfaces bonding bond0 mode 802.3ad" in result.commands'
|
- '"set interfaces bonding bond0 mode 802.3ad" in result.commands'
|
||||||
- '"set interfaces ethernet eth1 bond-group bond0" in result.commands'
|
- '"set interfaces ethernet eth1 bond-group bond0" in result.commands'
|
||||||
- '"set interfaces ethernet eth2 bond-group bond0" in result.commands'
|
|
||||||
- '"set interfaces bonding bond1 mode 802.3ad" in result.commands'
|
- '"set interfaces bonding bond1 mode 802.3ad" in result.commands'
|
||||||
- '"set interfaces ethernet eth3 bond-group bond1" in result.commands'
|
- '"set interfaces ethernet eth2 bond-group bond1" in result.commands'
|
||||||
- '"set interfaces ethernet eth4 bond-group bond1" in result.commands'
|
|
||||||
|
|
||||||
- name: Create collection of linkagg definitions again (idempotent)
|
- name: Create collection of linkagg definitions again (idempotent)
|
||||||
vyos_linkagg:
|
vyos_linkagg:
|
||||||
collection:
|
collection:
|
||||||
- { name: bond0, members: [eth1, eth2] }
|
- { name: bond0, members: [eth1] }
|
||||||
- { name: bond1, members: [eth3, eth4] }
|
- { name: bond1, members: [eth2] }
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -166,9 +165,7 @@
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- '"delete interfaces ethernet eth1 bond-group" in result.commands'
|
- '"delete interfaces ethernet eth1 bond-group" in result.commands'
|
||||||
- '"delete interfaces ethernet eth2 bond-group" in result.commands'
|
|
||||||
- '"delete interfaces bonding bond0" in result.commands'
|
- '"delete interfaces bonding bond0" in result.commands'
|
||||||
- '"delete interfaces ethernet eth1 bond-group" in result.commands'
|
|
||||||
- '"delete interfaces ethernet eth2 bond-group" in result.commands'
|
- '"delete interfaces ethernet eth2 bond-group" in result.commands'
|
||||||
- '"delete interfaces bonding bond1" in result.commands'
|
- '"delete interfaces bonding bond1" in result.commands'
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,12 @@
|
||||||
rescue:
|
rescue:
|
||||||
- set_fact: test_failed=true
|
- set_fact: test_failed=true
|
||||||
|
|
||||||
# - block:
|
- block:
|
||||||
# - include_role:
|
- include_role:
|
||||||
# name: vyos_linkagg
|
name: vyos_linkagg
|
||||||
# when: "limit_to in ['*', 'vyos_linkagg']"
|
when: "limit_to in ['*', 'vyos_linkagg']"
|
||||||
# rescue:
|
rescue:
|
||||||
# - set_fact: test_failed=true
|
- set_fact: test_failed=true
|
||||||
|
|
||||||
|
|
||||||
###########
|
###########
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue