-- 
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.
From 6fe2f67807a2cd3d9519c1c919c884dd18867f74 Mon Sep 17 00:00:00 2001
From: Oleg Fayans <ofay...@redhat.com>
Date: Wed, 29 Jun 2016 10:53:44 +0200
Subject: [PATCH] Test for incorrect client domain

https://fedorahosted.org/freeipa/ticket/5976
---
 .../test_integration/test_replica_promotion.py     | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py
index 1f683b6d5c067ec526b307eea1460cafbadb80cb..e0d198b2385e443c79e6d3f5f6ecd0b564155e7b 100644
--- a/ipatests/test_integration/test_replica_promotion.py
+++ b/ipatests/test_integration/test_replica_promotion.py
@@ -377,3 +377,33 @@ 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,
+                                     '--realm', self.realm_name,
+                                     '-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)
+        result1 = client.run_command(['ipa-client-install', '-U', '--domain',
+                                      self.master.domain.realm, '-w',
+                                      self.master.config.dirman_password,
+                                      '--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

Reply via email to