2019-07-23 07:41:37 +02:00
|
|
|
---
|
|
|
|
- debug:
|
2019-08-19 10:54:39 +02:00
|
|
|
msg: "Start nxos_lag_interfaces deleted integration tests connection={{ ansible_connection }}"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
|
|
- set_fact: test_int2="{{ nxos_int2 }}"
|
|
|
|
|
|
|
|
- name: enable feature lacp
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Setup1
|
nxos_lag_interfaces: fix regression tests (#64119)
This is a change to the regression tests only. These tests were failing because of leftover device settings from previous tests:
- existing `channel-group` configurations on non-test interfaces were included in the before/after counts
- fixed by using the `nxos_lag_interfaces` module with `state: deleted` to remove `channel-group` configur
ations from all interfaces
- existing `L2` `port-channel` interfaces with the same ID as the test `channel-group` ID may prevent configuring `channel-group` on the test ethernet interface
- fixed by removing `port-channel` interfaces with the same ID; e.g.
```
interface port-channel98
switchport
switchport mode trunk
nx-1(config-if)# interface Ethernet1/19
nx-1(config-if)# channel-group 98
command failed: port not compatible [switching port]
```
Fixes passed on `N6K,N7K,N9K,N3K` (internal TBs: `dt-n9k5-1,n6k-77,n7k-99,n7k-j,n3k-173,evergreen-nx-1,greensboro-nx-1,hamilton-nx-1,camden-nx-1`)
2019-11-06 11:15:19 +01:00
|
|
|
nxos_lag_interfaces: &remove_lags
|
|
|
|
state: deleted
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- block:
|
|
|
|
- name: Setup2
|
|
|
|
nxos_config:
|
|
|
|
lines:
|
|
|
|
- "channel-group 10"
|
|
|
|
parents: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
- "interface {{ test_int1 }}"
|
|
|
|
- "interface {{ test_int2 }}"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Gather LAG interfaces facts
|
|
|
|
nxos_facts: &facts
|
|
|
|
gather_subset:
|
|
|
|
- '!all'
|
|
|
|
- '!min'
|
|
|
|
gather_network_resources: lag_interfaces
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: deleted
|
|
|
|
nxos_lag_interfaces: &deleted
|
|
|
|
state: deleted
|
|
|
|
register: result
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Gather LAG interfaces post facts
|
|
|
|
nxos_facts: *facts
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.after|length == 0"
|
|
|
|
- "result.changed == true"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Idempotence - deleted
|
|
|
|
nxos_lag_interfaces: *deleted
|
|
|
|
register: result
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
always:
|
2019-08-20 12:44:00 +02:00
|
|
|
- name: Teardown
|
nxos_lag_interfaces: fix regression tests (#64119)
This is a change to the regression tests only. These tests were failing because of leftover device settings from previous tests:
- existing `channel-group` configurations on non-test interfaces were included in the before/after counts
- fixed by using the `nxos_lag_interfaces` module with `state: deleted` to remove `channel-group` configur
ations from all interfaces
- existing `L2` `port-channel` interfaces with the same ID as the test `channel-group` ID may prevent configuring `channel-group` on the test ethernet interface
- fixed by removing `port-channel` interfaces with the same ID; e.g.
```
interface port-channel98
switchport
switchport mode trunk
nx-1(config-if)# interface Ethernet1/19
nx-1(config-if)# channel-group 98
command failed: port not compatible [switching port]
```
Fixes passed on `N6K,N7K,N9K,N3K` (internal TBs: `dt-n9k5-1,n6k-77,n7k-99,n7k-j,n3k-173,evergreen-nx-1,greensboro-nx-1,hamilton-nx-1,camden-nx-1`)
2019-11-06 11:15:19 +01:00
|
|
|
nxos_lag_interfaces: *remove_lags
|
2019-08-20 12:44:00 +02:00
|
|
|
ignore_errors: yes
|
2019-08-19 10:54:39 +02:00
|
|
|
|
|
|
|
- name: disable feature lacp
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
state: disabled
|