New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nxos_lacp: updated tests to handle platforms not supporting lacp system mac command #64074
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,21 +6,38 @@ | |
nxos_feature: | ||
feature: lacp | ||
|
||
- set_fact: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the following failure running the merged test from your nxos_lacp PR on the following release images (camden, dplus, evergreen and freeport) These older release images likey do not have support for this command. Fails in: camden (I2) I suggest you do the following:
|
||
mac: | ||
address: 00c1.4c00.bd15 | ||
role: primary | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- block: | ||
- name: Merged | ||
nxos_lacp: &merged | ||
config: | ||
system: | ||
priority: 11 | ||
mac: "{{ mac|default(omit) }}" | ||
state: merged | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- "result.before|length == 0" | ||
- "result.changed == true" | ||
- "'lacp system-priority 11' in result.commands" | ||
- "'lacp system-mac 00c1.4c00.bd15 role primary' in result.commands" | ||
- "result.commands|length == 2" | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- assert: | ||
that: | ||
- "result.before|length == 0" | ||
- "result.changed == true" | ||
- "'lacp system-priority 11' in result.commands" | ||
- "result.commands|length == 1" | ||
when: platform is not search('N9K') | ||
|
||
- name: Gather lacp facts | ||
nxos_facts: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
--- | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also add a few more tests on platforms that support both properties to be complete.
|
||
- debug: | ||
msg: "Start nxos_lacp replaced integration tests connection={{ ansible_connection }}" | ||
|
||
- name: Enable lacp feature | ||
nxos_feature: | ||
feature: lacp | ||
|
||
- set_fact: | ||
mac1: "lacp system-mac 00c1.4c00.bd20 role primary" | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- set_fact: | ||
mac2: | ||
address: 00c1.4c00.bd15 | ||
role: secondary | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- block: | ||
- name: Setup | ||
- name: Setup1 | ||
cli_config: | ||
config: lacp system-priority 11 | ||
|
||
- name: Setup2 | ||
cli_config: | ||
config: "{{ mac1|default(omit) }}" | ||
|
||
- name: Gather lacp facts | ||
nxos_facts: &facts | ||
gather_subset: | ||
|
@@ -22,26 +37,38 @@ | |
nxos_lacp: &replaced | ||
config: | ||
system: | ||
mac: | ||
address: 00c1.4c00.bd15 | ||
role: primary | ||
priority: 12 | ||
mac: "{{ mac2|default(omit) }}" | ||
state: replaced | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- "ansible_facts.network_resources.lacp == result.before" | ||
- "result.changed == true" | ||
- "'no lacp system-priority' in result.commands" | ||
- "'lacp system-mac 00c1.4c00.bd15 role primary' in result.commands" | ||
- "result.commands|length == 2" | ||
- "'no lacp system-priority' in result.commands" | ||
- "'lacp system-priority 12' in result.commands" | ||
when: platform is not search('N9K') | ||
|
||
- assert: | ||
that: | ||
- "ansible_facts.network_resources.lacp == result.before" | ||
- "result.changed == true" | ||
- "'no lacp system-priority' in result.commands" | ||
- "'no lacp system-mac' in result.commands" | ||
- "'lacp system-priority 12' in result.commands" | ||
- "'lacp system-mac 00c1.4c00.bd15 role secondary' in result.commands" | ||
- "result.commands|length == 4" | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- name: Gather lacp interfaces post facts | ||
nxos_facts: *facts | ||
|
||
- assert: | ||
that: | ||
- "ansible_facts.network_resources.lacp == result.after" | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- name: Idempotence - Replaced | ||
nxos_lacp: *replaced | ||
|
@@ -52,6 +79,24 @@ | |
- "result.changed == false" | ||
- "result.commands|length == 0" | ||
|
||
- name: Setup3 | ||
cli_config: | ||
config: "{{ mac1|default(omit) }}" | ||
|
||
- name: Replaced | ||
nxos_lacp: | ||
state: replaced | ||
register: result | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
- assert: | ||
that: | ||
- "result.changed == true" | ||
- "result.commands|length == 2" | ||
- "'no lacp system-mac' in result.commands" | ||
- "'no lacp system-priority' in result.commands" | ||
when: platform is search('N9K') and imagetag is not search('I[2-6]') | ||
|
||
always: | ||
- name: teardown | ||
nxos_feature: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ | |
- name: "Collect interface list" | ||
nxos_command: | ||
commands: ['show interface brief | json'] | ||
timeout: 60 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already addressed by: #63963 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. k, thx |
||
connection: network_cli | ||
register: intout | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you caught my laziness. will change