a99c7c
From ba7ec71ba96280da3841ebe47df2a6dc1cd6341e Mon Sep 17 00:00:00 2001
a99c7c
From: Mohammad Rizwan <myusuf@redhat.com>
a99c7c
Date: Fri, 26 Nov 2021 12:11:21 +0530
a99c7c
Subject: [PATCH] ipatests: Fix test_ipa_cert_fix.py::TestCertFixReplica
a99c7c
 teardown
a99c7c
a99c7c
Fixture `expire_certs` moves date back after renewing the certs.
a99c7c
This is causing the ipa-replica to fail. This fix first uninstalls
a99c7c
the server then moves back the date.
a99c7c
a99c7c
Fixes: https://pagure.io/freeipa/issue/9052
a99c7c
a99c7c
Signed-off-by: Mohammad Rizwan <myusuf@redhat.com>
a99c7c
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
a99c7c
---
a99c7c
 ipatests/test_integration/test_ipa_cert_fix.py | 9 ++++++++-
a99c7c
 1 file changed, 8 insertions(+), 1 deletion(-)
a99c7c
a99c7c
diff --git a/ipatests/test_integration/test_ipa_cert_fix.py b/ipatests/test_integration/test_ipa_cert_fix.py
a99c7c
index 39904d5de64c59416f01646f437aabf797d57dd9..5b56054b4f16d5654ebeb61971a8775bfaf341b8 100644
a99c7c
--- a/ipatests/test_integration/test_ipa_cert_fix.py
a99c7c
+++ b/ipatests/test_integration/test_ipa_cert_fix.py
a99c7c
@@ -389,6 +389,12 @@ class TestCertFixReplica(IntegrationTest):
a99c7c
             setup_dns=False, extra_args=['--no-ntp']
a99c7c
         )
a99c7c
 
a99c7c
+    @classmethod
a99c7c
+    def uninstall(cls, mh):
a99c7c
+        # Uninstall method is empty as the uninstallation is done in
a99c7c
+        # the fixture
a99c7c
+        pass
a99c7c
+
a99c7c
     @pytest.fixture
a99c7c
     def expire_certs(self):
a99c7c
         # move system date to expire certs
a99c7c
@@ -398,7 +404,8 @@ class TestCertFixReplica(IntegrationTest):
a99c7c
         yield
a99c7c
 
a99c7c
         # move date back on replica and master
a99c7c
-        for host in self.master, self.replicas[0]:
a99c7c
+        for host in self.replicas[0], self.master:
a99c7c
+            tasks.uninstall_master(host)
a99c7c
             tasks.move_date(host, 'start', '-3years-1days')
a99c7c
 
a99c7c
     def test_renew_expired_cert_replica(self, expire_certs):
a99c7c
-- 
a99c7c
2.34.1
a99c7c