Marcel Telka
2024-03-28 22f007a7e50fb2b0264244eb98ffb733ed55afd9
commit | author | age
22f007 1 --- ansible-core-2.15.10/test/units/module_utils/basic/test_selinux.py.orig
MT 2 +++ ansible-core-2.15.10/test/units/module_utils/basic/test_selinux.py
f67cd3 3 @@ -37,6 +37,7 @@
MT 4  # test AnsibleModule selinux wrapper methods
5  @pytest.mark.usefixtures('no_args_module_exec')
6  class TestSELinuxMU:
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
11 @@ -56,6 +57,7 @@
12          # ensure value is cached (same answer after unpatching)
13          assert enabled_mod.selinux_enabled() is True
14  
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):
19 @@ -74,6 +76,7 @@
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]
22  
23 +    @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
24      def test_selinux_default_context(self):
25          # selinux unavailable
26          with patch.object(basic, 'HAVE_SELINUX', False):
27 @@ -92,6 +95,7 @@
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]
30  
31 +    @pytest.mark.skip(reason="always fails: https://github.com/ansible/ansible/issues/80436")
32      def test_selinux_context(self):
33          # selinux unavailable
34          with patch.object(basic, 'HAVE_SELINUX', False):
35 @@ -157,6 +161,7 @@
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'])
38  
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