diff options
author | Matt Davis <6775756+nitzmahone@users.noreply.github.com> | 2022-05-10 14:40:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-10 16:40:42 -0500 |
commit | 092d298b5c7e35a26dae16698ee30c02684f8c29 (patch) | |
tree | a30d7c1c10604d924b898cbbd0f409f2f23b7326 | |
parent | a9f17d05320a56623e6736945fe18eb7c9c9f0c4 (diff) | |
download | ansible-092d298b5c7e35a26dae16698ee30c02684f8c29.tar.gz |
fix SELinux facts tests (#77708)
* make the pre-flight sniffing more robust to different failure conditions (was failing on Ubuntu 22.04 VMs)
* remove skip aliases (the test needs to function everywhere to assert that the selinux facts bits behave properly when it's N/A)
(cherry picked from commit 4ff10fcd31cdfc41c62ff6d9b710c1951c83c3c5)
-rw-r--r-- | test/integration/targets/module_utils_facts.system.selinux/aliases | 4 | ||||
-rw-r--r-- | test/integration/targets/module_utils_facts.system.selinux/tasks/main.yml | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/test/integration/targets/module_utils_facts.system.selinux/aliases b/test/integration/targets/module_utils_facts.system.selinux/aliases index ee281d2748..a6dafcf8cd 100644 --- a/test/integration/targets/module_utils_facts.system.selinux/aliases +++ b/test/integration/targets/module_utils_facts.system.selinux/aliases @@ -1,5 +1 @@ shippable/posix/group1 -skip/osx -skip/macos -skip/freebsd -skip/docker diff --git a/test/integration/targets/module_utils_facts.system.selinux/tasks/main.yml b/test/integration/targets/module_utils_facts.system.selinux/tasks/main.yml index c599377b64..171723958e 100644 --- a/test/integration/targets/module_utils_facts.system.selinux/tasks/main.yml +++ b/test/integration/targets/module_utils_facts.system.selinux/tasks/main.yml @@ -18,11 +18,12 @@ - name: check selinux policy type shell: grep '^SELINUXTYPE=' /etc/selinux/config | cut -d'=' -f2 + ignore_errors: yes register: r - set_fact: selinux_policytype: "{{ r.stdout_lines[0] }}" - when: r.changed + when: r is success and r.stdout_lines - assert: that: |