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