From 9c99d28bb58a51936f1a6e5a7b74f1c5e6809807 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Mon, 20 Nov 2023 12:51:55 -0700 Subject: [PATCH] test: skip tests_modifications_with_selinux_disabled on EL6 Test is not supported on EL6 Signed-off-by: Rich Megginson --- tests/set_selinux_variables.yml | 9 +++++++-- tests/tests_modifications_with_selinux_disabled.yml | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/set_selinux_variables.yml b/tests/set_selinux_variables.yml index 884fe3c..f2d2584 100644 --- a/tests/set_selinux_variables.yml +++ b/tests/set_selinux_variables.yml @@ -11,8 +11,8 @@ - name: Ensure ansible_facts used by tests setup: gather_subset: min - when: not ansible_facts.keys() | list | - intersect(__selinux_test_facts) == __selinux_test_facts + when: __selinux_test_facts | + difference(ansible_facts.keys() | list) | length > 0 - name: Ensure SELinux testing packages include_role: @@ -37,6 +37,11 @@ else 'util-linux' if ansible_facts['os_family'] == 'RedHat' else 'util-linux' }}" + - name: Set is_el6 flag + set_fact: + __selinux_is_el6: "{{ ansible_facts['os_family'] == 'RedHat' and + ansible_facts['distribution_major_version'] is version('7', '<') }}" + - name: Get test facts when: __selinux_get_test_facts | d(true) block: diff --git a/tests/tests_modifications_with_selinux_disabled.yml b/tests/tests_modifications_with_selinux_disabled.yml index abc2038..519f844 100644 --- a/tests/tests_modifications_with_selinux_disabled.yml +++ b/tests/tests_modifications_with_selinux_disabled.yml @@ -15,6 +15,10 @@ __selinux_need_policy_targeted: true __selinux_need_findmnt: true + - name: Skip test on EL6 + meta: end_host + when: __selinux_is_el6 | d(false) + - name: Add a Linux System Roles SELinux User user: comment: Linux System Roles SELinux User