diff options
author | Kate Case <kcase@redhat.com> | 2023-05-03 21:46:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-03 21:46:19 -0400 |
commit | 65eaf174d90485c566d71ec9b49365cb5bc494ba (patch) | |
tree | 067211467cf9fcb8ccd90541af005214c9f1f398 /tests | |
parent | 65026b8bc3040315e87464eeecf81c1989c9cee5 (diff) | |
download | vyos.vyos-65eaf174d90485c566d71ec9b49365cb5bc494ba.tar.gz vyos.vyos-65eaf174d90485c566d71ec9b49365cb5bc494ba.zip |
Add ansible-lint (#322)
* Add ansible-lint
* Fix some tasks
* Ignore ignore_errors
* Stop prettier and yamllint from fighting
Diffstat (limited to 'tests')
71 files changed, 310 insertions, 228 deletions
diff --git a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml index 8ada933a..c5b0d54b 100644 --- a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml +++ b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml @@ -5,6 +5,6 @@ "set interfaces ethernet eth0 address dhcp\nset interfaces ethernet eth0\ \ speed auto\nset interfaces ethernet eth0 duplex auto\nset interfaces ethernet\ \ eth1\nset interfaces ethernet eth2\ndelete interfaces loopback lo\n" - ignore_errors: true + ignore_errors: true # noqa ignore-errors ansible.netcommon.cli_config: config: "{{ lines }}" diff --git a/tests/integration/targets/vyos_banner/tasks/cli.yaml b/tests/integration/targets/vyos_banner/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_banner/tasks/cli.yaml +++ b/tests/integration/targets/vyos_banner/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_banner/tasks/main.yaml b/tests/integration/targets/vyos_banner/tasks/main.yaml index 07b0f2e9..9201bd65 100644 --- a/tests/integration/targets/vyos_banner/tasks/main.yaml +++ b/tests/integration/targets/vyos_banner/tasks/main.yaml @@ -1,2 +1,3 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml diff --git a/tests/integration/targets/vyos_bgp_address_family/tasks/cli.yaml b/tests/integration/targets/vyos_bgp_address_family/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_bgp_address_family/tasks/cli.yaml +++ b/tests/integration/targets/vyos_bgp_address_family/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_bgp_address_family/tasks/main.yaml b/tests/integration/targets/vyos_bgp_address_family/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_bgp_address_family/tasks/main.yaml +++ b/tests/integration/targets/vyos_bgp_address_family/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_bgp_global/tasks/cli.yaml b/tests/integration/targets/vyos_bgp_global/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_bgp_global/tasks/cli.yaml +++ b/tests/integration/targets/vyos_bgp_global/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_bgp_global/tasks/main.yaml b/tests/integration/targets/vyos_bgp_global/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_bgp_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_bgp_global/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_command/tasks/cli.yaml b/tests/integration/targets/vyos_command/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_command/tasks/cli.yaml +++ b/tests/integration/targets/vyos_command/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_command/tasks/main.yaml b/tests/integration/targets/vyos_command/tasks/main.yaml index 676b8ec5..34f7038e 100644 --- a/tests/integration/targets/vyos_command/tasks/main.yaml +++ b/tests/integration/targets/vyos_command/tasks/main.yaml @@ -1,7 +1,9 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_command/tasks/redirection.yaml b/tests/integration/targets/vyos_command/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_command/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_command/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_config/tasks/cli.yaml b/tests/integration/targets/vyos_config/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_config/tasks/cli.yaml +++ b/tests/integration/targets/vyos_config/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_config/tasks/cli_config.yaml b/tests/integration/targets/vyos_config/tasks/cli_config.yaml index 8ed28748..358879b1 100644 --- a/tests/integration/targets/vyos_config/tasks/cli_config.yaml +++ b/tests/integration/targets/vyos_config/tasks/cli_config.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli_config test cases - find: +- name: Collect all cli_config test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli_config" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_config/tasks/main.yaml b/tests/integration/targets/vyos_config/tasks/main.yaml index 60fb6bf0..46e91e37 100644 --- a/tests/integration/targets/vyos_config/tasks/main.yaml +++ b/tests/integration/targets/vyos_config/tasks/main.yaml @@ -1,11 +1,14 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml -- include: cli_config.yaml +- name: Run cli_config tests + ansible.builtin.include_tasks: cli_config.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_config/tasks/redirection.yaml b/tests/integration/targets/vyos_config/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_config/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_config/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_facts/tasks/cli.yaml b/tests/integration/targets/vyos_facts/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_facts/tasks/cli.yaml +++ b/tests/integration/targets/vyos_facts/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_facts/tasks/main.yaml b/tests/integration/targets/vyos_facts/tasks/main.yaml index 676b8ec5..34f7038e 100644 --- a/tests/integration/targets/vyos_facts/tasks/main.yaml +++ b/tests/integration/targets/vyos_facts/tasks/main.yaml @@ -1,7 +1,9 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_facts/tasks/redirection.yaml b/tests/integration/targets/vyos_facts/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_facts/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_facts/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_firewall_global/tasks/cli.yaml b/tests/integration/targets/vyos_firewall_global/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_firewall_global/tasks/cli.yaml +++ b/tests/integration/targets/vyos_firewall_global/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_firewall_global/tasks/main.yaml b/tests/integration/targets/vyos_firewall_global/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_firewall_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_firewall_global/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_firewall_global/tasks/redirection.yaml b/tests/integration/targets/vyos_firewall_global/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_firewall_global/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_firewall_global/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_firewall_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_firewall_interfaces/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_firewall_interfaces/tasks/cli.yaml +++ b/tests/integration/targets/vyos_firewall_interfaces/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_firewall_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_firewall_interfaces/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_firewall_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_firewall_interfaces/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_firewall_rules/tasks/cli.yaml b/tests/integration/targets/vyos_firewall_rules/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_firewall_rules/tasks/cli.yaml +++ b/tests/integration/targets/vyos_firewall_rules/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_firewall_rules/tasks/main.yaml b/tests/integration/targets/vyos_firewall_rules/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_firewall_rules/tasks/main.yaml +++ b/tests/integration/targets/vyos_firewall_rules/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_hostname/tasks/cli.yaml b/tests/integration/targets/vyos_hostname/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_hostname/tasks/cli.yaml +++ b/tests/integration/targets/vyos_hostname/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_hostname/tasks/main.yaml b/tests/integration/targets/vyos_hostname/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_hostname/tasks/main.yaml +++ b/tests/integration/targets/vyos_hostname/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_interfaces/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_interfaces/tasks/cli.yaml +++ b/tests/integration/targets/vyos_interfaces/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_interfaces/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_interfaces/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_interfaces/tasks/redirection.yaml b/tests/integration/targets/vyos_interfaces/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_interfaces/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_interfaces/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_l3_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_l3_interfaces/tasks/cli.yaml index 8aeb46d4..56f4907b 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tasks/cli.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,11 +8,12 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" delegate_to: localhost - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_l3_interfaces/tasks/redirection.yaml b/tests/integration/targets/vyos_l3_interfaces/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_lag_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_lag_interfaces/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tasks/cli.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_lag_interfaces/tasks/redirection.yaml b/tests/integration/targets/vyos_lag_interfaces/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_lldp_global/tasks/cli.yaml b/tests/integration/targets/vyos_lldp_global/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_lldp_global/tasks/cli.yaml +++ b/tests/integration/targets/vyos_lldp_global/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_lldp_global/tasks/main.yaml b/tests/integration/targets/vyos_lldp_global/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_lldp_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp_global/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml b/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_logging/tasks/cli.yaml b/tests/integration/targets/vyos_logging/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_logging/tasks/cli.yaml +++ b/tests/integration/targets/vyos_logging/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_logging/tasks/main.yaml b/tests/integration/targets/vyos_logging/tasks/main.yaml index 07b0f2e9..9201bd65 100644 --- a/tests/integration/targets/vyos_logging/tasks/main.yaml +++ b/tests/integration/targets/vyos_logging/tasks/main.yaml @@ -1,2 +1,3 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml diff --git a/tests/integration/targets/vyos_logging_global/tasks/cli.yaml b/tests/integration/targets/vyos_logging_global/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_logging_global/tasks/cli.yaml +++ b/tests/integration/targets/vyos_logging_global/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_logging_global/tasks/main.yaml b/tests/integration/targets/vyos_logging_global/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_logging_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_logging_global/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_ntp_global/tasks/cli.yaml b/tests/integration/targets/vyos_ntp_global/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_ntp_global/tasks/cli.yaml +++ b/tests/integration/targets/vyos_ntp_global/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_ntp_global/tasks/main.yaml b/tests/integration/targets/vyos_ntp_global/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_ntp_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_ntp_global/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_ospf_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_ospf_interfaces/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_ospf_interfaces/tasks/cli.yaml +++ b/tests/integration/targets/vyos_ospf_interfaces/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_ospf_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_ospf_interfaces/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_ospf_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_ospf_interfaces/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_ospfv2/tasks/cli.yaml b/tests/integration/targets/vyos_ospfv2/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_ospfv2/tasks/cli.yaml +++ b/tests/integration/targets/vyos_ospfv2/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_ospfv2/tasks/main.yaml b/tests/integration/targets/vyos_ospfv2/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_ospfv2/tasks/main.yaml +++ b/tests/integration/targets/vyos_ospfv2/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_ospfv2/tasks/redirection.yaml b/tests/integration/targets/vyos_ospfv2/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_ospfv2/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_ospfv2/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml b/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml +++ b/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_ospfv3/tasks/main.yaml b/tests/integration/targets/vyos_ospfv3/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_ospfv3/tasks/main.yaml +++ b/tests/integration/targets/vyos_ospfv3/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml b/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_prefix_lists/tasks/cli.yaml b/tests/integration/targets/vyos_prefix_lists/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_prefix_lists/tasks/cli.yaml +++ b/tests/integration/targets/vyos_prefix_lists/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_prefix_lists/tasks/main.yaml b/tests/integration/targets/vyos_prefix_lists/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_prefix_lists/tasks/main.yaml +++ b/tests/integration/targets/vyos_prefix_lists/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_route_maps/tasks/cli.yaml b/tests/integration/targets/vyos_route_maps/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_route_maps/tasks/cli.yaml +++ b/tests/integration/targets/vyos_route_maps/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_route_maps/tasks/main.yaml b/tests/integration/targets/vyos_route_maps/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_route_maps/tasks/main.yaml +++ b/tests/integration/targets/vyos_route_maps/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_smoke/tasks/cli.yaml b/tests/integration/targets/vyos_smoke/tasks/cli.yaml index d9c9ed7f..93f74555 100644 --- a/tests/integration/targets/vyos_smoke/tasks/cli.yaml +++ b/tests/integration/targets/vyos_smoke/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case with single_user_mode (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli ansible_network_single_user_mode=True" +- name: Run test case with single_user_mode (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli ansible_network_single_user_mode=True" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_smoke/tasks/main.yaml b/tests/integration/targets/vyos_smoke/tasks/main.yaml index 07b0f2e9..9201bd65 100644 --- a/tests/integration/targets/vyos_smoke/tasks/main.yaml +++ b/tests/integration/targets/vyos_smoke/tasks/main.yaml @@ -1,2 +1,3 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml diff --git a/tests/integration/targets/vyos_snmp_server/tasks/cli.yaml b/tests/integration/targets/vyos_snmp_server/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_snmp_server/tasks/cli.yaml +++ b/tests/integration/targets/vyos_snmp_server/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_snmp_server/tasks/main.yaml b/tests/integration/targets/vyos_snmp_server/tasks/main.yaml index b957d2f4..e6378581 100644 --- a/tests/integration/targets/vyos_snmp_server/tasks/main.yaml +++ b/tests/integration/targets/vyos_snmp_server/tasks/main.yaml @@ -1,4 +1,5 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli diff --git a/tests/integration/targets/vyos_static_routes/tasks/cli.yaml b/tests/integration/targets/vyos_static_routes/tasks/cli.yaml index 83496e0e..daccf720 100644 --- a/tests/integration/targets/vyos_static_routes/tasks/cli.yaml +++ b/tests/integration/targets/vyos_static_routes/tasks/cli.yaml @@ -1,6 +1,6 @@ --- - name: Collect all cli test cases - find: + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" use_regex: true @@ -8,10 +8,11 @@ delegate_to: localhost - name: Set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }}" + ansible.builtin.include_tasks: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli with_items: "{{ test_items }}" diff --git a/tests/integration/targets/vyos_static_routes/tasks/main.yaml b/tests/integration/targets/vyos_static_routes/tasks/main.yaml index 6b7d0466..9a3359ed 100644 --- a/tests/integration/targets/vyos_static_routes/tasks/main.yaml +++ b/tests/integration/targets/vyos_static_routes/tasks/main.yaml @@ -1,9 +1,11 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml tags: - network_cli -- include: redirection.yaml +- name: Run redirection CLI tests + ansible.builtin.include_tasks: redirection.yaml when: ansible_version.full is version('2.10.0', '>=') tags: - network_cli diff --git a/tests/integration/targets/vyos_static_routes/tasks/redirection.yaml b/tests/integration/targets/vyos_static_routes/tasks/redirection.yaml index 48ad53ae..a368b764 100644 --- a/tests/integration/targets/vyos_static_routes/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_static_routes/tasks/redirection.yaml @@ -1,16 +1,17 @@ --- -- name: collect all redirection cli test cases - find: +- name: Collect all redirection cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/redirection/cli" patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost -- name: set test_items for redirection - set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" +- name: Set test_items for redirection + ansible.builtin.set_fact: + test_items: "{{ shortname_test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_system/tasks/cli.yaml b/tests/integration/targets/vyos_system/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_system/tasks/cli.yaml +++ b/tests/integration/targets/vyos_system/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_system/tasks/main.yaml b/tests/integration/targets/vyos_system/tasks/main.yaml index 07b0f2e9..9201bd65 100644 --- a/tests/integration/targets/vyos_system/tasks/main.yaml +++ b/tests/integration/targets/vyos_system/tasks/main.yaml @@ -1,2 +1,3 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml diff --git a/tests/integration/targets/vyos_user/tasks/cli.yaml b/tests/integration/targets/vyos_user/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_user/tasks/cli.yaml +++ b/tests/integration/targets/vyos_user/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_user/tasks/main.yaml b/tests/integration/targets/vyos_user/tasks/main.yaml index 07b0f2e9..9201bd65 100644 --- a/tests/integration/targets/vyos_user/tasks/main.yaml +++ b/tests/integration/targets/vyos_user/tasks/main.yaml @@ -1,2 +1,3 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml diff --git a/tests/integration/targets/vyos_vlan/tasks/cli.yaml b/tests/integration/targets/vyos_vlan/tasks/cli.yaml index b2746ce7..d06a6476 100644 --- a/tests/integration/targets/vyos_vlan/tasks/cli.yaml +++ b/tests/integration/targets/vyos_vlan/tasks/cli.yaml @@ -1,16 +1,17 @@ --- -- name: collect all cli test cases - find: +- name: Collect all cli test cases + ansible.builtin.find: paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases delegate_to: localhost -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" +- name: Set test_items + ansible.builtin.set_fact: + test_items: "{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case (connection=ansible.netcommon.network_cli) - include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" +- name: Run test case (connection=ansible.netcommon.network_cli) + ansible.builtin.include_tasks: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_vlan/tasks/main.yaml b/tests/integration/targets/vyos_vlan/tasks/main.yaml index 07b0f2e9..9201bd65 100644 --- a/tests/integration/targets/vyos_vlan/tasks/main.yaml +++ b/tests/integration/targets/vyos_vlan/tasks/main.yaml @@ -1,2 +1,3 @@ --- -- include: cli.yaml +- name: Run CLI tests + ansible.builtin.include_tasks: cli.yaml |