From 5ff11894093d889a91929f06258c962a92808e33 Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Fri, 24 Mar 2023 13:30:59 -0400 Subject: [PATCH] ansible-lint: Fix name[missing] and name[play] failures Signed-off-by: Wen Liang --- tests/ensure_provider_tests.py | 15 ++++--- tests/get_coverage.yml | 3 +- .../down_profile+delete_interface.yml | 6 ++- .../playbooks/integration_pytest_python3.yml | 24 +++++++---- .../manual_test_ethtool_coalesce.yml | 24 +++++++---- tests/playbooks/run_tasks.yml | 3 +- tests/playbooks/tests_802_1x.yml | 21 ++++++---- tests/playbooks/tests_802_1x_updated.yml | 7 +++- tests/playbooks/tests_auto_gateway.yml | 33 ++++++++++----- tests/playbooks/tests_bond.yml | 30 +++++++++----- tests/playbooks/tests_bond_cloned_mac.yml | 18 ++++++--- tests/playbooks/tests_bond_deprecated.yml | 30 +++++++++----- tests/playbooks/tests_bond_options.yml | 30 +++++++++----- tests/playbooks/tests_bond_removal.yml | 30 +++++++++----- tests/playbooks/tests_bridge.yml | 24 +++++++---- tests/playbooks/tests_bridge_cloned_mac.yml | 6 ++- tests/playbooks/tests_checkpoint_cleanup.yml | 30 +++++++++----- tests/playbooks/tests_dummy.yml | 9 +++-- tests/playbooks/tests_eth_dns_support.yml | 25 +++++++----- .../playbooks/tests_eth_pci_address_match.yml | 9 +++-- tests/playbooks/tests_ethernet.yml | 30 +++++++++----- tests/playbooks/tests_ethtool_coalesce.yml | 21 ++++++---- tests/playbooks/tests_ethtool_features.yml | 29 +++++++++----- tests/playbooks/tests_ethtool_ring.yml | 21 ++++++---- tests/playbooks/tests_infiniband.yml | 12 ++++-- tests/playbooks/tests_ipv6.yml | 21 ++++++---- tests/playbooks/tests_ipv6_disabled.yml | 28 ++++++++----- tests/playbooks/tests_ipv6_dns_search.yml | 12 ++++-- tests/playbooks/tests_network_state.yml | 34 ++++++++++------ tests/playbooks/tests_provider.yml | 10 +++-- tests/playbooks/tests_reapply.yml | 27 ++++++++----- tests/playbooks/tests_route_table.yml | 25 +++++++----- tests/playbooks/tests_routing_rules.yml | 25 +++++++----- tests/playbooks/tests_states.yml | 40 +++++++++++++------ tests/playbooks/tests_switch_provider.yml | 24 +++++++---- tests/playbooks/tests_team.yml | 9 +++-- .../tests_team_plugin_installation.yml | 3 +- tests/playbooks/tests_vlan_mtu.yml | 21 ++++++---- tests/playbooks/tests_wireless.yml | 15 ++++--- .../tests_wireless_plugin_installation.yml | 3 +- tests/playbooks/tests_wireless_wpa3_owe.yml | 9 +++-- tests/playbooks/tests_wireless_wpa3_sae.yml | 3 +- tests/setup-snapshot.yml | 3 +- tests/tasks/assert_device_absent.yml | 3 +- tests/tasks/assert_device_present.yml | 3 +- tests/tasks/assert_profile_absent.yml | 3 +- tests/tasks/assert_profile_present.yml | 3 +- tests/tasks/create_and_remove_interface.yml | 30 +++++++++----- tests/tasks/el_repo_setup.yml | 3 +- tests/tasks/enable_epel.yml | 3 +- tests/tasks/get_NetworkManager_NVR.yml | 3 +- tests/tasks/manage_test_interface.yml | 3 +- tests/tasks/run_test.yml | 3 +- tests/tasks/setup_802.1x.yml | 3 +- tests/tasks/setup_mock_wifi_wpa3_owe.yml | 3 +- tests/tasks/setup_mock_wifi_wpa3_sae.yml | 3 +- tests/tasks/setup_test_interface.yml | 3 +- tests/tasks/show_interfaces.yml | 3 +- tests/tasks/test_802.1x_capath.yml | 3 +- tests/tests_802_1x_nm.yml | 6 ++- tests/tests_802_1x_updated_nm.yml | 6 ++- tests/tests_auto_gateway_initscripts.yml | 6 ++- tests/tests_auto_gateway_nm.yml | 6 ++- tests/tests_bond_cloned_mac_initscripts.yml | 6 ++- tests/tests_bond_cloned_mac_nm.yml | 6 ++- tests/tests_bond_deprecated_initscripts.yml | 6 ++- tests/tests_bond_deprecated_nm.yml | 6 ++- tests/tests_bond_initscripts.yml | 6 ++- tests/tests_bond_nm.yml | 6 ++- tests/tests_bond_options_nm.yml | 6 ++- tests/tests_bond_removal_initscripts.yml | 6 ++- tests/tests_bond_removal_nm.yml | 6 ++- tests/tests_bridge_cloned_mac_initscripts.yml | 6 ++- tests/tests_bridge_cloned_mac_nm.yml | 6 ++- tests/tests_bridge_initscripts.yml | 6 ++- tests/tests_bridge_nm.yml | 6 ++- .../tests_change_indication_on_repeat_run.yml | 36 +++++++++++------ tests/tests_default.yml | 3 +- tests/tests_default_initscripts.yml | 7 +++- tests/tests_default_nm.yml | 7 +++- tests/tests_dummy_nm.yml | 6 ++- tests/tests_eth_dns_support_nm.yml | 6 ++- tests/tests_eth_pci_address_match_nm.yml | 9 +++-- tests/tests_ethernet_initscripts.yml | 6 ++- tests/tests_ethernet_nm.yml | 6 ++- tests/tests_ethtool_coalesce_initscripts.yml | 6 ++- tests/tests_ethtool_coalesce_nm.yml | 9 +++-- tests/tests_ethtool_features_initscripts.yml | 6 ++- tests/tests_ethtool_features_nm.yml | 9 +++-- tests/tests_ethtool_ring_initscripts.yml | 6 ++- tests/tests_ethtool_ring_nm.yml | 9 +++-- tests/tests_helpers_and_asserts.yml | 3 +- tests/tests_infiniband_nm.yml | 6 ++- tests/tests_integration_pytest.yml | 7 +++- tests/tests_ipv6_disabled_nm.yml | 6 ++- tests/tests_ipv6_dns_search_nm.yml | 6 ++- tests/tests_ipv6_initscripts.yml | 6 ++- tests/tests_ipv6_nm.yml | 6 ++- tests/tests_network_state_nm.yml | 6 ++- tests/tests_provider_nm.yml | 9 +++-- tests/tests_reapply_nm.yml | 6 ++- tests/tests_regression_nm.yml | 8 +++- tests/tests_route_device_initscripts.yml | 6 ++- tests/tests_route_device_nm.yml | 6 ++- tests/tests_route_table_nm.yml | 6 ++- tests/tests_routing_rules_nm.yml | 6 ++- tests/tests_states_initscripts.yml | 6 ++- tests/tests_states_nm.yml | 6 ++- tests/tests_switch_provider.yml | 3 +- tests/tests_team_nm.yml | 6 ++- tests/tests_team_plugin_installation_nm.yml | 6 ++- tests/tests_unit.yml | 12 ++++-- tests/tests_vlan_mtu_initscripts.yml | 6 ++- tests/tests_vlan_mtu_nm.yml | 6 ++- tests/tests_wireless_nm.yml | 6 ++- .../tests_wireless_plugin_installation_nm.yml | 6 ++- tests/tests_wireless_wpa3_owe_nm.yml | 6 ++- tests/tests_wireless_wpa3_sae_nm.yml | 6 ++- 118 files changed, 847 insertions(+), 431 deletions(-) diff --git a/tests/ensure_provider_tests.py b/tests/ensure_provider_tests.py index c893d73..0d28585 100755 --- a/tests/ensure_provider_tests.py +++ b/tests/ensure_provider_tests.py @@ -11,7 +11,8 @@ import sys GET_NM_VERSION = """ - - when: + - name: Install NetworkManager and get NetworkManager version + when: - ansible_distribution_major_version != '6' tags: - always @@ -46,7 +47,8 @@ RUN_PLAYBOOK_WITH_NM = """# SPDX-License-Identifier: BSD-3-Clause - hosts: all name: Run playbook '{test_playbook}' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -56,7 +58,8 @@ RUN_PLAYBOOK_WITH_NM = """# SPDX-License-Identifier: BSD-3-Clause # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -{comment}- import_playbook: {test_playbook} +{comment}- name: Import the playbook '{test_playbook}' + import_playbook: {test_playbook} when: - ansible_distribution_major_version != '6' {minimum_nm_version_check}{extra_run_condition}""" @@ -150,14 +153,16 @@ RUN_PLAYBOOK_WITH_INITSCRIPTS = """# SPDX-License-Identifier: BSD-3-Clause - hosts: all name: Run playbook '{test_playbook}' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: {test_playbook} +- name: Import the playbook '{test_playbook}' + import_playbook: {test_playbook} when: (ansible_distribution in ['CentOS','RedHat'] and\n \ ansible_distribution_major_version | int < 9) """ diff --git a/tests/get_coverage.yml b/tests/get_coverage.yml index 8ef5973..271b6b8 100644 --- a/tests/get_coverage.yml +++ b/tests/get_coverage.yml @@ -62,7 +62,8 @@ name: coverage extra_args: --user --upgrade -- import_playbook: "{{ test_playbook }}" +- name: Import the playbook '{{ test_playbook }}' + import_playbook: "{{ test_playbook }}" vars: ansible_python_interpreter: # yamllint disable-line rule:line-length diff --git a/tests/playbooks/down_profile+delete_interface.yml b/tests/playbooks/down_profile+delete_interface.yml index 64b862f..67c26dd 100644 --- a/tests/playbooks/down_profile+delete_interface.yml +++ b/tests/playbooks/down_profile+delete_interface.yml @@ -1,7 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- import_playbook: down_profile.yml +- name: Import the playbook 'down_profile.yml' + import_playbook: down_profile.yml - name: Delete the interface hosts: all tasks: - - include_tasks: tasks/delete_interface.yml + - name: Include the task 'delete_interface.yml' + include_tasks: tasks/delete_interface.yml diff --git a/tests/playbooks/integration_pytest_python3.yml b/tests/playbooks/integration_pytest_python3.yml index 34aee7a..499f7a7 100644 --- a/tests/playbooks/integration_pytest_python3.yml +++ b/tests/playbooks/integration_pytest_python3.yml @@ -21,17 +21,20 @@ # Import needed in order to install initscripts dependencies on the remote # system. -- import_playbook: "../tests_default_initscripts.yml" +- name: Import the playbook '../tests_default_initscripts.yml' + import_playbook: "../tests_default_initscripts.yml" # Import needed in order to install Network Manager dependencies on the remote # system. -- import_playbook: "../tests_default_nm.yml" +- name: Import the playbook '../tests_default_nm.yml' + import_playbook: "../tests_default_nm.yml" - name: Run Pytest tests hosts: all tasks: - - block: + - name: Run Pytest tests + block: - name: Create tempdir for code to test tempfile: state: directory @@ -45,7 +48,8 @@ register: temptar delegate_to: localhost - - include_tasks: ../tasks/get_modules_and_utils_paths.yml + - name: Include the task '../tasks/get_modules_and_utils_paths.yml' + include_tasks: ../tasks/get_modules_and_utils_paths.yml - name: Get tests directory set_fact: @@ -125,7 +129,8 @@ command: ls -alrtFR {{ _rundir.path }} changed_when: false - - block: + - name: Run pytest with nm provider + block: - name: Run pytest with nm command: > pytest @@ -136,10 +141,12 @@ PYTHONPATH: "{{ _lsr_python_path }}" changed_when: false always: - - debug: + - name: Debug stdout_lines of the running playbook with nm + debug: var: playbook_run.stdout_lines - - block: + - name: Run pytest with initscripts provider + block: - name: Install network-scripts when running pytest with initscripts package: name: network-scripts @@ -154,7 +161,8 @@ PYTHONPATH: "{{ _lsr_python_path }}" changed_when: false always: - - debug: + - name: Debug stdout_lines of the running playbook with initscripts + debug: var: playbook_run.stdout_lines always: - name: Remove local tar file diff --git a/tests/playbooks/manual_test_ethtool_coalesce.yml b/tests/playbooks/manual_test_ethtool_coalesce.yml index c7afd25..34291a6 100644 --- a/tests/playbooks/manual_test_ethtool_coalesce.yml +++ b/tests/playbooks/manual_test_ethtool_coalesce.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing ethtool coalesce settings + hosts: all vars: interface: "{{ network_interface_name1 }}" type: "{{ network_interface_type1 }}" @@ -8,16 +9,20 @@ - name: "INIT: Ethtool coalesce tests" debug: msg: "##################################################" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Install ethtool (test dependency) package: name: ethtool state: present - - block: + - name: Test ethtool coalesce settings + block: - name: >- TEST: I can create a profile without changing the ethtool coalesce. debug: @@ -106,10 +111,12 @@ when: network_provider == 'nm' always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - - import_role: + - name: Deactivate the connection and remove the connection profile + import_role: name: linux-system-roles.network vars: network_connections: @@ -117,6 +124,7 @@ persistent_state: absent state: down failed_when: false - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/playbooks/run_tasks.yml b/tests/playbooks/run_tasks.yml index ea56720..662cc7d 100644 --- a/tests/playbooks/run_tasks.yml +++ b/tests/playbooks/run_tasks.yml @@ -3,4 +3,5 @@ - name: Run the tasklist {{ task }} hosts: all tasks: - - include_tasks: "{{ task }}" + - name: Include the task '{{ task }}' + include_tasks: "{{ task }}" diff --git a/tests/playbooks/tests_802_1x.yml b/tests/playbooks/tests_802_1x.yml index 3a6c548..8c55b89 100644 --- a/tests/playbooks/tests_802_1x.yml +++ b/tests/playbooks/tests_802_1x.yml @@ -1,14 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing configuring 802.1x authentication + hosts: all vars: interface: 802-1x-test tasks: - name: "INIT: 802.1x tests" debug: msg: "##################################################" - - include_tasks: tasks/setup_802.1x.yml - - block: + - name: Include the task 'setup_802.1x.yml' + include_tasks: tasks/setup_802.1x.yml + - name: Test configuring 802.1x authentication + block: - name: "TEST: 802.1x profile with private key password and ca cert" debug: msg: "##################################################" @@ -94,12 +97,15 @@ persistent_state: absent state: down - - include_tasks: tasks/test_802.1x_capath.yml + - name: Include the task 'test_802.1x_capath.yml' + include_tasks: tasks/test_802.1x_capath.yml always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - - import_role: + - name: Deactivate the connection and remove the connection profile + import_role: name: linux-system-roles.network vars: network_connections: @@ -110,7 +116,8 @@ persistent_state: absent state: down failed_when: false - - include_tasks: tasks/cleanup_802_1x_server.yml + - name: Include the task 'cleanup_802_1x_server.yml' + include_tasks: tasks/cleanup_802_1x_server.yml - name: Remove test certificates file: state: absent diff --git a/tests/playbooks/tests_802_1x_updated.yml b/tests/playbooks/tests_802_1x_updated.yml index d702b1f..6ae3ac3 100644 --- a/tests/playbooks/tests_802_1x_updated.yml +++ b/tests/playbooks/tests_802_1x_updated.yml @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing configuring 802.1x authentication with latest + NetworkManager + hosts: all tasks: - name: Update NetworkManager package: @@ -10,4 +12,5 @@ service: name: NetworkManager state: restarted -- import_playbook: tests_802_1x.yml +- name: Import the playbook 'tests_802_1x.yml' + import_playbook: tests_802_1x.yml diff --git a/tests/playbooks/tests_auto_gateway.yml b/tests/playbooks/tests_auto_gateway.yml index e1bd0bf..4bc23d3 100644 --- a/tests/playbooks/tests_auto_gateway.yml +++ b/tests/playbooks/tests_auto_gateway.yml @@ -1,15 +1,19 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing auto_gateway setting + hosts: all vars: type: veth interface: veth0 tasks: - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: >- TEST: I can configure an interface with auto_gateway enabled debug: @@ -35,8 +39,10 @@ # not take precedence over other routes or not ignore other # routes route_metric4: 65535 - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ interface }}" - name: "Show ipv4 routes" @@ -72,14 +78,16 @@ persistent_state: absent state: down ignore_errors: true # noqa ignore-errors - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent - name: >- TEST: I can configure an interface with auto_gateway disabled debug: msg: "##################################################" - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - name: Import network role @@ -99,8 +107,10 @@ - "203.0.113.2/24" gateway6: "2001:db8::1" gateway4: "203.0.113.1" - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ interface }}" - name: "Show ipv4 routes" @@ -136,6 +146,7 @@ persistent_state: absent state: down ignore_errors: true # noqa ignore-errors - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/playbooks/tests_bond.yml b/tests/playbooks/tests_bond.yml index d3b8d01..6f59621 100644 --- a/tests/playbooks/tests_bond.yml +++ b/tests/playbooks/tests_bond.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing bond connection + hosts: all tags: - tests::expfail vars: @@ -14,11 +15,14 @@ - name: "INIT Prepare setup" debug: msg: "##################################################" - - import_tasks: tasks/create_test_interfaces_with_dhcp.yml - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'create_test_interfaces_with_dhcp.yml' + import_tasks: tasks/create_test_interfaces_with_dhcp.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface1 }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface2 }}" - name: "Backup the /etc/resolv.conf for initscript" @@ -26,7 +30,8 @@ when: - network_provider == "initscripts" changed_when: false - - block: + - name: Test bond device + block: - name: "TEST Add Bond with 2 ports" debug: msg: "##################################################" @@ -57,10 +62,12 @@ type: ethernet interface_name: "{{ dhcp_interface2 }}" controller: "{{ controller_profile }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ controller_device }}" - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ item }}" loop: @@ -88,7 +95,8 @@ delay: 2 changed_when: false always: - - tags: + - name: Clean up the test devices and the connection profiles + tags: - "tests::cleanup" block: - name: Import network role @@ -106,10 +114,12 @@ persistent_state: absent state: down failed_when: false - - command: ip link del {{ controller_device }} + - name: Delete the device '{{ controller_device }}' + command: ip link del {{ controller_device }} failed_when: false changed_when: false - - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml + - name: Import the task 'remove_test_interfaces_with_dhcp.yml' + import_tasks: tasks/remove_test_interfaces_with_dhcp.yml - name: "Restore the /etc/resolv.conf for initscript" command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf when: diff --git a/tests/playbooks/tests_bond_cloned_mac.yml b/tests/playbooks/tests_bond_cloned_mac.yml index f91a069..e71af78 100644 --- a/tests/playbooks/tests_bond_cloned_mac.yml +++ b/tests/playbooks/tests_bond_cloned_mac.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing bond cloned MAC address + hosts: all tags: - tests::expfail vars: @@ -14,13 +15,15 @@ - name: INIT Prepare setup debug: msg: "##################################################" - - import_tasks: tasks/create_test_interfaces_with_dhcp.yml + - name: Import the task 'create_test_interfaces_with_dhcp.yml' + import_tasks: tasks/create_test_interfaces_with_dhcp.yml - name: Backup the /etc/resolv.conf for initscript command: cp -vf /etc/resolv.conf /etc/resolv.conf.bak when: - network_provider == "initscripts" changed_when: false - - block: + - name: Test bond cloned MAC address + block: - name: TEST Add Bond with 2 ports debug: msg: "##################################################" @@ -104,7 +107,8 @@ when: network_provider == 'initscripts' always: - - tags: + - name: Clean up the test devices and the connection profiles + tags: - "tests::cleanup" block: - name: Import network role @@ -122,10 +126,12 @@ persistent_state: absent state: down failed_when: false - - command: ip link del {{ controller_device }} + - name: Delete the device '{{ controller_device }}' + command: ip link del {{ controller_device }} failed_when: false changed_when: false - - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml + - name: Import the task 'remove_test_interfaces_with_dhcp.yml' + import_tasks: tasks/remove_test_interfaces_with_dhcp.yml - name: Restore the /etc/resolv.conf for initscript command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf when: diff --git a/tests/playbooks/tests_bond_deprecated.yml b/tests/playbooks/tests_bond_deprecated.yml index d48c703..d015cc6 100644 --- a/tests/playbooks/tests_bond_deprecated.yml +++ b/tests/playbooks/tests_bond_deprecated.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing bond device using deprecated 'master' argument + hosts: all tags: - tests::expfail vars: @@ -14,14 +15,18 @@ - name: "INIT Prepare setup" debug: msg: "##################################################" - - import_tasks: tasks/create_test_interfaces_with_dhcp.yml - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'create_test_interfaces_with_dhcp.yml' + import_tasks: tasks/create_test_interfaces_with_dhcp.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface1 }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface2 }}" - - block: + - name: Test bond device using deprecated 'master' argument + block: - name: "TEST Add Bond with 2 ports using deprecated 'master' argument" debug: msg: "##################################################" @@ -52,10 +57,12 @@ type: ethernet interface_name: "{{ dhcp_interface2 }}" master: "{{ controller_profile }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ controller_device }}" - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ item }}" loop: @@ -83,7 +90,8 @@ delay: 2 changed_when: false always: - - tags: + - name: Clean up the test devices and the connection profiles + tags: - "tests::cleanup" block: - name: Import network role @@ -101,7 +109,9 @@ persistent_state: absent state: down failed_when: false - - command: ip link del {{ controller_device }} + - name: Delete the device '{{ controller_device }}' + command: ip link del {{ controller_device }} failed_when: false changed_when: false - - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml + - name: Import the task 'remove_test_interfaces_with_dhcp.yml' + import_tasks: tasks/remove_test_interfaces_with_dhcp.yml diff --git a/tests/playbooks/tests_bond_options.yml b/tests/playbooks/tests_bond_options.yml index 425be36..4fa5502 100644 --- a/tests/playbooks/tests_bond_options.yml +++ b/tests/playbooks/tests_bond_options.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing bond options + hosts: all tags: - tests::expfail vars: @@ -14,14 +15,18 @@ - name: "INIT Prepare setup" debug: msg: "##################################################" - - import_tasks: tasks/create_test_interfaces_with_dhcp.yml - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'create_test_interfaces_with_dhcp.yml' + import_tasks: tasks/create_test_interfaces_with_dhcp.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface1 }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface2 }}" - - block: + - name: Test bond options + block: - name: "TEST Add Bond with 2 ports" debug: msg: "##################################################" @@ -68,10 +73,12 @@ type: ethernet interface_name: "{{ dhcp_interface2 }}" controller: "{{ controller_profile }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ controller_device }}" - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ item }}" loop: @@ -177,7 +184,8 @@ changed_when: false always: - - tags: + - name: Clean up the test devices and the connection profiles + tags: - "tests::cleanup" block: - name: Import network role @@ -195,7 +203,9 @@ persistent_state: absent state: down failed_when: false - - command: ip link del {{ controller_device }} + - name: Delete the device '{{ controller_device }}' + command: ip link del {{ controller_device }} failed_when: false changed_when: false - - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml + - name: Import the task 'remove_test_interfaces_with_dhcp.yml' + import_tasks: tasks/remove_test_interfaces_with_dhcp.yml diff --git a/tests/playbooks/tests_bond_removal.yml b/tests/playbooks/tests_bond_removal.yml index dd6e573..c319c70 100644 --- a/tests/playbooks/tests_bond_removal.yml +++ b/tests/playbooks/tests_bond_removal.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing bond removal + hosts: all tags: - tests::expfail vars: @@ -14,11 +15,14 @@ - name: "INIT Prepare setup" debug: msg: "##################################################" - - import_tasks: tasks/create_test_interfaces_with_dhcp.yml - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'create_test_interfaces_with_dhcp.yml' + import_tasks: tasks/create_test_interfaces_with_dhcp.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface1 }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ dhcp_interface2 }}" - name: "Backup the /etc/resolv.conf for initscript" @@ -26,7 +30,8 @@ when: - network_provider == "initscripts" changed_when: false - - block: + - name: Test removing bond device + block: - name: "TEST Add Bond with 2 ports" debug: msg: "##################################################" @@ -57,10 +62,12 @@ type: ethernet interface_name: "{{ dhcp_interface2 }}" controller: "{{ controller_profile }}" - - import_tasks: tasks/assert_device_present.yml + - name: Import the task 'assert_device_present.yml' + import_tasks: tasks/assert_device_present.yml vars: interface: "{{ controller_device }}" - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ item }}" loop: @@ -228,7 +235,8 @@ when: network_provider == "initscripts" always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - name: Import network role @@ -240,10 +248,12 @@ state: down persistent_state: absent failed_when: false - - command: ip link del {{ controller_device }} + - name: Delete the device '{{ controller_device }}' + command: ip link del {{ controller_device }} failed_when: false changed_when: false - - import_tasks: tasks/remove_test_interfaces_with_dhcp.yml + - name: Import the task 'remove_test_interfaces_with_dhcp.yml' + import_tasks: tasks/remove_test_interfaces_with_dhcp.yml - name: "Restore the /etc/resolv.conf for initscript" command: mv -vf /etc/resolv.conf.bak /etc/resolv.conf when: diff --git a/tests/playbooks/tests_bridge.yml b/tests/playbooks/tests_bridge.yml index 9f936a4..643b4bf 100644 --- a/tests/playbooks/tests_bridge.yml +++ b/tests/playbooks/tests_bridge.yml @@ -9,8 +9,10 @@ - name: "Set interface={{ interface }}" set_fact: interface: "{{ interface }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml - name: Add test bridge hosts: all @@ -26,29 +28,35 @@ roles: - linux-system-roles.network -- import_playbook: run_tasks.yml +- name: Import the playbook 'run_tasks.yml' + import_playbook: run_tasks.yml vars: task: tasks/assert_device_present.yml -- import_playbook: run_tasks.yml +- name: Import the playbook 'run_tasks.yml' + import_playbook: run_tasks.yml vars: profile: "{{ interface }}" task: tasks/assert_profile_present.yml -- import_playbook: down_profile+delete_interface.yml +- name: Import the playbook 'down_profile+delete_interface.yml' + import_playbook: down_profile+delete_interface.yml vars: profile: "{{ interface }}" # FIXME: assert profile/device down -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" -- import_playbook: run_tasks.yml +- name: Import the playbook 'run_tasks.yml' + import_playbook: run_tasks.yml vars: profile: "{{ interface }}" task: tasks/assert_profile_absent.yml -- import_playbook: run_tasks.yml +- name: Import the playbook 'run_tasks.yml' + import_playbook: run_tasks.yml vars: task: tasks/assert_device_absent.yml diff --git a/tests/playbooks/tests_bridge_cloned_mac.yml b/tests/playbooks/tests_bridge_cloned_mac.yml index 9c91a4f..5843167 100644 --- a/tests/playbooks/tests_bridge_cloned_mac.yml +++ b/tests/playbooks/tests_bridge_cloned_mac.yml @@ -51,10 +51,12 @@ cloned_mac_address_nm.stdout.find(cloned_mac) != -1 msg: "cloned-mac-address is configured incorrectly" -- import_playbook: down_profile+delete_interface.yml +- name: Import the playbook 'down_profile+delete_interface.yml' + import_playbook: down_profile+delete_interface.yml vars: profile: "{{ interface }}" -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" diff --git a/tests/playbooks/tests_checkpoint_cleanup.yml b/tests/playbooks/tests_checkpoint_cleanup.yml index 67c19f4..0baff35 100644 --- a/tests/playbooks/tests_checkpoint_cleanup.yml +++ b/tests/playbooks/tests_checkpoint_cleanup.yml @@ -4,7 +4,8 @@ # mark a device as unmanaged for NM and then tries to activiate it using NM. # This failed without removing the checkpoint. --- -- hosts: all +- name: Play for testing checkpoint cleanup + hosts: all vars: interface: cptstbr profile: "{{ interface }}" @@ -13,12 +14,15 @@ - name: Show test banner debug: msg: Inside states tests - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml roles: - linux-system-roles.network tasks: - - block: + - name: Test checkpoint cleanup + block: # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1832897 - name: Install dbus-tools package: @@ -37,8 +41,10 @@ ip: dhcp4: false auto6: false - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml # Use internal module directly for speedup - name: Use network_connections network_connections: @@ -73,19 +79,23 @@ '/org/freedesktop/NetworkManager/Checkpoint/' not in nm_dbus_objects.stdout_lines always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" ignore_errors: true # noqa ignore-errors block: # Use internal module directly for speedup - - network_connections: + - name: Deactivate the connection and remove the connection profile + network_connections: provider: nm connections: - name: "{{ interface }}" persistent_state: absent state: down - - file: + - name: Remove the connection profile + file: dest: "/etc/sysconfig/network-scripts/ifcfg-{{ interface }}" state: absent - - command: ip link del "{{ interface }}" + - name: Delete the device '{{ interface }}' + command: ip link del "{{ interface }}" changed_when: false diff --git a/tests/playbooks/tests_dummy.yml b/tests/playbooks/tests_dummy.yml index bbe883a..9b3b63b 100644 --- a/tests/playbooks/tests_dummy.yml +++ b/tests/playbooks/tests_dummy.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing dummy connection + hosts: all vars: interface: dummy0 profile: "{{ interface }}" @@ -13,10 +14,12 @@ tags: - always - - tags: + - name: Test the dummy connection + tags: - tests::dummy:create block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: Create a dummy interface lsr_setup: diff --git a/tests/playbooks/tests_eth_dns_support.yml b/tests/playbooks/tests_eth_dns_support.yml index e91b4c0..ac4ba2b 100644 --- a/tests/playbooks/tests_eth_dns_support.yml +++ b/tests/playbooks/tests_eth_dns_support.yml @@ -1,8 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all - -- name: Test configuring ethernet devices +- name: Play for testing dns support hosts: all vars: type: veth @@ -14,11 +12,14 @@ set_fact: type: "{{ type }}" interface: "{{ interface }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Import network role import_role: @@ -116,18 +117,22 @@ - "'9999' in ipv6_dns.stdout" msg: "DNS priority is configured incorrectly" -- import_playbook: down_profile+delete_interface.yml +- name: Import the playbook 'down_profile+delete_interface.yml' + import_playbook: down_profile+delete_interface.yml vars: profile: "{{ interface }}" # FIXME: assert profile/device down -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" - name: Assert profile and device are absent hosts: all tasks: - - include_tasks: tasks/assert_profile_absent.yml + - name: Include the task 'assert_profile_absent.yml' + include_tasks: tasks/assert_profile_absent.yml vars: profile: "{{ interface }}" - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml ... diff --git a/tests/playbooks/tests_eth_pci_address_match.yml b/tests/playbooks/tests_eth_pci_address_match.yml index eed7736..47a9b2b 100644 --- a/tests/playbooks/tests_eth_pci_address_match.yml +++ b/tests/playbooks/tests_eth_pci_address_match.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing match path setting + hosts: all tasks: - name: Import network role import_role: @@ -19,7 +20,8 @@ dhcp4: false address: - 192.0.2.3/24 - - block: + - name: Test match path setting + block: - name: Get match.path setting for connection command: nmcli -f match.path connection show pseudo-pci-test-only register: match_path @@ -64,7 +66,8 @@ - "'pci-0001:00:00.0' not in clear_path.stdout" msg: "The PCI address is not removed" always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - name: Import network role diff --git a/tests/playbooks/tests_ethernet.yml b/tests/playbooks/tests_ethernet.yml index 4a67c00..3cf096c 100644 --- a/tests/playbooks/tests_ethernet.yml +++ b/tests/playbooks/tests_ethernet.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for showing the network provider + hosts: all tasks: - name: Show inside ethernet tests debug: @@ -20,11 +21,14 @@ set_fact: type: "{{ type }}" interface: "{{ interface }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Test static interface up hosts: all @@ -40,9 +44,11 @@ roles: - linux-system-roles.network tasks: - - include_tasks: tasks/assert_output_in_stderr_without_warnings.yml + - name: Include the task 'assert_output_in_stderr_without_warnings.yml' + include_tasks: tasks/assert_output_in_stderr_without_warnings.yml -- hosts: all +- name: Play for cleaning up the test device and the connection profile + hosts: all tasks: - name: Show network_provider debug: @@ -50,17 +56,21 @@ # FIXME: assert profile present # FIXME: assert profile/device up + IP address -- import_playbook: down_profile+delete_interface.yml +- name: Import the playbook 'down_profile+delete_interface.yml' + import_playbook: down_profile+delete_interface.yml vars: profile: "{{ interface }}" # FIXME: assert profile/device down -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" - name: Assert device and profile are absent hosts: all tasks: - - include_tasks: tasks/assert_profile_absent.yml + - name: Include the task 'assert_profile_absent.yml' + include_tasks: tasks/assert_profile_absent.yml vars: profile: "{{ interface }}" - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml diff --git a/tests/playbooks/tests_ethtool_coalesce.yml b/tests/playbooks/tests_ethtool_coalesce.yml index 8649e4d..869011a 100644 --- a/tests/playbooks/tests_ethtool_coalesce.yml +++ b/tests/playbooks/tests_ethtool_coalesce.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing ethtool coalesce settings + hosts: all vars: interface: testnic1 type: veth @@ -14,17 +15,21 @@ - name: "INIT: Ethtool coalesce tests" debug: msg: "##################################################" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Install ethtool (test dependency) package: name: ethtool state: present - - block: + - name: Test ethtool coalesce settings + block: - name: >- TEST: I can create a profile without any coalescing option. debug: @@ -151,7 +156,8 @@ - network_provider == "initscripts" always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - name: Import network role @@ -162,6 +168,7 @@ - name: "{{ interface }}" persistent_state: absent failed_when: false - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/playbooks/tests_ethtool_features.yml b/tests/playbooks/tests_ethtool_features.yml index 8a7b5b1..9bc525a 100644 --- a/tests/playbooks/tests_ethtool_features.yml +++ b/tests/playbooks/tests_ethtool_features.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing ethtool features settings + hosts: all vars: interface: testnic1 type: veth @@ -14,18 +15,22 @@ - name: "INIT: Ethtool feeatures tests" debug: msg: "##################################################" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Install ethtool (test dependency) package: name: ethtool state: present - - block: + - name: Test ethtool features settings + block: - name: >- TEST: I can create a profile without changing the ethtool features. debug: @@ -136,7 +141,8 @@ TEST: Change feature with both underscores and dashes. debug: msg: "##################################################" - - network_connections: + - name: Configure ethtool features setting + network_connections: provider: "{{ network_provider | mandatory }}" connections: - name: "{{ interface }}" @@ -155,12 +161,15 @@ - name: Show network_connections result debug: var: __network_connections_result - - assert: + - name: Assert the duplicate key "tx_tcp_segmentation" + configuration error happened + assert: that: - '{{ "fatal error: configuration error: connections[0].ethtool.features: duplicate key ''tx_tcp_segmentation''" in __network_connections_result.msg }}' + always: - name: Check failure debug: @@ -196,7 +205,8 @@ when: network_provider == 'nm' always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - name: Import network role @@ -208,6 +218,7 @@ persistent_state: absent state: down failed_when: false - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/playbooks/tests_ethtool_ring.yml b/tests/playbooks/tests_ethtool_ring.yml index cdeb655..3ed5692 100644 --- a/tests/playbooks/tests_ethtool_ring.yml +++ b/tests/playbooks/tests_ethtool_ring.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing ethtool ring settings + hosts: all vars: interface: testnic1 type: veth @@ -14,17 +15,21 @@ - name: "INIT: Ethtool ring tests" debug: msg: "##################################################" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Install ethtool (test dependency) package: name: ethtool state: present - - block: + - name: Test ethtool ring settings + block: - name: >- TEST: I can create a profile without any ring option. debug: @@ -192,7 +197,8 @@ - network_provider == "initscripts" always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - name: Import network role @@ -203,6 +209,7 @@ - name: "{{ interface }}" persistent_state: absent failed_when: false - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/playbooks/tests_infiniband.yml b/tests/playbooks/tests_infiniband.yml index e3c9d6a..9fc7a74 100644 --- a/tests/playbooks/tests_infiniband.yml +++ b/tests/playbooks/tests_infiniband.yml @@ -1,10 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing infiniband device + hosts: all tags: - "tests::infiniband" tasks: - - block: + - name: Test infiniband device + block: - name: TEST Configuring infiniband devices debug: msg: "##################################################" @@ -64,7 +66,8 @@ changed_when: false always: - - tags: + - name: Clean up the test devices and the connection profiles + tags: - "tests::cleanup" block: - name: Import network role @@ -79,6 +82,7 @@ persistent_state: absent state: down failed_when: false - - command: ip link del ib0.000a + - name: Delete the device 'ib0.000a' + command: ip link del ib0.000a failed_when: false changed_when: false diff --git a/tests/playbooks/tests_ipv6.yml b/tests/playbooks/tests_ipv6.yml index ff86c7a..d174469 100644 --- a/tests/playbooks/tests_ipv6.yml +++ b/tests/playbooks/tests_ipv6.yml @@ -1,12 +1,15 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing IPv6 config + hosts: all vars: type: veth interface: veth0 tasks: - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - name: Set up gateway ip on veth peer @@ -19,7 +22,8 @@ # netns not available on RHEL/CentOS 6 - ansible_distribution_major_version != '6' changed_when: false - - block: + - name: Test IPv6 config + block: - name: >- TEST: I can configure an interface with static ipv6 config debug: @@ -40,8 +44,10 @@ - "2001:db8::3/32" - "2001:db8::4/32" gateway6: "2001:db8::1" - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ interface }}" - name: Get ip address information @@ -91,7 +97,8 @@ persistent_state: absent state: down ignore_errors: true # noqa ignore-errors - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent - name: Clean up namespace diff --git a/tests/playbooks/tests_ipv6_disabled.yml b/tests/playbooks/tests_ipv6_disabled.yml index fde14bd..0a9c874 100644 --- a/tests/playbooks/tests_ipv6_disabled.yml +++ b/tests/playbooks/tests_ipv6_disabled.yml @@ -1,8 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all - -- name: Test configuring ethernet devices +- name: Play for testing ipv6 disabled hosts: all vars: type: veth @@ -13,11 +11,14 @@ set_fact: type: "{{ type }}" interface: "{{ interface }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Initialize the connection_failed flag set_fact: @@ -70,21 +71,26 @@ connection_failed: true when: __network_connections_result.failed -- import_playbook: down_profile.yml +- name: Import the playbook 'down_profile.yml' + import_playbook: down_profile.yml vars: profile: "{{ interface }}" when: not connection_failed # FIXME: assert profile/device down -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" - name: Delete the interface, then assert that device and profile are absent hosts: all tasks: - - include_tasks: tasks/delete_interface.yml - - include_tasks: tasks/assert_profile_absent.yml + - name: Include the task 'delete_interface.yml' + include_tasks: tasks/delete_interface.yml + - name: Include the task 'assert_profile_absent.yml' + include_tasks: tasks/assert_profile_absent.yml vars: profile: "{{ interface }}" - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml ... diff --git a/tests/playbooks/tests_ipv6_dns_search.yml b/tests/playbooks/tests_ipv6_dns_search.yml index a562449..cabd9c6 100644 --- a/tests/playbooks/tests_ipv6_dns_search.yml +++ b/tests/playbooks/tests_ipv6_dns_search.yml @@ -1,7 +1,9 @@ --- -- hosts: all +- name: Play for testing DNS search setting + hosts: all tasks: - - block: + - name: Test DNS search setting + block: - name: Configure the static IPv4 address and not configure the IPv6 address import_role: @@ -146,10 +148,12 @@ when: ansible_distribution_major_version | int > 7 always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - - import_role: + - name: Deactivate the connection and remove the connection profile + import_role: name: linux-system-roles.network vars: network_connections: diff --git a/tests/playbooks/tests_network_state.yml b/tests/playbooks/tests_network_state.yml index 0672505..c8666dc 100644 --- a/tests/playbooks/tests_network_state.yml +++ b/tests/playbooks/tests_network_state.yml @@ -1,8 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all - -- name: Test configuring ethernet devices +- name: Play for configuring network using network state variable hosts: all vars: type: veth @@ -15,20 +13,26 @@ set_fact: type: "{{ type }}" interface: "{{ interface0 }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: "Set type={{ type }} and interface={{ interface1 }}" # noqa name set_fact: type: "{{ type }}" interface: "{{ interface1 }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Configure the IP addresses @@ -207,12 +211,16 @@ delay: 2 changed_when: false - - include_tasks: tasks/delete_interface.yml - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'delete_interface.yml' + include_tasks: tasks/delete_interface.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml - name: "Set interface={{ interface0 }}" set_fact: type: "{{ type }}" interface: "{{ interface0 }}" - - include_tasks: tasks/delete_interface.yml - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'delete_interface.yml' + include_tasks: tasks/delete_interface.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml ... diff --git a/tests/playbooks/tests_provider.yml b/tests/playbooks/tests_provider.yml index 22b1c00..1875aa6 100644 --- a/tests/playbooks/tests_provider.yml +++ b/tests/playbooks/tests_provider.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing provider + hosts: all vars: interface: testnic1 profile: "{{ interface }}" @@ -14,10 +15,13 @@ - always - - tags: + - name: Test managing a veth interface with NM provider after managing it + with initscripts provider + tags: - tests::provider:initscripts_to_nm block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: state: present lsr_description: I can manage a veth interface with NM after I diff --git a/tests/playbooks/tests_reapply.yml b/tests/playbooks/tests_reapply.yml index f9655e5..453391e 100644 --- a/tests/playbooks/tests_reapply.yml +++ b/tests/playbooks/tests_reapply.yml @@ -4,7 +4,8 @@ # of via Ansible. Until there is better test support for this, just check the # log output for the respective log message. --- -- hosts: all +- name: Play for testing reapplying the connection + hosts: all vars: interface: rpltstbr profile: "{{ interface }}" @@ -13,12 +14,15 @@ - name: Show test banner debug: msg: Inside states tests - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml roles: - linux-system-roles.network tasks: - - block: + - name: Test reapply the connection + block: # create test profile - name: Include network role include_role: @@ -31,8 +35,10 @@ ip: dhcp4: false auto6: false - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml # Use internal module to get output - name: Get network_connections output network_connections: @@ -57,16 +63,19 @@ fail_msg: Reapply not found in log output that: "{{ 'connection reapplied' in test_module_run.stderr }}" always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" ignore_errors: true # noqa ignore-errors block: # Use internal module directly for speedup - - network_connections: + - name: Deactivate the connection and remove the connection profile + network_connections: provider: nm connections: - name: "{{ interface }}" persistent_state: absent state: down - - command: ip link del "{{ interface }}" + - name: Delete the device '{{ interface }}' + command: ip link del "{{ interface }}" changed_when: false diff --git a/tests/playbooks/tests_route_table.yml b/tests/playbooks/tests_route_table.yml index 5f2edfc..ab6f10f 100644 --- a/tests/playbooks/tests_route_table.yml +++ b/tests/playbooks/tests_route_table.yml @@ -1,8 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all - -- name: Test configuring ethernet devices +- name: Play for testing route table hosts: all vars: type: veth @@ -14,11 +12,14 @@ set_fact: type: "{{ type }}" interface: "{{ interface }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Configure connection profile and specify the numeric table in static routes @@ -133,18 +134,22 @@ state: absent path: /etc/iproute2/rt_tables.d/table.conf -- import_playbook: down_profile+delete_interface.yml +- name: Import the playbook 'down_profile+delete_interface.yml' + import_playbook: down_profile+delete_interface.yml vars: profile: "{{ interface }}" # FIXME: assert profile/device down -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" - name: Assert device and profile are absent hosts: all tasks: - - include_tasks: tasks/assert_profile_absent.yml + - name: Include the task 'assert_profile_absent.yml' + include_tasks: tasks/assert_profile_absent.yml vars: profile: "{{ interface }}" - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml ... diff --git a/tests/playbooks/tests_routing_rules.yml b/tests/playbooks/tests_routing_rules.yml index b78ce3a..5d248f7 100644 --- a/tests/playbooks/tests_routing_rules.yml +++ b/tests/playbooks/tests_routing_rules.yml @@ -1,8 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all - -- name: Test configuring ethernet devices +- name: Test for testing routing rules hosts: all vars: type: veth @@ -13,11 +11,14 @@ set_fact: type: "{{ type }}" interface: "{{ interface }}" - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Create a dedicated test file in `/etc/iproute2/rt_tables.d/` and add a new routing table @@ -242,18 +243,22 @@ state: absent path: /etc/iproute2/rt_tables.d/table.conf -- import_playbook: down_profile+delete_interface.yml +- name: Import the playbook 'down_profile+delete_interface.yml' + import_playbook: down_profile+delete_interface.yml vars: profile: "{{ interface }}" # FIXME: assert profile/device down -- import_playbook: remove_profile.yml +- name: Import the playbook 'remove_profile.yml' + import_playbook: remove_profile.yml vars: profile: "{{ interface }}" - name: Assert device and profile are absent hosts: all tasks: - - include_tasks: tasks/assert_profile_absent.yml + - name: Include the task 'assert_profile_absent.yml' + include_tasks: tasks/assert_profile_absent.yml vars: profile: "{{ interface }}" - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml ... diff --git a/tests/playbooks/tests_states.yml b/tests/playbooks/tests_states.yml index 3f7593f..8cf9def 100644 --- a/tests/playbooks/tests_states.yml +++ b/tests/playbooks/tests_states.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing states + hosts: all vars: interface: statebr profile: "{{ interface }}" @@ -14,10 +15,12 @@ - always - - tags: + - name: Test creating the bridge connection + tags: - tests::states:create block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: I can create a profile lsr_setup: @@ -35,10 +38,12 @@ lsr_cleanup: - tasks/cleanup_profile+device.yml - - tags: + - name: Test creating the bridge connection without autoconnect + tags: - tests::states:create_without_autoconnect block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: I can create a profile without autoconnect lsr_setup: @@ -53,10 +58,12 @@ lsr_cleanup: - tasks/cleanup_profile+device.yml - - tags: + - name: Test activating the bridge connection + tags: - tests::states:activate block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: I can activate an existing profile lsr_setup: @@ -69,10 +76,12 @@ lsr_cleanup: - tasks/cleanup_profile+device.yml - - tags: + - name: Test removing the bridge connection profile without taking it down + tags: - tests::states:remove_up block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: I can remove an existing profile without taking it down @@ -87,10 +96,12 @@ lsr_cleanup: - tasks/cleanup_profile+device.yml - - tags: + - name: Test removing the bridge connection profile and taking it down + tags: - tests::states:remove_down block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: I can take a profile down that is absent lsr_setup: @@ -107,10 +118,13 @@ lsr_cleanup: - tasks/cleanup_profile+device.yml - - tags: + - name: Test removing the bridge connection profile and taking it down + twice + tags: - tests::states:remove_down_twice block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: I will not get an error when I try to remove an absent profile diff --git a/tests/playbooks/tests_switch_provider.yml b/tests/playbooks/tests_switch_provider.yml index b3247ca..67cbda4 100644 --- a/tests/playbooks/tests_switch_provider.yml +++ b/tests/playbooks/tests_switch_provider.yml @@ -23,12 +23,15 @@ ip: dhcp4: false auto6: false - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/remove+down_profile.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'remove+down_profile.yml' + include_tasks: tasks/remove+down_profile.yml vars: profile: "{{ interface }}" # The initscripts should not remove the interface for down/absent - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: Set fact to use nm network_provider set_fact: network_provider: nm @@ -45,11 +48,16 @@ ip: dhcp4: false auto6: false - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/remove+down_profile.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'remove+down_profile.yml' + include_tasks: tasks/remove+down_profile.yml vars: profile: "{{ interface }}" # NetworkManager should not remove pre-exist interface for down/absent - - include_tasks: tasks/assert_device_present.yml - - include_tasks: tasks/delete_interface.yml - - include_tasks: tasks/assert_device_absent.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Include the task 'delete_interface.yml' + include_tasks: tasks/delete_interface.yml + - name: Include the task 'assert_device_absent.yml' + include_tasks: tasks/assert_device_absent.yml diff --git a/tests/playbooks/tests_team.yml b/tests/playbooks/tests_team.yml index 38042d4..ba8db32 100644 --- a/tests/playbooks/tests_team.yml +++ b/tests/playbooks/tests_team.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing team connection + hosts: all vars: interface: team0 profile: "{{ interface }}" @@ -13,10 +14,12 @@ tags: - always - - tags: + - name: Test the team connection + tags: - tests::team:create block: - - include_tasks: tasks/run_test.yml + - name: Include the task 'run_test.yml' + include_tasks: tasks/run_test.yml vars: lsr_description: Create a team interface without any port attached lsr_setup: diff --git a/tests/playbooks/tests_team_plugin_installation.yml b/tests/playbooks/tests_team_plugin_installation.yml index 4763810..29598ed 100644 --- a/tests/playbooks/tests_team_plugin_installation.yml +++ b/tests/playbooks/tests_team_plugin_installation.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing team plugin installation + hosts: all tasks: - name: Remove the NetworkManager-team package package: diff --git a/tests/playbooks/tests_vlan_mtu.yml b/tests/playbooks/tests_vlan_mtu.yml index 2eabd9f..b7d7bb7 100644 --- a/tests/playbooks/tests_vlan_mtu.yml +++ b/tests/playbooks/tests_vlan_mtu.yml @@ -1,16 +1,20 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing vlan mtu setting + hosts: all vars: type: veth interface: lsr101 vlan_interface: lsr101.90 tasks: - - include_tasks: tasks/show_interfaces.yml - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml - name: >- TEST: I can configure the MTU for a vlan interface without autoconnect. debug: @@ -39,10 +43,12 @@ ip: dhcp4: false auto6: false - - include_tasks: tasks/assert_device_present.yml + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml vars: interface: "{{ vlan_interface }}" - - include_tasks: tasks/assert_profile_present.yml + - name: Include the task 'assert_profile_present.yml' + include_tasks: tasks/assert_profile_present.yml vars: profile: "{{ item }}" loop: @@ -64,6 +70,7 @@ persistent_state: absent state: down ignore_errors: true # noqa ignore-errors - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/playbooks/tests_wireless.yml b/tests/playbooks/tests_wireless.yml index 4354b3d..f5f444d 100644 --- a/tests/playbooks/tests_wireless.yml +++ b/tests/playbooks/tests_wireless.yml @@ -1,13 +1,15 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing wireless connection + hosts: all vars: interface: wlan0 tasks: - name: "INIT: wireless tests" debug: msg: "##################################################" - - include_tasks: tasks/setup_mock_wifi.yml + - name: Include the task 'setup_mock_wifi.yml' + include_tasks: tasks/setup_mock_wifi.yml - name: Copy client certs copy: src: "{{ item }}" @@ -17,7 +19,8 @@ - client.key - client.pem - cacert.pem - - block: + - name: Test wireless connection with WPA-PSK + block: - name: "TEST: wireless connection with WPA-PSK" debug: msg: "##################################################" @@ -77,7 +80,8 @@ client_cert: /etc/pki/tls/client.pem ca_cert: /etc/pki/tls/cacert.pem always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - name: Import network role @@ -89,4 +93,5 @@ persistent_state: absent state: down failed_when: false - - include_tasks: tasks/cleanup_mock_wifi.yml + - name: Include the task 'cleanup_mock_wifi.yml' + include_tasks: tasks/cleanup_mock_wifi.yml diff --git a/tests/playbooks/tests_wireless_plugin_installation.yml b/tests/playbooks/tests_wireless_plugin_installation.yml index 4677e6b..500c619 100644 --- a/tests/playbooks/tests_wireless_plugin_installation.yml +++ b/tests/playbooks/tests_wireless_plugin_installation.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing wireless plugin installation + hosts: all tasks: - name: Remove the NetworkManager-wifi package package: diff --git a/tests/playbooks/tests_wireless_wpa3_owe.yml b/tests/playbooks/tests_wireless_wpa3_owe.yml index 399195e..366c953 100644 --- a/tests/playbooks/tests_wireless_wpa3_owe.yml +++ b/tests/playbooks/tests_wireless_wpa3_owe.yml @@ -1,14 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing wireless connection + hosts: all vars: interface: wlan0 tasks: - name: "INIT: wireless tests" debug: msg: "##################################################" - - include_tasks: tasks/setup_mock_wifi_wpa3_owe.yml - - block: + - name: Include the task 'setup_mock_wifi_wpa3_owe.yml' + include_tasks: tasks/setup_mock_wifi_wpa3_owe.yml + - name: Test wireless connection with OWE + block: - name: "TEST: wireless connection with OWE" debug: msg: "##################################################" diff --git a/tests/playbooks/tests_wireless_wpa3_sae.yml b/tests/playbooks/tests_wireless_wpa3_sae.yml index 24435e9..90b8482 100644 --- a/tests/playbooks/tests_wireless_wpa3_sae.yml +++ b/tests/playbooks/tests_wireless_wpa3_sae.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- hosts: all +- name: Play for testing wireless connection + hosts: all vars: interface: wlan0 tasks: diff --git a/tests/setup-snapshot.yml b/tests/setup-snapshot.yml index 8302f62..736bc65 100644 --- a/tests/setup-snapshot.yml +++ b/tests/setup-snapshot.yml @@ -1,4 +1,5 @@ -- hosts: all +- name: Play for setting up snapshots + hosts: all tasks: - name: Set facts used by role include_role: diff --git a/tests/tasks/assert_device_absent.yml b/tests/tasks/assert_device_absent.yml index 741d796..ce4634f 100644 --- a/tests/tasks/assert_device_absent.yml +++ b/tests/tasks/assert_device_absent.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: get_interface_stat.yml +- name: Include the task 'get_interface_stat.yml' + include_tasks: get_interface_stat.yml - name: "Assert that the interface is absent - '{{ interface }}'" assert: that: not interface_stat.stat.exists diff --git a/tests/tasks/assert_device_present.yml b/tests/tasks/assert_device_present.yml index d1e9e2a..8a2f47c 100644 --- a/tests/tasks/assert_device_present.yml +++ b/tests/tasks/assert_device_present.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: get_interface_stat.yml +- name: Include the task 'get_interface_stat.yml' + include_tasks: get_interface_stat.yml - name: "Assert that the interface is present - '{{ interface }}'" assert: that: interface_stat.stat.exists diff --git a/tests/tasks/assert_profile_absent.yml b/tests/tasks/assert_profile_absent.yml index 2b9d6bd..ca02b69 100644 --- a/tests/tasks/assert_profile_absent.yml +++ b/tests/tasks/assert_profile_absent.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: get_profile_stat.yml +- name: Include the task 'get_profile_stat.yml' + include_tasks: get_profile_stat.yml - name: "Assert that the profile is absent - '{{ profile }}'" assert: that: not lsr_net_profile_exists diff --git a/tests/tasks/assert_profile_present.yml b/tests/tasks/assert_profile_present.yml index 7c08405..4cb2242 100644 --- a/tests/tasks/assert_profile_present.yml +++ b/tests/tasks/assert_profile_present.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: get_profile_stat.yml +- name: Include the task 'get_profile_stat.yml' + include_tasks: get_profile_stat.yml - name: "Assert that the profile is present - '{{ profile }}'" assert: that: lsr_net_profile_exists diff --git a/tests/tasks/create_and_remove_interface.yml b/tests/tasks/create_and_remove_interface.yml index 7ed96d4..e158739 100644 --- a/tests/tasks/create_and_remove_interface.yml +++ b/tests/tasks/create_and_remove_interface.yml @@ -1,20 +1,30 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: show_interfaces.yml -- include_tasks: manage_test_interface.yml +- name: Include the task 'show_interfaces.yml' + include_tasks: show_interfaces.yml +- name: Include the task 'manage_test_interface.yml' + include_tasks: manage_test_interface.yml vars: state: absent -- include_tasks: show_interfaces.yml -- include_tasks: assert_device_absent.yml +- name: Include the task 'show_interfaces.yml' + include_tasks: show_interfaces.yml +- name: Include the task 'assert_device_absent.yml' + include_tasks: assert_device_absent.yml -- include_tasks: manage_test_interface.yml +- name: Include the task 'manage_test_interface.yml' + include_tasks: manage_test_interface.yml vars: state: present -- include_tasks: show_interfaces.yml -- include_tasks: assert_device_present.yml +- name: Include the task 'show_interfaces.yml' + include_tasks: show_interfaces.yml +- name: Include the task 'assert_device_present.yml' + include_tasks: assert_device_present.yml -- include_tasks: manage_test_interface.yml +- name: Include the task 'manage_test_interface.yml' + include_tasks: manage_test_interface.yml vars: state: absent -- include_tasks: show_interfaces.yml -- include_tasks: assert_device_absent.yml +- name: Include the task 'show_interfaces.yml' + include_tasks: show_interfaces.yml +- name: Include the task 'assert_device_absent.yml' + include_tasks: assert_device_absent.yml diff --git a/tests/tasks/el_repo_setup.yml b/tests/tasks/el_repo_setup.yml index 162e488..2a670bd 100644 --- a/tests/tasks/el_repo_setup.yml +++ b/tests/tasks/el_repo_setup.yml @@ -37,4 +37,5 @@ when: - ansible_distribution == 'CentOS' - ansible_distribution_major_version == '6' -- include_tasks: enable_epel.yml +- name: Include the task 'enable_epel.yml' + include_tasks: enable_epel.yml diff --git a/tests/tasks/enable_epel.yml b/tests/tasks/enable_epel.yml index e5968b0..f46701c 100644 --- a/tests/tasks/enable_epel.yml +++ b/tests/tasks/enable_epel.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- when: +- name: Create EPEL yum repo and Enable EPEL + when: - ansible_distribution in ['RedHat', 'CentOS'] - ansible_distribution_major_version in ['7', '8'] block: diff --git a/tests/tasks/get_NetworkManager_NVR.yml b/tests/tasks/get_NetworkManager_NVR.yml index 9aaae78..2e31869 100644 --- a/tests/tasks/get_NetworkManager_NVR.yml +++ b/tests/tasks/get_NetworkManager_NVR.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- tags: +- name: Get NetworkManager version + tags: - always block: - name: Get NetworkManager RPM version diff --git a/tests/tasks/manage_test_interface.yml b/tests/tasks/manage_test_interface.yml index b0bc7e7..56b4181 100644 --- a/tests/tasks/manage_test_interface.yml +++ b/tests/tasks/manage_test_interface.yml @@ -10,7 +10,8 @@ msg: "type needs to be dummy, tap or veth, not '{{ type }}'" when: type not in ["dummy", "tap", "veth"] -- include_tasks: show_interfaces.yml +- name: Include the task 'show_interfaces.yml' + include_tasks: show_interfaces.yml - name: Install iproute package: diff --git a/tests/tasks/run_test.yml b/tests/tasks/run_test.yml index 16c373d..61b669b 100644 --- a/tests/tasks/run_test.yml +++ b/tests/tasks/run_test.yml @@ -18,7 +18,8 @@ - lsr_fail_debug - lsr_cleanup - - include_tasks: tasks/show_interfaces.yml + - name: Include the task 'show_interfaces.yml' + include_tasks: tasks/show_interfaces.yml - name: Setup include_tasks: "{{ item }}" diff --git a/tests/tasks/setup_802.1x.yml b/tests/tasks/setup_802.1x.yml index e9a5922..7f47fb5 100644 --- a/tests/tasks/setup_802.1x.yml +++ b/tests/tasks/setup_802.1x.yml @@ -1,4 +1,5 @@ -- include_tasks: tasks/setup_802_1x_server.yml +- name: Include the task 'setup_802_1x_server.yml' + include_tasks: tasks/setup_802_1x_server.yml - name: Copy client certs copy: src: "{{ item }}" diff --git a/tests/tasks/setup_mock_wifi_wpa3_owe.yml b/tests/tasks/setup_mock_wifi_wpa3_owe.yml index 798b7fe..3ab31ef 100644 --- a/tests/tasks/setup_mock_wifi_wpa3_owe.yml +++ b/tests/tasks/setup_mock_wifi_wpa3_owe.yml @@ -57,4 +57,5 @@ dest: /etc/hostapd/wireless.conf mode: "0644" -- include_tasks: tasks/start_mock_wifi.yml +- name: Include the task 'start_mock_wifi.yml' + include_tasks: tasks/start_mock_wifi.yml diff --git a/tests/tasks/setup_mock_wifi_wpa3_sae.yml b/tests/tasks/setup_mock_wifi_wpa3_sae.yml index 45ce717..82ba6fd 100644 --- a/tests/tasks/setup_mock_wifi_wpa3_sae.yml +++ b/tests/tasks/setup_mock_wifi_wpa3_sae.yml @@ -59,4 +59,5 @@ dest: /etc/hostapd/wireless.conf mode: "0644" -- include_tasks: tasks/start_mock_wifi.yml +- name: Include the task 'start_mock_wifi.yml' + include_tasks: tasks/start_mock_wifi.yml diff --git a/tests/tasks/setup_test_interface.yml b/tests/tasks/setup_test_interface.yml index fb767f3..af3a8d0 100644 --- a/tests/tasks/setup_test_interface.yml +++ b/tests/tasks/setup_test_interface.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: tasks/manage_test_interface.yml +- name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present type: veth diff --git a/tests/tasks/show_interfaces.yml b/tests/tasks/show_interfaces.yml index 5e931ab..4287498 100644 --- a/tests/tasks/show_interfaces.yml +++ b/tests/tasks/show_interfaces.yml @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause --- -- include_tasks: get_current_interfaces.yml +- name: Include the task 'get_current_interfaces.yml' + include_tasks: get_current_interfaces.yml - name: Show current_interfaces debug: msg: "current_interfaces: {{ current_interfaces }}" diff --git a/tests/tasks/test_802.1x_capath.yml b/tests/tasks/test_802.1x_capath.yml index 8dcdaad..8ed2a81 100644 --- a/tests/tasks/test_802.1x_capath.yml +++ b/tests/tasks/test_802.1x_capath.yml @@ -49,7 +49,8 @@ # noqa command-instead-of-module register: __network_nm_nvr changed_when: false -- block: +- name: Test configuring 802.1x authentication + block: - name: Import network role import_role: name: linux-system-roles.network diff --git a/tests/tests_802_1x_nm.yml b/tests/tests_802_1x_nm.yml index e75f528..f2c9204 100644 --- a/tests/tests_802_1x_nm.yml +++ b/tests/tests_802_1x_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_802_1x.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,7 +16,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_802_1x.yml +- name: Import the playbook 'playbooks/tests_802_1x.yml' + import_playbook: playbooks/tests_802_1x.yml when: - ansible_distribution_major_version != '6' - ansible_distribution != 'RedHat' or diff --git a/tests/tests_802_1x_updated_nm.yml b/tests/tests_802_1x_updated_nm.yml index 89dcaed..4afd572 100644 --- a/tests/tests_802_1x_updated_nm.yml +++ b/tests/tests_802_1x_updated_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_802_1x_updated.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,7 +16,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_802_1x_updated.yml +- name: Import the playbook 'playbooks/tests_802_1x_updated.yml' + import_playbook: playbooks/tests_802_1x_updated.yml when: - ansible_distribution_major_version != '6' - ansible_distribution != 'RedHat' or diff --git a/tests/tests_auto_gateway_initscripts.yml b/tests/tests_auto_gateway_initscripts.yml index e570ba1..d02090a 100644 --- a/tests/tests_auto_gateway_initscripts.yml +++ b/tests/tests_auto_gateway_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_auto_gateway.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_auto_gateway.yml +- name: Import the playbook 'playbooks/tests_auto_gateway.yml' + import_playbook: playbooks/tests_auto_gateway.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_auto_gateway_nm.yml b/tests/tests_auto_gateway_nm.yml index a536255..ed25386 100644 --- a/tests/tests_auto_gateway_nm.yml +++ b/tests/tests_auto_gateway_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_auto_gateway.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_auto_gateway.yml +- name: Import the playbook 'playbooks/tests_auto_gateway.yml' + import_playbook: playbooks/tests_auto_gateway.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bond_cloned_mac_initscripts.yml b/tests/tests_bond_cloned_mac_initscripts.yml index e26593f..1ccde52 100644 --- a/tests/tests_bond_cloned_mac_initscripts.yml +++ b/tests/tests_bond_cloned_mac_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_cloned_mac.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_bond_cloned_mac.yml +- name: Import the playbook 'playbooks/tests_bond_cloned_mac.yml' + import_playbook: playbooks/tests_bond_cloned_mac.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_bond_cloned_mac_nm.yml b/tests/tests_bond_cloned_mac_nm.yml index 8ce6d81..b70fab7 100644 --- a/tests/tests_bond_cloned_mac_nm.yml +++ b/tests/tests_bond_cloned_mac_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_cloned_mac.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bond_cloned_mac.yml +- name: Import the playbook 'playbooks/tests_bond_cloned_mac.yml' + import_playbook: playbooks/tests_bond_cloned_mac.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bond_deprecated_initscripts.yml b/tests/tests_bond_deprecated_initscripts.yml index 8d37534..b51e9a8 100644 --- a/tests/tests_bond_deprecated_initscripts.yml +++ b/tests/tests_bond_deprecated_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_deprecated.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_bond_deprecated.yml +- name: Import the playbook 'playbooks/tests_bond_deprecated.yml' + import_playbook: playbooks/tests_bond_deprecated.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_bond_deprecated_nm.yml b/tests/tests_bond_deprecated_nm.yml index 5f5fd04..b45c624 100644 --- a/tests/tests_bond_deprecated_nm.yml +++ b/tests/tests_bond_deprecated_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_deprecated.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bond_deprecated.yml +- name: Import the playbook 'playbooks/tests_bond_deprecated.yml' + import_playbook: playbooks/tests_bond_deprecated.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bond_initscripts.yml b/tests/tests_bond_initscripts.yml index 833d564..f5bf069 100644 --- a/tests/tests_bond_initscripts.yml +++ b/tests/tests_bond_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_bond.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_bond.yml +- name: Import the playbook 'playbooks/tests_bond.yml' + import_playbook: playbooks/tests_bond.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_bond_nm.yml b/tests/tests_bond_nm.yml index 7075d95..9bb16f7 100644 --- a/tests/tests_bond_nm.yml +++ b/tests/tests_bond_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bond.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bond.yml +- name: Import the playbook 'playbooks/tests_bond.yml' + import_playbook: playbooks/tests_bond.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bond_options_nm.yml b/tests/tests_bond_options_nm.yml index 373d642..e3a0648 100644 --- a/tests/tests_bond_options_nm.yml +++ b/tests/tests_bond_options_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_options.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bond_options.yml +- name: Import the playbook 'playbooks/tests_bond_options.yml' + import_playbook: playbooks/tests_bond_options.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bond_removal_initscripts.yml b/tests/tests_bond_removal_initscripts.yml index 6a50f47..e768cc0 100644 --- a/tests/tests_bond_removal_initscripts.yml +++ b/tests/tests_bond_removal_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_removal.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_bond_removal.yml +- name: Import the playbook 'playbooks/tests_bond_removal.yml' + import_playbook: playbooks/tests_bond_removal.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_bond_removal_nm.yml b/tests/tests_bond_removal_nm.yml index f9842e6..1d96143 100644 --- a/tests/tests_bond_removal_nm.yml +++ b/tests/tests_bond_removal_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bond_removal.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bond_removal.yml +- name: Import the playbook 'playbooks/tests_bond_removal.yml' + import_playbook: playbooks/tests_bond_removal.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bridge_cloned_mac_initscripts.yml b/tests/tests_bridge_cloned_mac_initscripts.yml index 3f69cd3..bb80097 100644 --- a/tests/tests_bridge_cloned_mac_initscripts.yml +++ b/tests/tests_bridge_cloned_mac_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_bridge_cloned_mac.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_bridge_cloned_mac.yml +- name: Import the playbook 'playbooks/tests_bridge_cloned_mac.yml' + import_playbook: playbooks/tests_bridge_cloned_mac.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_bridge_cloned_mac_nm.yml b/tests/tests_bridge_cloned_mac_nm.yml index b570414..6377a74 100644 --- a/tests/tests_bridge_cloned_mac_nm.yml +++ b/tests/tests_bridge_cloned_mac_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bridge_cloned_mac.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bridge_cloned_mac.yml +- name: Import the playbook 'playbooks/tests_bridge_cloned_mac.yml' + import_playbook: playbooks/tests_bridge_cloned_mac.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_bridge_initscripts.yml b/tests/tests_bridge_initscripts.yml index 3f0395a..88e4b28 100644 --- a/tests/tests_bridge_initscripts.yml +++ b/tests/tests_bridge_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_bridge.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_bridge.yml +- name: Import the playbook 'playbooks/tests_bridge.yml' + import_playbook: playbooks/tests_bridge.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_bridge_nm.yml b/tests/tests_bridge_nm.yml index 3d1b53a..744461d 100644 --- a/tests/tests_bridge_nm.yml +++ b/tests/tests_bridge_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_bridge.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_bridge.yml +- name: Import the playbook 'playbooks/tests_bridge.yml' + import_playbook: playbooks/tests_bridge.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_change_indication_on_repeat_run.yml b/tests/tests_change_indication_on_repeat_run.yml index 9660600..c047648 100644 --- a/tests/tests_change_indication_on_repeat_run.yml +++ b/tests/tests_change_indication_on_repeat_run.yml @@ -7,12 +7,16 @@ type: veth name: Test change indication on repeat run tasks: - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: present - - include_tasks: tasks/assert_device_present.yml - - block: - - vars: + - name: Include the task 'assert_device_present.yml' + include_tasks: tasks/assert_device_present.yml + - name: Test change indication on repeat run + block: + - name: Configure the static IPv4 address for ethernet device + vars: network_connections: - name: "{{ interface }}" state: up @@ -21,19 +25,22 @@ address: - 192.0.2.2/24 block: - - include_role: + - name: Include the network role + include_role: name: linux-system-roles.network register: __network_connections_result - name: Assert change:true assert: that: __network_connections_result is changed - - include_role: + - name: Include the network role + include_role: name: linux-system-roles.network register: __network_connections_result - name: Assert change:false assert: that: not __network_connections_result is changed - - vars: + - name: Configure the ethernet device without enabling the IPv4 and IPv6 + vars: network_connections: - name: "{{ interface }}" state: up @@ -42,23 +49,27 @@ dhcp4: "no" auto6: "no" block: - - include_role: + - name: Include the network role + include_role: name: linux-system-roles.network register: __network_connections_result - name: Assert change:true assert: that: __network_connections_result is changed - - include_role: + - name: Include the network role + include_role: name: linux-system-roles.network register: __network_connections_result - name: Assert change:false assert: that: not __network_connections_result is changed always: - - tags: + - name: Clean up the test device and the connection profile + tags: - "tests::cleanup" block: - - include_role: + - name: Include the network role + include_role: name: linux-system-roles.network vars: network_connections: @@ -66,6 +77,7 @@ persistent_state: absent state: down ignore_errors: true # noqa ignore-errors - - include_tasks: tasks/manage_test_interface.yml + - name: Include the task 'manage_test_interface.yml' + include_tasks: tasks/manage_test_interface.yml vars: state: absent diff --git a/tests/tests_default.yml b/tests/tests_default.yml index 534c634..d722c24 100644 --- a/tests/tests_default.yml +++ b/tests/tests_default.yml @@ -6,7 +6,8 @@ roles: - linux-system-roles.network tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Test warning and info logs assert: that: diff --git a/tests/tests_default_initscripts.yml b/tests/tests_default_initscripts.yml index 9a51287..aee70a6 100644 --- a/tests/tests_default_initscripts.yml +++ b/tests/tests_default_initscripts.yml @@ -1,12 +1,15 @@ # SPDX-License-Identifier: BSD-3-Clause --- - hosts: all + name: Run playbook 'tests_default.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts -- import_playbook: tests_default.yml +- name: Import the playbook 'tests_default.yml' + import_playbook: tests_default.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_default_nm.yml b/tests/tests_default_nm.yml index 54bc3e1..22f4150 100644 --- a/tests/tests_default_nm.yml +++ b/tests/tests_default_nm.yml @@ -1,14 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause --- - hosts: all + name: Run playbook 'tests_default.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm # The test should run with NetworkManager, therefore it cannot run on # RHEL/CentOS 6 -- import_playbook: tests_default.yml +- name: Import the playbook 'tests_default.yml' + import_playbook: tests_default.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_dummy_nm.yml b/tests/tests_dummy_nm.yml index 2c6d6a1..c3624b8 100644 --- a/tests/tests_dummy_nm.yml +++ b/tests/tests_dummy_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_dummy.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_dummy.yml +- name: Import the playbook 'playbooks/tests_dummy.yml' + import_playbook: playbooks/tests_dummy.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_eth_dns_support_nm.yml b/tests/tests_eth_dns_support_nm.yml index c982631..c0e5fae 100644 --- a/tests/tests_eth_dns_support_nm.yml +++ b/tests/tests_eth_dns_support_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_eth_dns_support.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_eth_dns_support.yml +- name: Import the playbook 'playbooks/tests_eth_dns_support.yml' + import_playbook: playbooks/tests_eth_dns_support.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_eth_pci_address_match_nm.yml b/tests/tests_eth_pci_address_match_nm.yml index 660d8e4..52f68d7 100644 --- a/tests/tests_eth_pci_address_match_nm.yml +++ b/tests/tests_eth_pci_address_match_nm.yml @@ -5,14 +5,16 @@ - hosts: all name: Run playbook 'playbooks/tests_eth_pci_address_match.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm tags: - always - - when: + - name: Install NetworkManager and get NetworkManager version + when: - ansible_distribution_major_version != '6' tags: - always @@ -37,7 +39,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # NetworkManager 1.26.0 added support for match.path setting -- import_playbook: playbooks/tests_eth_pci_address_match.yml +- name: Import the playbook 'playbooks/tests_eth_pci_address_match.yml' + import_playbook: playbooks/tests_eth_pci_address_match.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_ethernet_initscripts.yml b/tests/tests_ethernet_initscripts.yml index cd3cff1..d3b2078 100644 --- a/tests/tests_ethernet_initscripts.yml +++ b/tests/tests_ethernet_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_ethernet.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_ethernet.yml +- name: Import the playbook 'playbooks/tests_ethernet.yml' + import_playbook: playbooks/tests_ethernet.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_ethernet_nm.yml b/tests/tests_ethernet_nm.yml index 483e05a..478cf7f 100644 --- a/tests/tests_ethernet_nm.yml +++ b/tests/tests_ethernet_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_ethernet.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_ethernet.yml +- name: Import the playbook 'playbooks/tests_ethernet.yml' + import_playbook: playbooks/tests_ethernet.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_ethtool_coalesce_initscripts.yml b/tests/tests_ethtool_coalesce_initscripts.yml index 98b1eb4..30a7a99 100644 --- a/tests/tests_ethtool_coalesce_initscripts.yml +++ b/tests/tests_ethtool_coalesce_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_ethtool_coalesce.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_ethtool_coalesce.yml +- name: Import the playbook 'playbooks/tests_ethtool_coalesce.yml' + import_playbook: playbooks/tests_ethtool_coalesce.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_ethtool_coalesce_nm.yml b/tests/tests_ethtool_coalesce_nm.yml index a1a1905..230a348 100644 --- a/tests/tests_ethtool_coalesce_nm.yml +++ b/tests/tests_ethtool_coalesce_nm.yml @@ -5,14 +5,16 @@ - hosts: all name: Run playbook 'playbooks/tests_ethtool_coalesce.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm tags: - always - - when: + - name: Install NetworkManager and get NetworkManager version + when: - ansible_distribution_major_version != '6' tags: - always @@ -37,7 +39,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # NetworkManager 1.25.1 introduced ethtool coalesce support -- import_playbook: playbooks/tests_ethtool_coalesce.yml +- name: Import the playbook 'playbooks/tests_ethtool_coalesce.yml' + import_playbook: playbooks/tests_ethtool_coalesce.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_ethtool_features_initscripts.yml b/tests/tests_ethtool_features_initscripts.yml index 89c3e15..d8c9684 100644 --- a/tests/tests_ethtool_features_initscripts.yml +++ b/tests/tests_ethtool_features_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_ethtool_features.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_ethtool_features.yml +- name: Import the playbook 'playbooks/tests_ethtool_features.yml' + import_playbook: playbooks/tests_ethtool_features.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_ethtool_features_nm.yml b/tests/tests_ethtool_features_nm.yml index 5f2e879..cf70131 100644 --- a/tests/tests_ethtool_features_nm.yml +++ b/tests/tests_ethtool_features_nm.yml @@ -5,14 +5,16 @@ - hosts: all name: Run playbook 'playbooks/tests_ethtool_features.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm tags: - always - - when: + - name: Install NetworkManager and get NetworkManager version + when: - ansible_distribution_major_version != '6' tags: - always @@ -37,7 +39,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # NetworkManager 1.20.0 introduced ethtool settings support -- import_playbook: playbooks/tests_ethtool_features.yml +- name: Import the playbook 'playbooks/tests_ethtool_features.yml' + import_playbook: playbooks/tests_ethtool_features.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_ethtool_ring_initscripts.yml b/tests/tests_ethtool_ring_initscripts.yml index 0fe0164..3479143 100644 --- a/tests/tests_ethtool_ring_initscripts.yml +++ b/tests/tests_ethtool_ring_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_ethtool_ring.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_ethtool_ring.yml +- name: Import the playbook 'playbooks/tests_ethtool_ring.yml' + import_playbook: playbooks/tests_ethtool_ring.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_ethtool_ring_nm.yml b/tests/tests_ethtool_ring_nm.yml index 2102819..bf0c397 100644 --- a/tests/tests_ethtool_ring_nm.yml +++ b/tests/tests_ethtool_ring_nm.yml @@ -5,14 +5,16 @@ - hosts: all name: Run playbook 'playbooks/tests_ethtool_ring.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm tags: - always - - when: + - name: Install NetworkManager and get NetworkManager version + when: - ansible_distribution_major_version != '6' tags: - always @@ -37,7 +39,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # NetworkManager 1.25.2 introduced ethtool ring support -- import_playbook: playbooks/tests_ethtool_ring.yml +- name: Import the playbook 'playbooks/tests_ethtool_ring.yml' + import_playbook: playbooks/tests_ethtool_ring.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_helpers_and_asserts.yml b/tests/tests_helpers_and_asserts.yml index 5522b9b..4d8aed6 100644 --- a/tests/tests_helpers_and_asserts.yml +++ b/tests/tests_helpers_and_asserts.yml @@ -3,7 +3,8 @@ - name: Check that creating and removing test devices and assertions work hosts: all tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Test veth interface management include_tasks: tasks/create_and_remove_interface.yml diff --git a/tests/tests_infiniband_nm.yml b/tests/tests_infiniband_nm.yml index b99b72d..cc5317f 100644 --- a/tests/tests_infiniband_nm.yml +++ b/tests/tests_infiniband_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_infiniband.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_infiniband.yml +- name: Import the playbook 'playbooks/tests_infiniband.yml' + import_playbook: playbooks/tests_infiniband.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_integration_pytest.yml b/tests/tests_integration_pytest.yml index 9b80bd4..c07465e 100644 --- a/tests/tests_integration_pytest.yml +++ b/tests/tests_integration_pytest.yml @@ -1,10 +1,13 @@ # SPDX-License-Identifier: BSD-3-Clause --- - hosts: all + name: Run playbook 'playbooks/integration_pytest_python3.yml' tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml -- import_playbook: playbooks/integration_pytest_python3.yml +- name: Import the playbook 'playbooks/integration_pytest_python3.yml' + import_playbook: playbooks/integration_pytest_python3.yml when: (ansible_distribution in ["CentOS", "RedHat"] and ansible_distribution_major_version == "8") or ansible_distribution == "Fedora" diff --git a/tests/tests_ipv6_disabled_nm.yml b/tests/tests_ipv6_disabled_nm.yml index dc3febe..bb8452d 100644 --- a/tests/tests_ipv6_disabled_nm.yml +++ b/tests/tests_ipv6_disabled_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_ipv6_disabled.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_ipv6_disabled.yml +- name: Import the playbook 'playbooks/tests_ipv6_disabled.yml' + import_playbook: playbooks/tests_ipv6_disabled.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_ipv6_dns_search_nm.yml b/tests/tests_ipv6_dns_search_nm.yml index 7ba96b1..bc0d1c5 100644 --- a/tests/tests_ipv6_dns_search_nm.yml +++ b/tests/tests_ipv6_dns_search_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_ipv6_dns_search.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_ipv6_dns_search.yml +- name: Import the playbook 'playbooks/tests_ipv6_dns_search.yml' + import_playbook: playbooks/tests_ipv6_dns_search.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_ipv6_initscripts.yml b/tests/tests_ipv6_initscripts.yml index 5e95ee4..a41c043 100644 --- a/tests/tests_ipv6_initscripts.yml +++ b/tests/tests_ipv6_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_ipv6.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_ipv6.yml +- name: Import the playbook 'playbooks/tests_ipv6.yml' + import_playbook: playbooks/tests_ipv6.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_ipv6_nm.yml b/tests/tests_ipv6_nm.yml index c55eb36..3f53734 100644 --- a/tests/tests_ipv6_nm.yml +++ b/tests/tests_ipv6_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_ipv6.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_ipv6.yml +- name: Import the playbook 'playbooks/tests_ipv6.yml' + import_playbook: playbooks/tests_ipv6.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_network_state_nm.yml b/tests/tests_network_state_nm.yml index df6b2c6..47d54dc 100644 --- a/tests/tests_network_state_nm.yml +++ b/tests/tests_network_state_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_network_state.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,7 +16,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_network_state.yml +- name: Import the playbook 'playbooks/tests_network_state.yml' + import_playbook: playbooks/tests_network_state.yml when: - ansible_distribution_major_version != '6' - ansible_distribution_major_version | int > 7 diff --git a/tests/tests_provider_nm.yml b/tests/tests_provider_nm.yml index f90ff50..c5dbe2e 100644 --- a/tests/tests_provider_nm.yml +++ b/tests/tests_provider_nm.yml @@ -5,14 +5,16 @@ - hosts: all name: Run playbook 'playbooks/tests_provider.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm tags: - always - - when: + - name: Install NetworkManager and get NetworkManager version + when: - ansible_distribution_major_version != '6' tags: - always @@ -37,7 +39,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # NetworKmanager 1.20.0 added support for forgetting profiles -- import_playbook: playbooks/tests_provider.yml +- name: Import the playbook 'playbooks/tests_provider.yml' + import_playbook: playbooks/tests_provider.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_reapply_nm.yml b/tests/tests_reapply_nm.yml index dfcbce2..6493f83 100644 --- a/tests/tests_reapply_nm.yml +++ b/tests/tests_reapply_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_reapply.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_reapply.yml +- name: Import the playbook 'playbooks/tests_reapply.yml' + import_playbook: playbooks/tests_reapply.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_regression_nm.yml b/tests/tests_regression_nm.yml index 66fc76f..e2bbce7 100644 --- a/tests/tests_regression_nm.yml +++ b/tests/tests_regression_nm.yml @@ -2,8 +2,11 @@ --- # set network provider and gather facts - hosts: all + name: Run playbook 'playbooks/tests_checkpoint_cleanup.yml' with nm as + provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: @@ -27,7 +30,8 @@ # releases Therefore we include the playbook with the tests only if the hosts # would support it. # The test requires NetworkManager, therefore it cannot run on RHEL/CentOS 6 -- import_playbook: playbooks/tests_checkpoint_cleanup.yml +- name: Import the playbook 'playbooks/tests_checkpoint_cleanup.yml' + import_playbook: playbooks/tests_checkpoint_cleanup.yml when: - ansible_distribution_major_version != '6' # The test depends on behavior that is only visible with newer NM diff --git a/tests/tests_route_device_initscripts.yml b/tests/tests_route_device_initscripts.yml index 1f93fa4..e474dc9 100644 --- a/tests/tests_route_device_initscripts.yml +++ b/tests/tests_route_device_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_route_device.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_route_device.yml +- name: Import the playbook 'playbooks/tests_route_device.yml' + import_playbook: playbooks/tests_route_device.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_route_device_nm.yml b/tests/tests_route_device_nm.yml index e034c38..69d7b3b 100644 --- a/tests/tests_route_device_nm.yml +++ b/tests/tests_route_device_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_route_device.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_route_device.yml +- name: Import the playbook 'playbooks/tests_route_device.yml' + import_playbook: playbooks/tests_route_device.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_route_table_nm.yml b/tests/tests_route_table_nm.yml index d72970c..f7fe26d 100644 --- a/tests/tests_route_table_nm.yml +++ b/tests/tests_route_table_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_route_table.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_route_table.yml +- name: Import the playbook 'playbooks/tests_route_table.yml' + import_playbook: playbooks/tests_route_table.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_routing_rules_nm.yml b/tests/tests_routing_rules_nm.yml index 1bf7553..6083c9f 100644 --- a/tests/tests_routing_rules_nm.yml +++ b/tests/tests_routing_rules_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_routing_rules.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_routing_rules.yml +- name: Import the playbook 'playbooks/tests_routing_rules.yml' + import_playbook: playbooks/tests_routing_rules.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_states_initscripts.yml b/tests/tests_states_initscripts.yml index 8cdd964..def4dbd 100644 --- a/tests/tests_states_initscripts.yml +++ b/tests/tests_states_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_states.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_states.yml +- name: Import the playbook 'playbooks/tests_states.yml' + import_playbook: playbooks/tests_states.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_states_nm.yml b/tests/tests_states_nm.yml index a2bd548..db1b78c 100644 --- a/tests/tests_states_nm.yml +++ b/tests/tests_states_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_states.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_states.yml +- name: Import the playbook 'playbooks/tests_states.yml' + import_playbook: playbooks/tests_states.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_switch_provider.yml b/tests/tests_switch_provider.yml index 9a76272..bbe1d5e 100644 --- a/tests/tests_switch_provider.yml +++ b/tests/tests_switch_provider.yml @@ -3,7 +3,8 @@ - hosts: all name: Run playbook 'playbooks/tests_switch_provider.yml' -- import_playbook: playbooks/tests_switch_provider.yml +- name: Import the playbook 'playbooks/tests_switch_provider.yml' + import_playbook: playbooks/tests_switch_provider.yml when: # The test requires NetworkManager and initscripts, therefore it can only # run on RHEL/CentOS 7, RHEL/CentOS 8, or Fedora diff --git a/tests/tests_team_nm.yml b/tests/tests_team_nm.yml index 84db32d..82b0ab2 100644 --- a/tests/tests_team_nm.yml +++ b/tests/tests_team_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_team.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,7 +16,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_team.yml +- name: Import the playbook 'playbooks/tests_team.yml' + import_playbook: playbooks/tests_team.yml when: - ansible_distribution_major_version != '6' - ansible_distribution != 'Fedora' diff --git a/tests/tests_team_plugin_installation_nm.yml b/tests/tests_team_plugin_installation_nm.yml index f88f61d..ce21f79 100644 --- a/tests/tests_team_plugin_installation_nm.yml +++ b/tests/tests_team_plugin_installation_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_team_plugin_installation.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_team_plugin_installation.yml +- name: Import the playbook 'playbooks/tests_team_plugin_installation.yml' + import_playbook: playbooks/tests_team_plugin_installation.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_unit.yml b/tests/tests_unit.yml index 6d60652..47f8cf4 100644 --- a/tests/tests_unit.yml +++ b/tests/tests_unit.yml @@ -3,7 +3,8 @@ - hosts: all name: Setup for test running tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Install dependencies package: @@ -21,7 +22,8 @@ - hosts: all name: Execute python unit tests tasks: - - block: + - name: Execute python unit tests + block: - name: Create tempdir for code to test tempfile: state: directory @@ -35,7 +37,8 @@ register: temptar delegate_to: localhost - - include_tasks: tasks/get_modules_and_utils_paths.yml + - name: Include the task 'get_modules_and_utils_paths.yml' + include_tasks: tasks/get_modules_and_utils_paths.yml # TODO: using tar and copying the file is a workaround for the # synchronize module that does not work in test-harness. Related issue: @@ -112,7 +115,8 @@ - name: "List the files in {{ _rundir.path }}" command: ls -alrtFR {{ _rundir.path }} changed_when: false - - debug: + - name: Debug the lsr Python path + debug: msg: path {{ _lsr_python_path }} - name: Check if python2 is available diff --git a/tests/tests_vlan_mtu_initscripts.yml b/tests/tests_vlan_mtu_initscripts.yml index c7e78f4..fda6c79 100644 --- a/tests/tests_vlan_mtu_initscripts.yml +++ b/tests/tests_vlan_mtu_initscripts.yml @@ -4,13 +4,15 @@ - hosts: all name: Run playbook 'playbooks/tests_vlan_mtu.yml' with initscripts as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'initscripts' set_fact: network_provider: initscripts tags: - always -- import_playbook: playbooks/tests_vlan_mtu.yml +- name: Import the playbook 'playbooks/tests_vlan_mtu.yml' + import_playbook: playbooks/tests_vlan_mtu.yml when: (ansible_distribution in ['CentOS','RedHat'] and ansible_distribution_major_version | int < 9) diff --git a/tests/tests_vlan_mtu_nm.yml b/tests/tests_vlan_mtu_nm.yml index dc4f5a2..81491cc 100644 --- a/tests/tests_vlan_mtu_nm.yml +++ b/tests/tests_vlan_mtu_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_vlan_mtu.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_vlan_mtu.yml +- name: Import the playbook 'playbooks/tests_vlan_mtu.yml' + import_playbook: playbooks/tests_vlan_mtu.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_wireless_nm.yml b/tests/tests_wireless_nm.yml index a4bb4fd..1e951e6 100644 --- a/tests/tests_wireless_nm.yml +++ b/tests/tests_wireless_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_wireless.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,7 +16,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_wireless.yml +- name: Import the playbook 'playbooks/tests_wireless.yml' + import_playbook: playbooks/tests_wireless.yml when: - ansible_distribution_major_version != '6' - ansible_distribution_major_version == '7' diff --git a/tests/tests_wireless_plugin_installation_nm.yml b/tests/tests_wireless_plugin_installation_nm.yml index a4a9489..f698978 100644 --- a/tests/tests_wireless_plugin_installation_nm.yml +++ b/tests/tests_wireless_plugin_installation_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_wireless_plugin_installation.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -15,6 +16,7 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 -- import_playbook: playbooks/tests_wireless_plugin_installation.yml +- name: Import the playbook 'playbooks/tests_wireless_plugin_installation.yml' + import_playbook: playbooks/tests_wireless_plugin_installation.yml when: - ansible_distribution_major_version != '6' diff --git a/tests/tests_wireless_wpa3_owe_nm.yml b/tests/tests_wireless_wpa3_owe_nm.yml index 67599ec..6773143 100644 --- a/tests/tests_wireless_wpa3_owe_nm.yml +++ b/tests/tests_wireless_wpa3_owe_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_wireless_wpa3_owe.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -16,7 +17,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # OWE has not been supported by NetworkManager 1.18.8 on RHEL 7(dist-tag). Failed in setting up mock wifi on RHEL 8 -- import_playbook: playbooks/tests_wireless_wpa3_owe.yml +- name: Import the playbook 'playbooks/tests_wireless_wpa3_owe.yml' + import_playbook: playbooks/tests_wireless_wpa3_owe.yml when: - ansible_distribution_major_version != '6' - ansible_distribution_major_version > '7' and ansible_distribution == 'CentOS' or diff --git a/tests/tests_wireless_wpa3_sae_nm.yml b/tests/tests_wireless_wpa3_sae_nm.yml index 327014d..52a72c8 100644 --- a/tests/tests_wireless_wpa3_sae_nm.yml +++ b/tests/tests_wireless_wpa3_sae_nm.yml @@ -5,7 +5,8 @@ - hosts: all name: Run playbook 'playbooks/tests_wireless_wpa3_sae.yml' with nm as provider tasks: - - include_tasks: tasks/el_repo_setup.yml + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Set network provider to 'nm' set_fact: network_provider: nm @@ -16,7 +17,8 @@ # The test requires or should run with NetworkManager, therefore it cannot run # on RHEL/CentOS 6 # SAE has not been supported by NetworkManager 1.18.8 on RHEL 7. Failed in setting up mock wifi on RHEL 8 -- import_playbook: playbooks/tests_wireless_wpa3_sae.yml +- name: Import the playbook 'playbooks/tests_wireless_wpa3_sae.yml' + import_playbook: playbooks/tests_wireless_wpa3_sae.yml when: - ansible_distribution_major_version != '6' - ansible_distribution_major_version != '7' and ansible_distribution != 'RedHat'