Hi Martin, Attached is a new version of the patch with two test cases separated.
On 06/29/2016 12:23 PM, Martin Basti wrote: > > > On 29.06.2016 10:56, Oleg Fayans wrote: >> >> > > Hello, > > + assert_error(result, > + "Failed to verify that %s is an IPA Server" % > + self.master.hostname) > > > I would expect this error there: > > "Cannot promote this client to a replica. Local domain '{local}' does > not match IPA domain '{ipadomain}'. " Right, that's what this ticket is about: https://fedorahosted.org/freeipa/ticket/6006 Once these changes are implemented, we can update this test > > You should not use random REALM, in this case you don't test domains but > realms. You can leave the test with incorrect realm there, but as > separated testcase Oh, ok. But it does not seem possible to setup client providing only --realm without --domain: installer would not do it. > > Martin^2 > > -- Oleg Fayans Quality Engineer FreeIPA team RedHat.
From 0acffeff8ceb010a3855de96f476535627981003 Mon Sep 17 00:00:00 2001 From: Oleg Fayans <ofay...@redhat.com> Date: Thu, 30 Jun 2016 14:37:39 +0200 Subject: [PATCH] Test for incorrect client domain https://fedorahosted.org/freeipa/ticket/5976 --- .../test_integration/test_replica_promotion.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index 1f683b6d5c067ec526b307eea1460cafbadb80cb..4eaeddc9bc6343a11e4da5427037b5b133807e58 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -377,3 +377,37 @@ 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' + realm_name = domain_name.upper() + + @classmethod + def install(cls, mh): + tasks.install_master(cls.master, domain_level=cls.domain_level) + + def test_wrong_client_domain(self): + client = self.clients[0] + result = client.run_command(['ipa-client-install', '-U', + '--domain', self.domain_name, + '-p', 'admin', + '-w', self.master.config.dirman_password, + '--server', self.master.hostname], + raiseonerr=False) + assert_error(result, + "Failed to verify that %s is an IPA Server" % + self.master.hostname) + + def test_upcase_client_domain(self): + client = self.clients[0] + result1 = client.run_command(['ipa-client-install', '-U', '--domain', + self.master.domain.realm, '-w', + self.master.config.dirman_password, + '-p', 'admin', + '--server', self.master.hostname], + raiseonerr=False) + assert(result1.returncode == 0), ( + 'Failed to setup client with the upcase domain name') -- 1.8.3.1
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code