a99c7c
From 0d9eb3d515385412abefe9c33e0099ea14f33cbc Mon Sep 17 00:00:00 2001
a99c7c
From: Mohammad Rizwan <myusuf@redhat.com>
a99c7c
Date: Wed, 9 Feb 2022 18:56:21 +0530
a99c7c
Subject: [PATCH] Test ipa-ccache-sweep.timer enabled by default during
a99c7c
 installation
a99c7c
a99c7c
This test checks that ipa-ccache-sweep.timer is enabled by default
a99c7c
during the ipa installation.
a99c7c
a99c7c
related: https://pagure.io/freeipa/issue/9107
a99c7c
a99c7c
Signed-off-by: Mohammad Rizwan <myusuf@redhat.com>
a99c7c
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
a99c7c
---
a99c7c
 .../test_integration/test_installation.py     | 19 +++++++++++++++++--
a99c7c
 1 file changed, 17 insertions(+), 2 deletions(-)
a99c7c
a99c7c
diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py
a99c7c
index f2d372c0c0356f244971a2af808db45dd6c8cb5b..63edbaa2bb4dbae174c6ab8c8f193cc24cc45b14 100644
a99c7c
--- a/ipatests/test_integration/test_installation.py
a99c7c
+++ b/ipatests/test_integration/test_installation.py
a99c7c
@@ -475,7 +475,7 @@ class TestInstallCA(IntegrationTest):
a99c7c
 
a99c7c
         # Tweak sysrestore.state to drop installation section
a99c7c
         self.master.run_command(
a99c7c
-            ['sed','-i', r's/\[installation\]/\[badinstallation\]/',
a99c7c
+            ['sed', '-i', r's/\[installation\]/\[badinstallation\]/',
a99c7c
              os.path.join(paths.SYSRESTORE, SYSRESTORE_STATEFILE)])
a99c7c
 
a99c7c
         # Re-run installation check and it should fall back to old method
a99c7c
@@ -485,7 +485,7 @@ class TestInstallCA(IntegrationTest):
a99c7c
 
a99c7c
         # Restore installation section.
a99c7c
         self.master.run_command(
a99c7c
-            ['sed','-i', r's/\[badinstallation\]/\[installation\]/',
a99c7c
+            ['sed', '-i', r's/\[badinstallation\]/\[installation\]/',
a99c7c
              os.path.join(paths.SYSRESTORE, SYSRESTORE_STATEFILE)])
a99c7c
 
a99c7c
         # Uninstall and confirm that the old method reports correctly
a99c7c
@@ -690,6 +690,7 @@ def get_pki_tomcatd_pid(host):
a99c7c
             break
a99c7c
     return(pid)
a99c7c
 
a99c7c
+
a99c7c
 def get_ipa_services_pids(host):
a99c7c
     ipa_services_name = [
a99c7c
         "krb5kdc", "kadmin", "named", "httpd", "ipa-custodia",
a99c7c
@@ -1309,6 +1310,20 @@ class TestInstallMasterKRA(IntegrationTest):
a99c7c
     def test_install_master(self):
a99c7c
         tasks.install_master(self.master, setup_dns=False, setup_kra=True)
a99c7c
 
a99c7c
+    def test_ipa_ccache_sweep_timer_enabled(self):
a99c7c
+        """Test ipa-ccache-sweep.timer enabled by default during installation
a99c7c
+
a99c7c
+        This test checks that ipa-ccache-sweep.timer is enabled by default
a99c7c
+        during the ipa installation.
a99c7c
+
a99c7c
+        related: https://pagure.io/freeipa/issue/9107
a99c7c
+        """
a99c7c
+        result = self.master.run_command(
a99c7c
+            ['systemctl', 'is-enabled', 'ipa-ccache-sweep.timer'],
a99c7c
+            raiseonerr=False
a99c7c
+        )
a99c7c
+        assert 'enabled' in result.stdout_text
a99c7c
+
a99c7c
     def test_install_dns(self):
a99c7c
         tasks.install_dns(self.master)
a99c7c
 
a99c7c
-- 
a99c7c
2.34.1
a99c7c