mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 00:31:56 -06:00
ipatests: test_ipahealthcheck: Verify permissions for /var/log/ files
Test if files in /var/log are being checked with ipahealthcheck.ipa.files source. Resolves: https://pagure.io/freeipa/issue/8949 Signed-off-by: Michal Polovka <mpolovka@redhat.com> Reviewed-By: Michal Polovka <mpolovka@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
parent
dabf2763f8
commit
d46f5b2cc3
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user