Skip to content

Commit

Permalink
test: skip tests_modifications_with_selinux_disabled on EL6
Browse files Browse the repository at this point in the history
Test is not supported on EL6

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Nov 20, 2023
1 parent bd14ca0 commit 9c99d28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/set_selinux_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_modifications_with_selinux_disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c99d28

Please sign in to comment.