Skip to content

Commit

Permalink
Test: uniqueness of certificate renewal master
Browse files Browse the repository at this point in the history
https://fedorahosted.org/freeipa/ticket/6504

Reviewed-By: Florence Blanc-Renaud <[email protected]>
Reviewed-By: Martin Babinsky <[email protected]>
  • Loading branch information
Oleg Fayans authored and Martin Babinsky committed Dec 8, 2016
1 parent 4fff099 commit fad87a9
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions ipatests/test_integration/test_replica_promotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,3 +441,45 @@ def test_upcase_client_domain(self):
raiseonerr=False)
assert(result1.returncode == 0), (
'Failed to promote the client installed with the upcase domain name')


class TestRenewalMaster(IntegrationTest):

topology = 'star'
num_replicas = 1

@classmethod
def uninstall(cls, mh):
super(TestRenewalMaster, cls).uninstall(mh)

def test_replica_not_marked_as_renewal_master(self):
"""
https://fedorahosted.org/freeipa/ticket/5902
"""
master = self.master
replica = self.replicas[0]
result = master.run_command(["ipa", "config-show"]).stdout_text
assert("IPA CA renewal master: %s" % master.hostname in result), (
"Master hostname not found among CA renewal masters"
)
assert("IPA CA renewal master: %s" % replica.hostname not in result), (
"Replica hostname found among CA renewal masters"
)

def test_manual_renewal_master_transfer(self):
replica = self.replicas[0]
replica.run_command(['ipa', 'config-mod',
'--ca-renewal-master-server', replica.hostname])
result = self.master.run_command(["ipa", "config-show"]).stdout_text
assert("IPA CA renewal master: %s" % replica.hostname in result), (
"Replica hostname not found among CA renewal masters"
)

def test_automatic_renewal_master_transfer_ondelete(self):
# Test that after master uninstallation, replica overtakes the cert
# renewal master role
tasks.uninstall_master(self.replicas[0])
result = self.master.run_command(['ipa', 'config-show']).stdout_text
assert("IPA CA renewal master: %s" % self.master.hostname in result), (
"Master hostname not found among CA renewal masters"
)

0 comments on commit fad87a9

Please sign in to comment.