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