From 7a5b1cc1402d739a9804eebe1a9d2be13bf454ec Mon Sep 17 00:00:00 2001 From: Michal Reznik Date: Thu, 10 Aug 2017 15:09:39 +0200 Subject: [PATCH] test_caless: add server_replica ca-less to ca-full test Add server_replica ca-less to ca-full test as we are currently missing one. Cover Pagure issue: https://pagure.io/freeipa/issue/6207 https://pagure.io/freeipa/issue/7086 Reviewed-By: Stanislav Laznicka Reviewed-By: Tomas Krizek --- ipatests/test_integration/test_caless.py | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index c41e0ee3d..1424bd647 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -1493,6 +1493,7 @@ class TestCertInstall(CALessBase): class TestPKINIT(CALessBase): + """Install master and replica with PKINIT""" num_replicas = 1 @classmethod @@ -1513,3 +1514,41 @@ class TestPKINIT(CALessBase): pkinit_pin=_DEFAULT) assert result.returncode == 0 self.verify_installation() + + +class TestServerReplicaCALessToCAFull(CALessBase): + """ + Test server and replica caless to cafull scenario: + Master (caless) / replica (caless) >> master (ca) / replica (ca) + """ + num_replicas = 1 + + def test_install_caless_server_replica(self): + """Install CA-less master and replica""" + + self.create_pkcs12('ca1/server') + self.prepare_cacert('ca1') + + master = self.install_server() + assert master.returncode == 0 + + self.create_pkcs12('ca1/replica', filename='replica.p12') + + replica = self.prepare_replica() + assert replica.returncode == 0 + + def test_server_ipa_ca_install(self): + """Install CA on master""" + + ca_master = tasks.install_ca(self.master) + assert ca_master.returncode == 0 + cert_update_master = self.master.run_command(['ipa-certupdate']) + assert cert_update_master.returncode == 0 + cert_update_replica = self.replicas[0].run_command(['ipa-certupdate']) + assert cert_update_replica.returncode == 0 + + def test_replica_ipa_ca_install(self): + """Install CA on replica""" + + ca_replica = tasks.install_ca(self.replicas[0]) + assert ca_replica.returncode == 0