mirror of https://github.com/ansible/ansible.git
Fix for nxos_pim issues (#35103)
* fix nxos_pim issues * unused line removed * unused line removed * remove unnecessary filespull/35053/head
parent
d0a257efad
commit
4bc22be614
@ -0,0 +1,2 @@
|
||||
---
|
||||
testcase: "*"
|
@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- prepare_nxos_tests
|
@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: collect common cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/common"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
connection: local
|
||||
register: test_cases
|
||||
|
||||
- name: collect cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
connection: local
|
||||
register: cli_cases
|
||||
|
||||
- set_fact:
|
||||
test_cases:
|
||||
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test cases (connection=network_cli)
|
||||
include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
||||
- name: run test case (connection=local)
|
||||
include: "{{ test_case_to_run }} ansible_connection=local connection={{ cli }}"
|
||||
with_first_found: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
# Use block to ensure that both cli and nxapi tests
|
||||
# will run even if there are failures or errors.
|
||||
- block:
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
||||
always:
|
||||
- { include: nxapi.yaml, tags: ['nxapi'] }
|
@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: collect common nxapi test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/common"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
connection: local
|
||||
register: test_cases
|
||||
|
||||
- name: collect nxapi test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/nxapi"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
connection: local
|
||||
register: nxapi_cases
|
||||
|
||||
- set_fact:
|
||||
test_cases:
|
||||
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test cases (connection=local)
|
||||
include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
@ -0,0 +1,74 @@
|
||||
---
|
||||
- debug: msg="START connection={{ ansible_connection }} nxos_pim sanity test"
|
||||
- debug: msg="Using provider={{ connection.transport }}"
|
||||
when: ansible_connection == "local"
|
||||
|
||||
- name: "Setup: Disable feature PIM"
|
||||
nxos_feature: &disable_feature
|
||||
feature: pim
|
||||
state: disabled
|
||||
provider: "{{ connection }}"
|
||||
|
||||
- name: "Setup: Enable feature PIM"
|
||||
nxos_feature:
|
||||
feature: pim
|
||||
state: enabled
|
||||
provider: "{{ connection }}"
|
||||
|
||||
- name: "Setup: Configure ssm_range none"
|
||||
nxos_pim: &none
|
||||
ssm_range: "none"
|
||||
provider: "{{ connection }}"
|
||||
|
||||
- block:
|
||||
- name: Configure ssm_range
|
||||
nxos_pim: &configure
|
||||
ssm_range:
|
||||
- "239.128.1.0/24"
|
||||
- "224.0.0.0/8"
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert: &true
|
||||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- name: Check idempotence
|
||||
nxos_pim: *configure
|
||||
register: result
|
||||
|
||||
- assert: &false
|
||||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- name: Configure ssm_range default
|
||||
nxos_pim: &conf_default
|
||||
ssm_range: "default"
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert: *true
|
||||
|
||||
- name: Check idempotence
|
||||
nxos_pim: *conf_default
|
||||
register: result
|
||||
|
||||
- assert: *false
|
||||
|
||||
- name: Configure ssm_range none
|
||||
nxos_pim: *none
|
||||
register: result
|
||||
|
||||
- assert: *true
|
||||
|
||||
- name: Check idempotence
|
||||
nxos_pim: *none
|
||||
register: result
|
||||
|
||||
- assert: *false
|
||||
|
||||
always:
|
||||
- name: "Disable feature PIM"
|
||||
nxos_feature: *disable_feature
|
||||
|
||||
- debug: msg="END connection={{ ansible_connection }} nxos_pim sanity test"
|
Loading…
Reference in New Issue