1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

nxos tests to use network_cli (#34474)

* Fix over-byte

* Fix nxos_l2_interface docs

* Update connections for tasks

* Add default ssh port

* Only report provider when using connection=local

* Send empty provider when connection=network_cli

* Fix find tasks
This commit is contained in:
Nathaniel Case 2018-01-05 12:39:04 -05:00 committed by GitHub
parent a0ad7ffedf
commit c371ed8d30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
199 changed files with 1589 additions and 684 deletions

View file

@ -31,7 +31,7 @@ options:
- Full name of the interface excluding any logical - Full name of the interface excluding any logical
unit number, i.e. Ethernet1/1. unit number, i.e. Ethernet1/1.
required: true required: true
aliases: interface aliases: ['interface']
mode: mode:
description: description:
- Mode in which interface needs to be configured. - Mode in which interface needs to be configured.
@ -49,7 +49,7 @@ options:
- List of VLANs to be configured in trunk port. - List of VLANs to be configured in trunk port.
If C(mode=trunk), used as the VLAN range to ADD or REMOVE If C(mode=trunk), used as the VLAN range to ADD or REMOVE
from the trunk. from the trunk.
aliases: trunk_add_vlans aliases: ['trunk_add_vlans']
trunk_allowed_vlans: trunk_allowed_vlans:
description: description:
- List of allowed VLANs in a given trunk port. - List of allowed VLANs in a given trunk port.

View file

@ -33,9 +33,9 @@ class Cliconf(CliconfBase):
device_info = {} device_info = {}
device_info['network_os'] = 'nxos' device_info['network_os'] = 'nxos'
reply = self.get(b'show version | json') reply = self.get('show version | json')
data = json.loads(reply) data = json.loads(reply)
platform_reply = self.get(b'show inventory | json') platform_reply = self.get('show inventory | json')
platform_info = json.loads(platform_reply) platform_info = json.loads(platform_reply)
device_info['network_os_version'] = data.get('sys_ver_str') or data.get('kickstart_ver_str') device_info['network_os_version'] = data.get('sys_ver_str') or data.get('kickstart_ver_str')
@ -53,7 +53,7 @@ class Cliconf(CliconfBase):
def get_config(self, source='running', flags=None): def get_config(self, source='running', flags=None):
lookup = {'running': 'running-config', 'startup': 'startup-config'} lookup = {'running': 'running-config', 'startup': 'startup-config'}
cmd = b'show {} '.format(lookup[source]) cmd = 'show {} '.format(lookup[source])
cmd += ' '.join(flags) cmd += ' '.join(flags)
cmd = cmd.strip() cmd = cmd.strip()
@ -61,7 +61,7 @@ class Cliconf(CliconfBase):
def edit_config(self, command): def edit_config(self, command):
responses = [] responses = []
for cmd in chain([b'configure'], to_list(command), [b'end']): for cmd in chain(['configure'], to_list(command), ['end']):
responses.append(self.send_command(cmd)) responses.append(self.send_command(cmd))
return json.dumps(responses) return json.dumps(responses)

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_aaa_server radius.yaml sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_aaa_server radius.yaml sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup" - name: "Setup"
nxos_aaa_server: &remove nxos_aaa_server: &remove
@ -85,11 +87,11 @@
rescue: rescue:
- debug: msg="TRANSPORT:{{ connection.transport }} nxos_aaa_server failure detected" - debug: msg="connection={{ ansible_connection }} nxos_aaa_server failure detected"
always: always:
- name: "Remove radius server configuration" - name: "Remove radius server configuration"
nxos_aaa_server: *remove nxos_aaa_server: *remove
register: result register: result
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_aaa_server radius.yaml sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_aaa_server radius.yaml sanity test"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_aaa_server tacacs.yaml sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_aaa_server tacacs.yaml sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Enable feature tacacs+" - name: "Enable feature tacacs+"
nxos_feature: nxos_feature:
@ -84,7 +86,7 @@
rescue: rescue:
- debug: msg="TRANSPORT:{{ connection.transport }} nxos_aaa_server failure detected" - debug: msg="connection={{ ansible_connection }} nxos_aaa_server failure detected"
always: always:
@ -98,4 +100,4 @@
state: disabled state: disabled
provider: "{{ connection }}" provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_aaa_server tacacs.yaml sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_aaa_server tacacs.yaml sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_aaa_server_host radius.yaml sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_aaa_server_host radius.yaml sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup" - name: "Setup"
nxos_aaa_server_host: &remove nxos_aaa_server_host: &remove
@ -117,7 +119,7 @@
rescue: rescue:
- debug: msg="TRANSPORT:{{ connection.transport }} nxos_aaa_server_host failure detected" - debug: msg="connection={{ ansible_connection }} nxos_aaa_server_host failure detected"
always: always:
@ -125,4 +127,4 @@
nxos_aaa_server_host: *remove nxos_aaa_server_host: *remove
register: result register: result
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_aaa_server_host radius.yaml sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_aaa_server_host radius.yaml sanity test"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_aaa_server_host tacacs.yaml sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_aaa_server_host tacacs.yaml sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Enable feature tacacs+" - name: "Enable feature tacacs+"
nxos_feature: nxos_feature:
@ -121,7 +123,7 @@
rescue: rescue:
- debug: msg="TRANSPORT:{{ connection.transport }} nxos_aaa_server_host failure detected" - debug: msg="connection={{ ansible_connection }} nxos_aaa_server_host failure detected"
always: always:
@ -135,4 +137,4 @@
state: disabled state: disabled
provider: "{{ connection }}" provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_aaa_server_host tacacs.yaml sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_aaa_server_host tacacs.yaml sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_acl sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_acl sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: time_range="ans-range" - set_fact: time_range="ans-range"
when: not ( platform is match("N5K")) when: not ( platform is match("N5K"))
@ -61,4 +63,4 @@
- assert: *false - assert: *false
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_acl sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_acl sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport}} nxos_acl_interface sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_acl_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: intname="{{ nxos_int1 }}" - set_fact: intname="{{ nxos_int1 }}"
@ -115,4 +117,4 @@
ignore_errors: yes ignore_errors: yes
always: always:
- debug: msg="END TRANSPORT:{{ connection.transport}} nxos_acl_interface sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_acl_interface sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_bgp sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_bgp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: neighbor_down_fib_accelerate="true" - set_fact: neighbor_down_fib_accelerate="true"
when: not titanium when: not titanium
@ -132,4 +134,4 @@
ignore_errors: yes ignore_errors: yes
always: always:
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_bgp sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_bgp sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_bgp_af sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_bgp_af sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: advertise_l2vpn_evpn="true" - set_fact: advertise_l2vpn_evpn="true"
when: platform is search('N9K') when: platform is search('N9K')
@ -146,4 +148,4 @@
provider: "{{ connection }}" provider: "{{ connection }}"
when: platform is search('N9K') when: platform is search('N9K')
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_bgp_af sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_bgp_af sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport}} nxos_bgp_neighbor sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_bgp_neighbor sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: intname="{{ nxos_int1 }}" - set_fact: intname="{{ nxos_int1 }}"
@ -200,4 +202,4 @@
state: disabled state: disabled
provider: "{{ connection }}" provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport}} nxos_bgp_neighbor sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_bgp_neighbor sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_bgp_neighbor_af sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_bgp_neighbor_af sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: &disable_bgp nxos_feature: &disable_bgp
@ -201,4 +203,4 @@
- name: "Disable feature bgp" - name: "Disable feature bgp"
nxos_feature: *disable_bgp nxos_feature: *disable_bgp
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_bgp_neighbor_af sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_bgp_neighbor_af sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:CLI nxos_command sanity test" - debug: msg="START TRANSPORT:CLI nxos_command sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:NXAPI nxos_command sanity test" - debug: msg="START TRANSPORT:NXAPI nxos_command sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Disable feature BGP" - name: "Disable feature BGP"
nxos_feature: nxos_feature:

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_config sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_config sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: setup - name: setup
nxos_config: nxos_config:
@ -38,4 +40,4 @@
provider: "{{ connection }}" provider: "{{ connection }}"
match: none match: none
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_config sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_config sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_evpn_global sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_evpn_global sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup" - name: "Setup"
nxos_config: &remove_evpn_config nxos_config: &remove_evpn_config
@ -58,7 +60,7 @@
when: not ( platform is search('N3K')) when: not ( platform is search('N3K'))
rescue: rescue:
- debug: msg="TRANSPORT:{{ connection.transport }} nxos_evpn_global sanity test - FALURE ENCOUNTERED" - debug: msg="connection={{ ansible_connection }} nxos_evpn_global sanity test - FALURE ENCOUNTERED"
always: always:
@ -70,4 +72,4 @@
nxos_feature: *disable_feature_nv_overlay nxos_feature: *disable_feature_nv_overlay
ignore_errors: yes ignore_errors: yes
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_evpn_global sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_evpn_global sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_evpn_vni sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_evpn_vni sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup" - name: "Setup"
nxos_config: &remove_evpn nxos_config: &remove_evpn
@ -71,4 +73,4 @@
provider: "{{ connection }}" provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_evpn_vni sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_evpn_vni sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_facts sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_facts sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "nxos_facts gather hardware facts" - name: "nxos_facts gather hardware facts"
nxos_facts: nxos_facts:
@ -75,4 +77,4 @@
- "result.ansible_facts.ansible_net_memfree_mb > 1" - "result.ansible_facts.ansible_net_memfree_mb > 1"
- "result.ansible_facts.ansible_net_memtotal_mb > 1" - "result.ansible_facts.ansible_net_memtotal_mb > 1"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_facts sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_facts sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:CLI nxos_file_copy sanity test" - debug: msg="START TRANSPORT:CLI nxos_file_copy sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup - Remove existing file" - name: "Setup - Remove existing file"
nxos_command: &remove_file nxos_command: &remove_file

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:NXAPI nxos_file_copy sanity test" - debug: msg="START TRANSPORT:NXAPI nxos_file_copy sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup - Remove existing file" - name: "Setup - Remove existing file"
nxos_command: &remove_file nxos_command: &remove_file

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
#--- #---
#- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_gir sanity test" #- debug: msg="START connection={{ ansible_connection }} nxos_gir sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# #
#- name: "Setup" #- name: "Setup"
# nxos_gir: &setup # nxos_gir: &setup
@ -92,7 +94,7 @@
# #
# rescue: # rescue:
# #
# - debug: msg="TRANSPORT:{{ connection.transport }} nxos_gir failure detected" # - debug: msg="connection={{ ansible_connection }} nxos_gir failure detected"
# #
# always: # always:
# #
@ -100,4 +102,4 @@
# nxos_gir: *setup # nxos_gir: *setup
# register: result # register: result
# #
# - debug: msg="END TRANSPORT:{{ connection.transport }} nxos_gir sanity test" # - debug: msg="END connection={{ ansible_connection }} nxos_gir sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_gir_profile_management sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_gir_profile_management sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: "Setup - Remove maintenace mode profiles" - name: "Setup - Remove maintenace mode profiles"
nxos_gir_profile_management: &remove_maintenance nxos_gir_profile_management: &remove_maintenance
@ -91,7 +93,7 @@
rescue: rescue:
- debug: msg="TRANSPORT:{{ connection.transport }} nxos_gir_profile_management failure detected" - debug: msg="connection={{ ansible_connection }} nxos_gir_profile_management failure detected"
always: always:
@ -107,4 +109,4 @@
state: disabled state: disabled
provider: "{{ connection }}" provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_gir_profile_management sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_gir_profile_management sanity test"

View file

@ -1,15 +1,33 @@
--- ---
- name: collect all cli test cases - 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: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases connection: local
register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -1,28 +1,27 @@
--- ---
- name: collect all nxapi test cases - 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: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases connection: local
register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_hsrp sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_hsrp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: intname="{{ nxos_int1 }}" - set_fact: intname="{{ nxos_int1 }}"
@ -89,4 +91,4 @@
provider: "{{ connection }}" provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_hsrp sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_hsrp sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_igmp sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_igmp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- block: - block:
@ -43,4 +45,4 @@
nxos_igmp: *default nxos_igmp: *default
register: result register: result
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_igmp sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_igmp sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_igmp_interface sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_igmp_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: intname="{{ nxos_int1 }}" - set_fact: intname="{{ nxos_int1 }}"
@ -87,4 +89,4 @@
state: disabled state: disabled
provider: "{{ connection }}" provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_igmp_interface sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_igmp_interface sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,21 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: enable nxapi - name: run test cases (connection=local)
nxos_config: include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
lines:
- feature nxapi
- nxapi http port 80
provider: "{{ cli }}"
- name: run test case
include: "{{ test_case_to_run }} connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run
- name: disable nxapi
nxos_config:
lines:
- no feature nxapi
provider: "{{ cli }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_igmp_snooping sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_igmp_snooping sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- block: - block:
@ -45,4 +47,4 @@
nxos_igmp_snooping: *default nxos_igmp_snooping: *default
register: result register: result
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_igmp_snooping sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_igmp_snooping sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,4 +1,6 @@
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_interface intent test" - debug: msg="START connection={{ ansible_connection }} nxos_interface intent test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint1="{{ nxos_int1 }}" - set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}" - set_fact: testint2="{{ nxos_int2 }}"
@ -60,4 +62,4 @@
provider: "{{ connection }}" provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_interface intent test" - debug: msg="END connection={{ ansible_connection }} nxos_interface intent test"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_interface sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint="{{ nxos_int1 }}" - set_fact: testint="{{ nxos_int1 }}"
@ -128,4 +130,4 @@
ignore_errors: yes ignore_errors: yes
always: always:
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_interface sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_interface sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_interface_ospf sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_interface_ospf sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint="{{ nxos_int1 }}" - set_fact: testint="{{ nxos_int1 }}"
@ -232,4 +234,4 @@
nxos_config: *removepcandlb nxos_config: *removepcandlb
always: always:
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_interface_ospf sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_interface_ospf sanity test"

View file

@ -1,15 +1,33 @@
--- ---
- name: collect all cli test cases - 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: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases connection: local
register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -1,15 +1,27 @@
--- ---
- name: collect all nxapi test cases - 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: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases connection: local
register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:CLI nxos_ip_interface sanity test" - debug: msg="START TRANSPORT:CLI nxos_ip_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint1="{{ nxos_int1 }}" - set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}" - set_fact: testint2="{{ nxos_int2 }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:NXAPI nxos_ip_interface sanity test" - debug: msg="START TRANSPORT:NXAPI nxos_ip_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint1="{{ nxos_int1 }}" - set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}" - set_fact: testint2="{{ nxos_int2 }}"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_l2_interface aggregate test" - debug: msg="START connection={{ ansible_connection }} nxos_l2_interface aggregate test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: intname1="{{ nxos_int1 }}" - set_fact: intname1="{{ nxos_int1 }}"
@ -68,4 +70,4 @@
provider: "{{ connection }}" provider: "{{ connection }}"
ignore_errors: yes ignore_errors: yes
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_l2_interface aggregate test" - debug: msg="END connection={{ ansible_connection }} nxos_l2_interface aggregate test"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_l2_interface sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_l2_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: intname="{{ nxos_int1 }}" - set_fact: intname="{{ nxos_int1 }}"
@ -121,4 +123,4 @@
nxos_config: *default nxos_config: *default
ignore_errors: yes ignore_errors: yes
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_l2_interface sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_l2_interface sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:CLI nxos_l3_interface sanity test" - debug: msg="START TRANSPORT:CLI nxos_l3_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: testint2="{{ nxos_int2 }}" - set_fact: testint2="{{ nxos_int2 }}"

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:NXAPI nxos_l3_interface sanity test" - debug: msg="START TRANSPORT:NXAPI nxos_l3_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
# Select interface for test # Select interface for test
- set_fact: testint2="{{ nxos_int2 }}" - set_fact: testint2="{{ nxos_int2 }}"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_linkagg sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_linkagg sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint1="{{ nxos_int1 }}" - set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}" - set_fact: testint2="{{ nxos_int2 }}"
@ -190,4 +192,4 @@
timeout: 60 timeout: 60
provider: "{{ connection }}" provider: "{{ connection }}"
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_linkagg sanity test" - debug: msg="END connection={{ ansible_connection }} nxos_linkagg sanity test"

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:CLI nxos_lldp sanity test" - debug: msg="START TRANSPORT:CLI nxos_lldp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: Make sure LLDP is not running before tests - name: Make sure LLDP is not running before tests
nxos_config: nxos_config:

View file

@ -1,5 +1,7 @@
--- ---
- debug: msg="START TRANSPORT:NXAPI nxos_lldp sanity test" - debug: msg="START TRANSPORT:NXAPI nxos_lldp sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- name: Make sure LLDP is not running before tests - name: Make sure LLDP is not running before tests
nxos_config: nxos_config:

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect cli test cases - name: collect cli test cases
find: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: cli_cases register: cli_cases
- set_fact: - set_fact:
@ -18,8 +20,14 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} connection={{ cli }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -3,12 +3,14 @@
find: find:
paths: "{{ role_path }}/tests/common" paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: test_cases register: test_cases
- name: collect nxapi test cases - name: collect nxapi test cases
find: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
connection: local
register: nxapi_cases register: nxapi_cases
- set_fact: - set_fact:
@ -18,8 +20,8 @@
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }} connection={{ nxapi }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

View file

@ -1,15 +1,33 @@
--- ---
- name: collect all cli test cases - 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: find:
paths: "{{ role_path }}/tests/cli" paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases connection: local
register: cli_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ cli_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} ansible_connection=network_cli connection={}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run 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

View file

@ -1,15 +1,27 @@
--- ---
- name: collect all nxapi test cases - 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: find:
paths: "{{ role_path }}/tests/nxapi" paths: "{{ role_path }}/tests/nxapi"
patterns: "{{ testcase }}.yaml" patterns: "{{ testcase }}.yaml"
register: test_cases connection: local
register: nxapi_cases
- set_fact:
test_cases:
files: "{{ test_cases.files }} + {{ nxapi_cases.files }}"
- name: set test_items - name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case - name: run test cases (connection=local)
include: "{{ test_case_to_run }}" include: "{{ test_case_to_run }} ansible_connection=local connection={{ nxapi }}"
with_items: "{{ test_items }}" with_items: "{{ test_items }}"
loop_control: loop_control:
loop_var: test_case_to_run loop_var: test_case_to_run

Some files were not shown because too many files have changed in this diff Show more