Blame SOURCES/0009-Enable-the-ccache-sweep-timer-during-installation_rhbz#2051575.patch

df1326
From 9b6d0bb1245c4891ccc270f360d0f72a4b1444c1 Mon Sep 17 00:00:00 2001
df1326
From: Rob Crittenden <rcritten@redhat.com>
df1326
Date: Mon, 7 Feb 2022 10:39:55 -0500
df1326
Subject: [PATCH] Enable the ccache sweep timer during installation
df1326
df1326
The timer was only being enabled during package installation
df1326
if IPA was configured. So effectively only on upgrade.
df1326
df1326
Add as a separate installation step after the ccache directory
df1326
is configured.
df1326
df1326
Fixes: https://pagure.io/freeipa/issue/9107
df1326
df1326
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
df1326
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
df1326
---
df1326
 ipaserver/install/httpinstance.py | 7 +++++++
df1326
 1 file changed, 7 insertions(+)
df1326
df1326
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py
df1326
index 732bb58d4..50ccf5e50 100644
df1326
--- a/ipaserver/install/httpinstance.py
df1326
+++ b/ipaserver/install/httpinstance.py
df1326
@@ -140,6 +140,8 @@ class HTTPInstance(service.Service):
df1326
         self.step("publish CA cert", self.__publish_ca_cert)
df1326
         self.step("clean up any existing httpd ccaches",
df1326
                   self.remove_httpd_ccaches)
df1326
+        self.step("enable ccache sweep",
df1326
+                  self.enable_ccache_sweep)
df1326
         self.step("configuring SELinux for httpd", self.configure_selinux_for_httpd)
df1326
         if not self.is_kdcproxy_configured():
df1326
             self.step("create KDC proxy config", self.create_kdcproxy_conf)
df1326
@@ -177,6 +179,11 @@ class HTTPInstance(service.Service):
df1326
             [paths.SYSTEMD_TMPFILES, '--create', '--prefix', paths.IPA_CCACHES]
df1326
         )
df1326
 
df1326
+    def enable_ccache_sweep(self):
df1326
+        ipautil.run(
df1326
+            [paths.SYSTEMCTL, 'enable', 'ipa-ccache-sweep.timer']
df1326
+        )
df1326
+
df1326
     def __configure_http(self):
df1326
         self.update_httpd_service_ipa_conf()
df1326
         self.update_httpd_wsgi_conf()
df1326
-- 
df1326
2.34.1
df1326
df1326
From 0d9eb3d515385412abefe9c33e0099ea14f33cbc Mon Sep 17 00:00:00 2001
df1326
From: Mohammad Rizwan <myusuf@redhat.com>
df1326
Date: Wed, 9 Feb 2022 18:56:21 +0530
df1326
Subject: [PATCH] Test ipa-ccache-sweep.timer enabled by default during
df1326
 installation
df1326
df1326
This test checks that ipa-ccache-sweep.timer is enabled by default
df1326
during the ipa installation.
df1326
df1326
related: https://pagure.io/freeipa/issue/9107
df1326
df1326
Signed-off-by: Mohammad Rizwan <myusuf@redhat.com>
df1326
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
df1326
---
df1326
 .../test_integration/test_installation.py     | 19 +++++++++++++++++--
df1326
 1 file changed, 17 insertions(+), 2 deletions(-)
df1326
df1326
diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py
df1326
index f2d372c0c..63edbaa2b 100644
df1326
--- a/ipatests/test_integration/test_installation.py
df1326
+++ b/ipatests/test_integration/test_installation.py
df1326
@@ -475,7 +475,7 @@ class TestInstallCA(IntegrationTest):
df1326
 
df1326
         # Tweak sysrestore.state to drop installation section
df1326
         self.master.run_command(
df1326
-            ['sed','-i', r's/\[installation\]/\[badinstallation\]/',
df1326
+            ['sed', '-i', r's/\[installation\]/\[badinstallation\]/',
df1326
              os.path.join(paths.SYSRESTORE, SYSRESTORE_STATEFILE)])
df1326
 
df1326
         # Re-run installation check and it should fall back to old method
df1326
@@ -485,7 +485,7 @@ class TestInstallCA(IntegrationTest):
df1326
 
df1326
         # Restore installation section.
df1326
         self.master.run_command(
df1326
-            ['sed','-i', r's/\[badinstallation\]/\[installation\]/',
df1326
+            ['sed', '-i', r's/\[badinstallation\]/\[installation\]/',
df1326
              os.path.join(paths.SYSRESTORE, SYSRESTORE_STATEFILE)])
df1326
 
df1326
         # Uninstall and confirm that the old method reports correctly
df1326
@@ -690,6 +690,7 @@ def get_pki_tomcatd_pid(host):
df1326
             break
df1326
     return(pid)
df1326
 
df1326
+
df1326
 def get_ipa_services_pids(host):
df1326
     ipa_services_name = [
df1326
         "krb5kdc", "kadmin", "named", "httpd", "ipa-custodia",
df1326
@@ -1309,6 +1310,20 @@ class TestInstallMasterKRA(IntegrationTest):
df1326
     def test_install_master(self):
df1326
         tasks.install_master(self.master, setup_dns=False, setup_kra=True)
df1326
 
df1326
+    def test_ipa_ccache_sweep_timer_enabled(self):
df1326
+        """Test ipa-ccache-sweep.timer enabled by default during installation
df1326
+
df1326
+        This test checks that ipa-ccache-sweep.timer is enabled by default
df1326
+        during the ipa installation.
df1326
+
df1326
+        related: https://pagure.io/freeipa/issue/9107
df1326
+        """
df1326
+        result = self.master.run_command(
df1326
+            ['systemctl', 'is-enabled', 'ipa-ccache-sweep.timer'],
df1326
+            raiseonerr=False
df1326
+        )
df1326
+        assert 'enabled' in result.stdout_text
df1326
+
df1326
     def test_install_dns(self):
df1326
         tasks.install_dns(self.master)
df1326
 
df1326
-- 
df1326
2.34.1
df1326