URL: https://github.com/freeipa/freeipa/pull/2597
Author: flo-renaud
 Title: #2597: [Backport][ipa-4-7] [ipatest] Added test for ipa-client-install 
with a non-standard ldap.conf file
Action: opened

PR body:
"""
This PR was opened automatically because PR #2567 was pushed to master and 
backport to ipa-4-7 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2597/head:pr2597
git checkout pr2597
From 3539c29d36ade778c14374acad3fe410bbce6555 Mon Sep 17 00:00:00 2001
From: Varun Mylaraiah <mva...@redhat.com>
Date: Thu, 15 Nov 2018 01:38:53 -0500
Subject: [PATCH] Added test for ipa-client-install with a non-standard
 ldap.conf file Ticket: https://pagure.io/freeipa/issue/7418

Signed-off-by: Varun Mylaraiah <mva...@redhat.com>
---
 .../test_integration/test_installation.py     | 28 ++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py
index b7a9628c8b..1eefbfb4bc 100644
--- a/ipatests/test_integration/test_installation.py
+++ b/ipatests/test_integration/test_installation.py
@@ -176,6 +176,33 @@ def test_replica2_with_ca_kra_install(self):
     def test_replica2_ipa_dns_install(self):
         super(TestInstallWithCA1, self).test_replica2_ipa_dns_install()
 
+    def test_install_with_bad_ldap_conf(self):
+        """
+        Test a client install with a non standard ldap.config
+        https://pagure.io/freeipa/issue/7418
+        """
+        ldap_conf = paths.OPENLDAP_LDAP_CONF
+        base_dn = self.master.domain.basedn  # pylint: disable=no-member
+        client = self.replicas[0]
+        tasks.uninstall_master(client)
+        expected_msg1 = "contains deprecated and unsupported " \
+                        "entries: HOST, PORT"
+        file_backup = client.get_file_contents(ldap_conf, encoding='utf-8')
+        constants = "URI ldaps://{}\nBASE {}\nHOST {}\nPORT 636".format(
+            self.master.hostname, base_dn,
+            self.master.hostname)
+        modifications = "{}\n{}".format(file_backup, constants)
+        client.put_file_contents(paths.OPENLDAP_LDAP_CONF, modifications)
+        result = client.run_command(['ipa-client-install', '-U',
+                                     '--domain', client.domain.name,
+                                     '--realm', client.domain.realm,
+                                     '-p', client.config.admin_name,
+                                     '-w', client.config.admin_password,
+                                     '--server', self.master.hostname],
+                                    raiseonerr=False)
+        assert expected_msg1 in result.stderr_text
+        client.put_file_contents(ldap_conf, file_backup)
+
 
 class TestInstallWithCA2(InstallTestBase2):
 
@@ -217,7 +244,6 @@ def install(cls, mh):
         tasks.install_master(cls.master, setup_dns=False, setup_kra=True)
 
 
-
 class TestInstallWithCA_DNS1(InstallTestBase1):
 
     @classmethod
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org

Reply via email to