2019-07-23 07:41:37 +02:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "Start nxos_lag_interfaces merged integration tests connection={{ ansible_connection }}"
|
|
|
|
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
|
|
- set_fact: test_int2="{{ nxos_int2 }}"
|
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Enable feature lacp
|
2019-07-23 07:41:37 +02:00
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Setup
|
2019-08-20 12:44:00 +02:00
|
|
|
nxos_config:
|
2019-07-23 07:41:37 +02:00
|
|
|
lines:
|
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
|
|
|
- no interface port-channel 10
|
2019-07-23 07:41:37 +02:00
|
|
|
ignore_errors: yes
|
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
|
|
|
|
|
|
|
- name: setup2
|
|
|
|
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: Merged
|
|
|
|
nxos_lag_interfaces: &merged
|
|
|
|
config:
|
|
|
|
- name: port-channel10
|
|
|
|
members:
|
|
|
|
- member: "{{ test_int1 }}"
|
|
|
|
- member: "{{ test_int2 }}"
|
|
|
|
state: merged
|
|
|
|
register: result
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.before|length == 0"
|
|
|
|
- "result.changed == true"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Gather LAG interfaces facts
|
|
|
|
nxos_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
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
|
2019-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Idempotence - Merged
|
|
|
|
nxos_lag_interfaces: *merged
|
|
|
|
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:
|
|
|
|
- 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-07-23 07:41:37 +02:00
|
|
|
|
2019-08-19 10:54:39 +02:00
|
|
|
- name: Disable feature lacp
|
|
|
|
nxos_feature:
|
|
|
|
feature: lacp
|
|
|
|
state: disabled
|