b08bdc5f6d
* Fix nxos_system tests (#36201) * Fix nxos_system tests * Add debug connection plugin info * Move sanity test under common (cherry picked from commit5b5d24631a
) * Fixes for the N3500 platform that uses the A8 image (#36261) * fix nxos_l3_interface tests as n35 doesn't support ipv6 * add terminal dont-ask to nxos_feature and nxos_lldp * put interfaces in L2 mode for N35 * fix nxos_feature unit-tests (cherry picked from commite24c547a3a
)
205 lines
4.8 KiB
YAML
205 lines
4.8 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_linkagg sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- set_fact: testint1="{{ nxos_int1 }}"
|
|
- set_fact: testint2="{{ nxos_int2 }}"
|
|
|
|
- name: "Enable feature LACP"
|
|
nxos_feature:
|
|
feature: lacp
|
|
state: enabled
|
|
provider: "{{ connection }}"
|
|
ignore_errors: yes
|
|
|
|
- name: setup - remove config used in test(part1)
|
|
nxos_config:
|
|
lines:
|
|
- no interface port-channel 20
|
|
- no interface port-channel 100
|
|
provider: "{{ connection }}"
|
|
|
|
- name: setup - remove config used in test(part2)
|
|
nxos_config:
|
|
lines:
|
|
- no channel-group 20
|
|
provider: "{{ connection }}"
|
|
parents: "{{ item }}"
|
|
ignore_errors: yes
|
|
loop:
|
|
- "interface {{ testint1 }}"
|
|
- "interface {{ testint2 }}"
|
|
|
|
- name: Put interface in L2 mode
|
|
nxos_interface:
|
|
aggregate:
|
|
- { name: "{{testint1}}" }
|
|
- { name: "{{testint2}}" }
|
|
mode: layer2
|
|
when: platform is match("N35")
|
|
|
|
- name: create linkagg
|
|
nxos_linkagg: &create
|
|
group: 20
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"interface port-channel 20" in result.commands'
|
|
|
|
- name: create linkagg(Idempotence)
|
|
nxos_linkagg: *create
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: set link aggregation group to members declaratively
|
|
nxos_linkagg: &configure_member
|
|
group: 20
|
|
mode: active
|
|
force: True
|
|
members:
|
|
- "{{ testint1 }}"
|
|
- "{{ testint2 }}"
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"interface {{ testint1 }}" in result.commands'
|
|
- '"channel-group 20 force mode active" in result.commands'
|
|
- '"interface {{ testint2 }}" in result.commands'
|
|
- '"channel-group 20 force mode active" in result.commands'
|
|
|
|
- name: set link aggregation group to members(Idempotence)
|
|
nxos_linkagg: *configure_member
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: remove link aggregation group from member declaratively
|
|
nxos_linkagg: &remove_member
|
|
group: 20
|
|
mode: active
|
|
force: True
|
|
members:
|
|
- "{{ testint2 }}"
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"interface {{ testint1 }}" in result.commands'
|
|
- '"no channel-group 20" in result.commands'
|
|
|
|
- name: remove link aggregation group from member(Idempotence)
|
|
nxos_linkagg: *remove_member
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: remove linkagg
|
|
nxos_linkagg: &remove
|
|
group: 20
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"no interface port-channel 20" in result.commands'
|
|
|
|
- name: remove linkagg(Idempotence)
|
|
nxos_linkagg: *remove
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: create aggregate of linkagg definitions
|
|
nxos_linkagg: &create_agg
|
|
aggregate:
|
|
- { group: 20, min_links: 3 }
|
|
- { group: 100, min_links: 4 }
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"interface port-channel 20" in result.commands'
|
|
- '"lacp min-links 3" in result.commands'
|
|
- '"interface port-channel 100" in result.commands'
|
|
- '"lacp min-links 4" in result.commands'
|
|
|
|
- name: create aggregate of linkagg definitions(Idempotence)
|
|
nxos_linkagg: *create_agg
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: remove aggregate of linkagg definitions
|
|
nxos_linkagg: &remove_agg
|
|
aggregate:
|
|
- { group: 20, min_links: 3 }
|
|
- { group: 100, min_links: 4 }
|
|
provider: "{{ connection }}"
|
|
state: absent
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"no interface port-channel 20" in result.commands'
|
|
- '"no interface port-channel 100" in result.commands'
|
|
|
|
- name: remove aggregate of linkagg definitions(Idempotence)
|
|
nxos_linkagg: *remove_agg
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: teardown - remove config used in test(part1)
|
|
nxos_config:
|
|
lines:
|
|
- no interface port-channel 20
|
|
- no interface port-channel 100
|
|
provider: "{{ connection }}"
|
|
|
|
- name: teardown - remove config used in test(part2)
|
|
nxos_config:
|
|
lines:
|
|
- no channel-group 20
|
|
provider: "{{ connection }}"
|
|
parents: "{{ item }}"
|
|
ignore_errors: yes
|
|
loop:
|
|
- "interface {{ testint1 }}"
|
|
- "interface {{ testint2 }}"
|
|
|
|
- name: "Disable feature LACP"
|
|
nxos_feature:
|
|
feature: lacp
|
|
state: disabled
|
|
timeout: 60
|
|
provider: "{{ connection }}"
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_linkagg sanity test"
|