diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py index 36fe72be7..089793a2f 100644 --- a/ipatests/test_integration/test_ipahealthcheck.py +++ b/ipatests/test_integration/test_ipahealthcheck.py @@ -1227,6 +1227,29 @@ class TestIpaHealthCheck(IntegrationTest): ) assert msg in cmd.stdout_text + def test_ipahealthcheck_verify_perms_for_source_files(self, + modify_permissions): + """ + This tests checks if files in /var/log are checked with ipa.files + source. + The test modifies permissions of ipainstall log file and checks the + response from healthcheck. + + https://pagure.io/freeipa/issue/8949 + """ + modify_permissions(self.master, path=paths.IPASERVER_INSTALL_LOG, + mode="0644") + returncode, data = run_healthcheck( + self.master, "ipahealthcheck.ipa.files", failures_only=True) + + assert returncode == 1 + assert len(data) == 1 + assert data[0]["result"] == "WARNING" + assert data[0]["kw"]["path"] == paths.IPASERVER_INSTALL_LOG + assert data[0]["kw"]["type"] == "mode" + assert data[0]["kw"]["expected"] == "0600" + + @pytest.fixture def remove_healthcheck(self): """