fix nxos CI failures (#60752)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2019-08-19 14:24:39 +05:30 committed by GitHub
parent 7a9e865a23
commit f1cf838797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 222 additions and 203 deletions

View file

@ -1 +1,2 @@
dependencies: [] dependencies:
- prepare_nxos_tests

View file

@ -1,6 +1,6 @@
--- ---
- debug: - debug:
msg: "Start nxos_lag_interfaces merged integration tests connection={{ ansible_connection }}" msg: "Start nxos_lag_interfaces deleted integration tests connection={{ ansible_connection }}"
- set_fact: test_int1="{{ nxos_int1 }}" - set_fact: test_int1="{{ nxos_int1 }}"
- set_fact: test_int2="{{ nxos_int2 }}" - set_fact: test_int2="{{ nxos_int2 }}"
@ -9,49 +9,8 @@
nxos_feature: nxos_feature:
feature: lacp feature: lacp
- name: setup - name: Setup1
nxos_config: nxos_config: &cleanup
lines:
- "channel-group 10"
parents: "{{ item }}"
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Gather LAG interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- name: deleted
nxos_lag_interfaces: &deleted
state: deleted
register: result
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
- name: Gather LAG interfaces post facts
nxos_facts: *facts
- assert:
that:
- "result.after|length == 0"
- "result.changed == true"
- name: Idempotence - deleted
nxos_lag_interfaces: *deleted
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
nxos_config:
lines: lines:
- "no channel-group 10" - "no channel-group 10"
parents: "{{ item }}" parents: "{{ item }}"
@ -60,7 +19,53 @@
- "interface {{ test_int1 }}" - "interface {{ test_int1 }}"
- "interface {{ test_int2 }}" - "interface {{ test_int2 }}"
- name: disable feature lacp - block:
nxos_feature: - name: Setup2
feature: lacp nxos_config:
state: disabled lines:
- "channel-group 10"
parents: "{{ item }}"
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Gather LAG interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- name: deleted
nxos_lag_interfaces: &deleted
state: deleted
register: result
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
- name: Gather LAG interfaces post facts
nxos_facts: *facts
- assert:
that:
- "result.after|length == 0"
- "result.changed == true"
- name: Idempotence - deleted
nxos_lag_interfaces: *deleted
register: result
- assert:
that:
- "result.changed == false"
always:
- name: teardown
nxos_config: *cleanup
- name: disable feature lacp
nxos_feature:
feature: lacp
state: disabled

View file

@ -5,12 +5,12 @@
- set_fact: test_int1="{{ nxos_int1 }}" - set_fact: test_int1="{{ nxos_int1 }}"
- set_fact: test_int2="{{ nxos_int2 }}" - set_fact: test_int2="{{ nxos_int2 }}"
- name: enable feature lacp - name: Enable feature lacp
nxos_feature: nxos_feature:
feature: lacp feature: lacp
- name: setup - name: Setup
nxos_config: nxos_config: &cleanup
lines: lines:
- "no channel-group" - "no channel-group"
parents: "{{ item }}" parents: "{{ item }}"
@ -19,51 +19,46 @@
- "interface {{ test_int1 }}" - "interface {{ test_int1 }}"
- "interface {{ test_int2 }}" - "interface {{ test_int2 }}"
- name: Merged - block:
nxos_lag_interfaces: &merged - name: Merged
config: nxos_lag_interfaces: &merged
- name: port-channel10 config:
members: - name: port-channel10
- member: "{{ test_int1 }}" members:
- member: "{{ test_int2 }}" - member: "{{ test_int1 }}"
state: merged - member: "{{ test_int2 }}"
register: result state: merged
register: result
- assert: - assert:
that: that:
- "result.before|length == 0" - "result.before|length == 0"
- "result.changed == true" - "result.changed == true"
- name: Gather LAG interfaces facts - name: Gather LAG interfaces facts
nxos_facts: nxos_facts:
gather_subset: gather_subset:
- '!all' - '!all'
- '!min' - '!min'
gather_network_resources: lag_interfaces gather_network_resources: lag_interfaces
- assert: - assert:
that: that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0" - "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Merged - name: Idempotence - Merged
nxos_lag_interfaces: *merged nxos_lag_interfaces: *merged
register: result register: result
- assert: - assert:
that: that:
- "result.changed == false" - "result.changed == false"
- name: teardown always:
nxos_config: - name: Teardown
lines: nxos_config: *cleanup
- "no channel-group"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: disable feature lacp - name: Disable feature lacp
nxos_feature: nxos_feature:
feature: lacp feature: lacp
state: disabled state: disabled

View file

@ -1,6 +1,6 @@
--- ---
- debug: - debug:
msg: "Start nxos_lag_interfaces merged integration tests connection={{ ansible_connection }}" msg: "Start nxos_lag_interfaces overridden integration tests connection={{ ansible_connection }}"
- set_fact: test_int1="{{ nxos_int1 }}" - set_fact: test_int1="{{ nxos_int1 }}"
- set_fact: test_int2="{{ nxos_int2 }}" - set_fact: test_int2="{{ nxos_int2 }}"
@ -10,54 +10,8 @@
nxos_feature: nxos_feature:
feature: lacp feature: lacp
- name: setup - name: setup1
nxos_config: nxos_config: &cleanup1
lines:
- "channel-group 10"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Gather LAG interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- name: Overridden
nxos_lag_interfaces: &overridden
config:
- name: port-channel19
members:
- member: "{{ test_int3 }}"
state: overridden
register: result
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
- "result.changed == true"
- name: Gather LAG interfaces post facts
nxos_facts: *facts
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Overridden
nxos_lag_interfaces: *overridden
register: result
- assert:
that:
- "result.changed == false"
- name: teardown1
nxos_config:
lines: lines:
- "no channel-group 10" - "no channel-group 10"
parents: "{{ item }}" parents: "{{ item }}"
@ -66,13 +20,67 @@
- "interface {{ test_int1 }}" - "interface {{ test_int1 }}"
- "interface {{ test_int2 }}" - "interface {{ test_int2 }}"
- name: teardown2 - name: setup2
nxos_config: nxos_config: &cleanup2
lines: lines:
- "no channel-group 19" - "no channel-group 19"
parents: "interface {{ test_int3 }}" parents: "interface {{ test_int3 }}"
ignore_errors: yes
- name: disable feature lacp - block:
nxos_feature: - name: setup3
feature: lacp nxos_config:
state: disabled lines:
- "channel-group 10"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Gather LAG interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- name: Overridden
nxos_lag_interfaces: &overridden
config:
- name: port-channel19
members:
- member: "{{ test_int3 }}"
state: overridden
register: result
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
- "result.changed == true"
- name: Gather LAG interfaces post facts
nxos_facts: *facts
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Overridden
nxos_lag_interfaces: *overridden
register: result
- assert:
that:
- "result.changed == false"
always:
- name: teardown1
nxos_config: *cleanup1
- name: teardown2
nxos_config: *cleanup2
- name: disable feature lacp
nxos_feature:
feature: lacp
state: disabled

View file

@ -1,6 +1,6 @@
--- ---
- debug: - debug:
msg: "Start nxos_lag_interfaces merged integration tests connection={{ ansible_connection }}" msg: "Start nxos_lag_interfaces replaced integration tests connection={{ ansible_connection }}"
- set_fact: test_int1="{{ nxos_int1 }}" - set_fact: test_int1="{{ nxos_int1 }}"
- set_fact: test_int2="{{ nxos_int2 }}" - set_fact: test_int2="{{ nxos_int2 }}"
@ -9,65 +9,75 @@
nxos_feature: nxos_feature:
feature: lacp feature: lacp
- name: setup - name: setup1
nxos_config: nxos_config: &cleanup1
lines:
- "channel-group 10"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Gather LAG interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- name: Replaced
nxos_lag_interfaces: &replaced
config:
- name: port-channel11
members:
- member: "{{ test_int2 }}"
mode: active
state: replaced
register: result
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
- name: Gather LAG interfaces post facts
nxos_facts: *facts
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Replaced
nxos_lag_interfaces: *replaced
register: result
- assert:
that:
- "result.changed == false"
- name: teardown1
nxos_config:
lines: lines:
- "no channel-group 10" - "no channel-group 10"
parents: "interface {{ test_int1 }}" parents: "interface {{ test_int1 }}"
ignore_errors: yes
- name: teardown2 - name: setup2
nxos_config: nxos_config: &cleanup2
lines: lines:
- "no channel-group 11" - "no channel-group 11"
parents: "interface {{ test_int2 }}" parents: "interface {{ test_int2 }}"
ignore_errors: yes
- name: disable feature lacp - block:
nxos_feature: - name: setup3
feature: lacp nxos_config:
state: disabled lines:
- "channel-group 10"
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ test_int1 }}"
- "interface {{ test_int2 }}"
- name: Gather LAG interfaces facts
nxos_facts: &facts
gather_subset:
- '!all'
- '!min'
gather_network_resources: lag_interfaces
- name: Replaced
nxos_lag_interfaces: &replaced
config:
- name: port-channel11
members:
- member: "{{ test_int2 }}"
mode: active
state: replaced
register: result
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.before)|length == 0"
- name: Gather LAG interfaces post facts
nxos_facts: *facts
- assert:
that:
- "ansible_facts.network_resources.lag_interfaces|symmetric_difference(result.after)|length == 0"
- name: Idempotence - Replaced
nxos_lag_interfaces: *replaced
register: result
- assert:
that:
- "result.changed == false"
always:
- name: teardown1
nxos_config: *cleanup1
- name: teardown2
nxos_config: *cleanup2
- name: disable feature lacp
nxos_feature:
feature: lacp
state: disabled