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 <rmeggins@redhat.com>
  • Loading branch information
richm committed Nov 20, 2023
1 parent bd14ca0 commit 49fb4ff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/set_selinux_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
- os_family
__selinux_test_facts_regex: "{{ '^(' ~
(__selinux_test_facts | join('|')) ~ ')$' }}"
__selinux_test_facts_subsets: "{{ ['!all', '!min'] +
__selinux_test_facts }}"
block:
- name: Ensure ansible_facts used by tests
setup:
gather_subset: min
when: not ansible_facts.keys() | list |
intersect(__selinux_test_facts) == __selinux_test_facts
gather_subset: "{{ __selinux_test_facts_subsets }}"
when: __selinux_test_facts |
difference(ansible_facts.keys() | list) | length > 0

- name: Ensure SELinux testing packages
include_role:
Expand All @@ -37,6 +39,12 @@
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', '<') }}"
when: not __selinux_is_el6 is defined

- 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 49fb4ff

Please sign in to comment.