mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-24 17:20:22 -07:00
Fix for nxos_pim issues (#35103)
* fix nxos_pim issues * unused line removed * unused line removed * remove unnecessary files
This commit is contained in:
parent
d0a257efad
commit
4bc22be614
8 changed files with 186 additions and 11 deletions
|
@ -518,6 +518,15 @@
|
|||
failed_modules: "{{ failed_modules }} + [ 'nxos_overlay_global' ]"
|
||||
test_failed: true
|
||||
|
||||
- block:
|
||||
- include_role:
|
||||
name: nxos_pim
|
||||
when: "limit_to in ['*', 'nxos_pim']"
|
||||
rescue:
|
||||
- set_fact:
|
||||
failed_modules: "{{ failed_modules }} + [ 'nxos_pim' ]"
|
||||
test_failed: true
|
||||
|
||||
- block:
|
||||
- include_role:
|
||||
name: nxos_pim_interface
|
||||
|
|
2
test/integration/targets/nxos_pim/defaults/main.yaml
Normal file
2
test/integration/targets/nxos_pim/defaults/main.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
testcase: "*"
|
2
test/integration/targets/nxos_pim/meta/main.yml
Normal file
2
test/integration/targets/nxos_pim/meta/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- prepare_nxos_tests
|
33
test/integration/targets/nxos_pim/tasks/cli.yaml
Normal file
33
test/integration/targets/nxos_pim/tasks/cli.yaml
Normal file
|
@ -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
|
7
test/integration/targets/nxos_pim/tasks/main.yaml
Normal file
7
test/integration/targets/nxos_pim/tasks/main.yaml
Normal file
|
@ -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'] }
|
27
test/integration/targets/nxos_pim/tasks/nxapi.yaml
Normal file
27
test/integration/targets/nxos_pim/tasks/nxapi.yaml
Normal file
|
@ -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
|
74
test/integration/targets/nxos_pim/tests/common/sanity.yaml
Normal file
74
test/integration/targets/nxos_pim/tests/common/sanity.yaml
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue