ipatests: add integration test for pkinit enable on replica

ipa-pkinit-manage enable was failing when run on a replica
without a CA instance.
Add a test with the following scenario:
- install a replica with --no-pkinit
- check that the KDC cert is self signed
- call ipa-pkinit-manage enable
- check that the KDC cert is signed by IPA CA

Related to https://pagure.io/freeipa/issue/7795

Reviewed-By: Francois Cami <fcami@redhat.com>
This commit is contained in:
Florence Blanc-Renaud 2018-12-20 09:01:29 +01:00
parent 7785210533
commit 64be3141da

View File

@ -92,6 +92,8 @@ class TestPkinitManage(IntegrationTest):
certificate that is tracked by certmonger with the SelfSigned helper.
"""
num_replicas = 1
@classmethod
def install(cls, mh):
# Install the master with PKINIT disabled
@ -109,3 +111,18 @@ class TestPkinitManage(IntegrationTest):
def test_pkinit_reenable(self):
self.master.run_command(['ipa-pkinit-manage', 'enable'])
check_pkinit(self.master, enabled=True)
def test_pkinit_on_replica(self):
"""Test pkinit enable on a replica without CA
Test case for ticket 7795.
Install a replica with --no-pkinit (without CA)
then call ipa-pkinit-manage enable. The replica must contact
a master with a CA instance to get its KDC cert.
"""
tasks.install_replica(self.master, self.replicas[0], setup_ca=False,
extra_args=['--no-pkinit'])
check_pkinit(self.replicas[0], enabled=False)
self.replicas[0].run_command(['ipa-pkinit-manage', 'enable'])
check_pkinit(self.replicas[0], enabled=True)