1 --- ansible_core-2.15.12/test/units/module_utils/basic/test_selinux.py.orig
2 +++ ansible_core-2.15.12/test/units/module_utils/basic/test_selinux.py
4 # test AnsibleModule selinux wrapper methods
5 @pytest.mark.usefixtures('no_args_module_exec')
7 + @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
8 def test_selinux_enabled(self):
9 # test selinux unavailable
10 # selinux unavailable, should return false
12 # ensure value is cached (same answer after unpatching)
13 assert enabled_mod.selinux_enabled() is True
15 + @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
16 def test_selinux_mls_enabled(self):
17 # selinux unavailable, should return false
18 with patch.object(basic, 'HAVE_SELINUX', False):
20 # selinux enabled with MLS is 4-element None
21 assert no_args_module(selinux_enabled=True, selinux_mls_enabled=True).selinux_initial_context() == [None, None, None, None]
23 + @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
24 def test_selinux_default_context(self):
26 with patch.object(basic, 'HAVE_SELINUX', False):
28 with patch('ansible.module_utils.compat.selinux.matchpathcon', side_effect=OSError):
29 assert am.selinux_default_context(path='/foo/bar') == [None, None, None, None]
31 + @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
32 def test_selinux_context(self):
34 with patch.object(basic, 'HAVE_SELINUX', False):
36 assert am.is_special_selinux_path('/some/path/that/should/be/nfs') == (True, ['foo_u', 'foo_r', 'foo_t', 's0'])
37 assert am.is_special_selinux_path('/weird/random/fstype/path') == (True, ['foo_u', 'foo_r', 'foo_t', 's0'])
39 + @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
40 def test_set_context_if_different(self):
41 am = no_args_module(selinux_enabled=False)
42 assert am.set_context_if_different('/path/to/file', ['foo_u', 'foo_r', 'foo_t', 's0'], True) is True