diff options
author | Oleg Fayans <ofayans@redhat.com> | 2016-07-01 16:52:22 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-07-01 17:59:27 +0200 |
commit | f784532d4ed6f25cf8ba12f83a7c322515434855 (patch) | |
tree | 598a47d07d8b2cfe35b6fe9654909c799f01797b | |
parent | dc5b2eaa772fda5673b222bc9107cf5b85c1295d (diff) | |
download | freeipa-f784532d4ed6f25cf8ba12f83a7c322515434855.tar.gz freeipa-f784532d4ed6f25cf8ba12f83a7c322515434855.tar.xz freeipa-f784532d4ed6f25cf8ba12f83a7c322515434855.zip |
Test for incorrect client domain
https://fedorahosted.org/freeipa/ticket/5976
Reviewed-By: Martin Basti <mbasti@redhat.com>
-rw-r--r-- | ipatests/test_integration/test_replica_promotion.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index 1f683b6d5..7bc1d5281 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -377,3 +377,55 @@ class TestOldReplicaWorksAfterDomainUpgrade(IntegrationTest): result1 = self.master.run_command(['ipa', 'user-show', self.username], raiseonerr=False) assert_error(result1, "%s: user not found" % self.username, 2) + + +class TestWrongClientDomain(IntegrationTest): + topology = "star" + num_clients = 1 + domain_name = 'exxample.test' + + @classmethod + def install(cls, mh): + tasks.install_master(cls.master, domain_level=cls.domain_level) + + def teardown_method(self, method): + self.clients[0].run_command(['ipa-client-install', + '--uninstall', '-U'], + raiseonerr=False) + tasks.kinit_admin(self.master) + self.master.run_command(['ipa', 'host-del', + self.clients[0].hostname], + raiseonerr=False) + + def test_wrong_client_domain(self): + client = self.clients[0] + client.run_command(['ipa-client-install', '-U', + '--domain', self.domain_name, + '--realm', self.master.domain.realm, + '-p', 'admin', + '-w', self.master.config.admin_password, + '--server', self.master.hostname, + '--force-join']) + result = client.run_command(['ipa-replica-install', '-U', '-w', + self.master.config.dirman_password], + raiseonerr=False) + assert_error(result, + "Cannot promote this client to a replica. Local domain " + "'%s' does not match IPA domain " + "'%s'" % (self.domain_name, self.master.domain.name)) + + def test_upcase_client_domain(self): + client = self.clients[0] + result = client.run_command(['ipa-client-install', '-U', '--domain', + self.master.domain.name.upper(), '-w', + self.master.config.admin_password, + '-p', 'admin', + '--server', self.master.hostname, + '--force-join'], raiseonerr=False) + assert(result.returncode == 0), ( + 'Failed to setup client with the upcase domain name') + result1 = client.run_command(['ipa-replica-install', '-U', '-w', + self.master.config.dirman_password], + raiseonerr=False) + assert(result1.returncode == 0), ( + 'Failed to promote the client installed with the upcase domain name') |