From ab77dd159e30d7854bb6e23ed0165d3fd7312ac5 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Sun, 17 Mar 2024 14:38:46 -0600 Subject: [PATCH] test: improve name text for skipped ostree tests Improve the name text for skipped ostree tests to explain why the test is skipped. Add tests/tasks/ostree_systems_check.yml for use by test playbooks that may be skipped on ostree systems. Signed-off-by: Rich Megginson --- tests/playbooks/tests_team_plugin_installation.yml | 7 ++++--- tests/playbooks/tests_wireless_and_network_restart.yml | 8 ++++---- tests/playbooks/tests_wireless_plugin_installation.yml | 7 ++++--- tests/tasks/ostree_systems_check.yml | 6 ++++++ tests/tasks/setup_mock_wifi_wpa3_owe.yml | 6 +++++- tests/tasks/setup_mock_wifi_wpa3_sae.yml | 6 +++++- tests/tests_team_nm.yml | 1 - tests/tests_wireless_and_network_restart_nm.yml | 1 - 8 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 tests/tasks/ostree_systems_check.yml diff --git a/tests/playbooks/tests_team_plugin_installation.yml b/tests/playbooks/tests_team_plugin_installation.yml index 7b0b566..3882e60 100644 --- a/tests/playbooks/tests_team_plugin_installation.yml +++ b/tests/playbooks/tests_team_plugin_installation.yml @@ -3,9 +3,10 @@ - name: Play for testing team plugin installation hosts: all tasks: - - name: Check if rpm ostree system - cannot test - meta: end_host - when: __network_is_ostree | d(false) + - name: Check if test can run on ostree systems + include_tasks: tasks/ostree_systems_check.yml + vars: + package: NetworkManager-team - name: Remove the NetworkManager-team package package: diff --git a/tests/playbooks/tests_wireless_and_network_restart.yml b/tests/playbooks/tests_wireless_and_network_restart.yml index 2438f08..16f276a 100644 --- a/tests/playbooks/tests_wireless_and_network_restart.yml +++ b/tests/playbooks/tests_wireless_and_network_restart.yml @@ -23,10 +23,10 @@ tags: - always - - name: Cannot test ostree systems because the package can not be removed - or installed - 'NetworkManager-wifi' - meta: end_host - when: __network_is_ostree | d(false) + - name: Check if test can run on ostree systems + include_tasks: tasks/ostree_systems_check.yml + vars: + package: NetworkManager-wifi - name: Test the wifi connection without NetworkManager restarted tags: diff --git a/tests/playbooks/tests_wireless_plugin_installation.yml b/tests/playbooks/tests_wireless_plugin_installation.yml index fd5d3fe..47c1be1 100644 --- a/tests/playbooks/tests_wireless_plugin_installation.yml +++ b/tests/playbooks/tests_wireless_plugin_installation.yml @@ -3,9 +3,10 @@ - name: Play for testing wireless plugin installation hosts: all tasks: - - name: Check if rpm ostree system - cannot test - meta: end_host - when: __network_is_ostree | d(false) + - name: Check if test can run on ostree systems + include_tasks: tasks/ostree_systems_check.yml + vars: + package: NetworkManager-wifi - name: Remove the NetworkManager-wifi package package: diff --git a/tests/tasks/ostree_systems_check.yml b/tests/tasks/ostree_systems_check.yml new file mode 100644 index 0000000..7fd32f6 --- /dev/null +++ b/tests/tasks/ostree_systems_check.yml @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +--- +- name: Cannot test ostree systems because the package cannot be removed + or installed - '{{ package }}' + meta: end_host + when: __network_is_ostree | d(false) diff --git a/tests/tasks/setup_mock_wifi_wpa3_owe.yml b/tests/tasks/setup_mock_wifi_wpa3_owe.yml index 5d8048d..dce71c0 100644 --- a/tests/tasks/setup_mock_wifi_wpa3_owe.yml +++ b/tests/tasks/setup_mock_wifi_wpa3_owe.yml @@ -18,7 +18,11 @@ block: # It is currently too difficult to install the required kernel # if using rpm ostree - so just skip this test - - name: Check if rpm ostree system - cannot test + - name: >- + This is an rpm-ostree system. This test cannot be run on such a system. + The test wants to install the hostapd package from copr, and install + the mac80211_hwsim kernel module. These operations are currently not + supported on rpm-ostree systems. meta: end_host when: __network_is_ostree | d(false) diff --git a/tests/tasks/setup_mock_wifi_wpa3_sae.yml b/tests/tasks/setup_mock_wifi_wpa3_sae.yml index 94078e6..8da2722 100644 --- a/tests/tasks/setup_mock_wifi_wpa3_sae.yml +++ b/tests/tasks/setup_mock_wifi_wpa3_sae.yml @@ -18,7 +18,11 @@ block: # It is currently too difficult to install the required kernel # if using rpm ostree - so just skip this test - - name: Check if rpm ostree system - cannot test + - name: >- + This is an rpm-ostree system. This test cannot be run on such a system. + The test wants to install the hostapd package from copr, and install + the mac80211_hwsim kernel module. These operations are currently not + supported on rpm-ostree systems. meta: end_host when: __network_is_ostree | d(false) diff --git a/tests/tests_team_nm.yml b/tests/tests_team_nm.yml index bc60498..797d46f 100644 --- a/tests/tests_team_nm.yml +++ b/tests/tests_team_nm.yml @@ -21,4 +21,3 @@ import_playbook: playbooks/tests_team.yml when: - ansible_distribution_major_version != '6' - - ansible_distribution != 'Fedora' diff --git a/tests/tests_wireless_and_network_restart_nm.yml b/tests/tests_wireless_and_network_restart_nm.yml index ddcd489..4a64e43 100644 --- a/tests/tests_wireless_and_network_restart_nm.yml +++ b/tests/tests_wireless_and_network_restart_nm.yml @@ -21,4 +21,3 @@ import_playbook: playbooks/tests_wireless_and_network_restart.yml when: - ansible_distribution_major_version != '6' - - ansible_distribution != 'Fedora'