From 7aec6f10374129d75cd99a4012980516ca535551 Mon Sep 17 00:00:00 2001 From: Mohammad Rizwan Yusuf Date: Wed, 25 Sep 2019 15:13:32 +0530 Subject: [PATCH] Check file ownership and permission for dirsrv log instance Check if file ownership and permission is set to dirsrv:dirsrv and 770 on /var/log/dirsrv/slapd- after ipa-restore. related ticket : https://pagure.io/freeipa/issue/7725 Signed-off-by: Mohammad Rizwan Yusuf Reviewed-By: Rob Crittenden --- ipatests/test_integration/test_backup_and_restore.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py index fd7bf47c2..a43f8f9e8 100644 --- a/ipatests/test_integration/test_backup_and_restore.py +++ b/ipatests/test_integration/test_backup_and_restore.py @@ -28,6 +28,7 @@ import pytest from ipaplatform.constants import constants from ipaplatform.paths import paths from ipaplatform.tasks import tasks as platformtasks +from ipapython.ipaldap import realm_to_serverid from ipapython.dn import DN from ipapython import ipautil from ipatests.test_integration.base import IntegrationTest @@ -217,6 +218,15 @@ class TestBackupAndRestore(IntegrationTest): self.master.run_command(['ipa-restore', backup_path], stdin_text=dirman_password + '\nyes') + # check the file permssion and ownership is set to 770 and + # dirsrv:dirsrv after restore on /var/log/dirsrv/slapd- + # related ticket : https://pagure.io/freeipa/issue/7725 + instance = realm_to_serverid(self.master.domain.realm) + log_path = paths.VAR_LOG_DIRSRV_INSTANCE_TEMPLATE % instance + cmd = self.master.run_command(['stat', '-c', + '"%a %G:%U"', log_path]) + assert "770 dirsrv:dirsrv" in cmd.stdout_text + def test_full_backup_and_restore_with_removed_users(self): """regression test for https://fedorahosted.org/freeipa/ticket/3866""" with restore_checker(self.master):