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

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