c14a06
From a3d71eb72a6125a80a9d7b698f34dcb95dc25184 Mon Sep 17 00:00:00 2001
c14a06
From: Anuja More <amore@redhat.com>
c14a06
Date: Thu, 5 Aug 2021 20:03:21 +0530
c14a06
Subject: [PATCH] ipatests: Test ldapsearch with base scope works with compat
c14a06
 tree.
c14a06
c14a06
Added test to verify that ldapsearch for compat tree
c14a06
with scope base and sub is not failing.
c14a06
c14a06
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1958909
c14a06
c14a06
Signed-off-by: Anuja More <amore@redhat.com>
c14a06
Reviewed-By: Mohammad Rizwan <myusuf@redhat.com>
c14a06
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
c14a06
---
c14a06
 ipatests/test_integration/test_commands.py | 13 +++++++++++++
c14a06
 1 file changed, 13 insertions(+)
c14a06
c14a06
diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
c14a06
index 2035ced56..e3a0d867e 100644
c14a06
--- a/ipatests/test_integration/test_commands.py
c14a06
+++ b/ipatests/test_integration/test_commands.py
c14a06
@@ -1558,6 +1558,19 @@ class TestIPACommandWithoutReplica(IntegrationTest):
c14a06
         # Run the command again after cache is removed
c14a06
         self.master.run_command(['ipa', 'user-show', 'ipauser1'])
c14a06
 
c14a06
+    def test_basesearch_compat_tree(self):
c14a06
+        """Test ldapsearch against compat tree is working
c14a06
+
c14a06
+        This to ensure that ldapsearch with base scope is not failing.
c14a06
+
c14a06
+        related: https://bugzilla.redhat.com/show_bug.cgi?id=1958909
c14a06
+        """
c14a06
+        tasks.kinit_admin(self.master)
c14a06
+        base_dn = str(self.master.domain.basedn)
c14a06
+        base = "cn=admins,cn=groups,cn=compat,{basedn}".format(basedn=base_dn)
c14a06
+        tasks.ldapsearch_dm(self.master, base, ldap_args=[], scope='sub')
c14a06
+        tasks.ldapsearch_dm(self.master, base, ldap_args=[], scope='base')
c14a06
+
c14a06
 
c14a06
 class TestIPAautomount(IntegrationTest):
c14a06
     @classmethod
c14a06
-- 
c14a06
2.31.1
c14a06
c14a06
From d4062e407d242a72b9d4e32f4fdd6aed086ce005 Mon Sep 17 00:00:00 2001
c14a06
From: Anuja More <amore@redhat.com>
c14a06
Date: Thu, 5 Aug 2021 20:23:15 +0530
c14a06
Subject: [PATCH] ipatests: skip test_basesearch_compat_tree on fedora.
c14a06
c14a06
slapi-nis with fix is not part of fedora yet.
c14a06
test requires with fix:
c14a06
https://pagure.io/slapi-nis/c/61ea8f6a104da25329e301a8f56944f860de8177?
c14a06
c14a06
Signed-off-by: Anuja More <amore@redhat.com>
c14a06
Reviewed-By: Mohammad Rizwan <myusuf@redhat.com>
c14a06
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
c14a06
---
c14a06
 ipatests/test_integration/test_commands.py | 7 +++++++
c14a06
 1 file changed, 7 insertions(+)
c14a06
c14a06
diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
c14a06
index e3a0d867e..4d9a81652 100644
c14a06
--- a/ipatests/test_integration/test_commands.py
c14a06
+++ b/ipatests/test_integration/test_commands.py
c14a06
@@ -38,6 +38,7 @@ from ipatests.create_external_ca import ExternalCA
c14a06
 from ipatests.test_ipalib.test_x509 import good_pkcs7, badcert
c14a06
 from ipapython.ipautil import realm_to_suffix, ipa_generate_password
c14a06
 from ipaserver.install.installutils import realm_to_serverid
c14a06
+from pkg_resources import parse_version
c14a06
 
c14a06
 logger = logging.getLogger(__name__)
c14a06
 
c14a06
@@ -1565,6 +1566,12 @@ class TestIPACommandWithoutReplica(IntegrationTest):
c14a06
 
c14a06
         related: https://bugzilla.redhat.com/show_bug.cgi?id=1958909
c14a06
         """
c14a06
+        version = self.master.run_command(
c14a06
+            ["rpm", "-qa", "--qf", "%{VERSION}", "slapi-nis"]
c14a06
+        )
c14a06
+        if tasks.get_platform(self.master) == "fedora" and parse_version(
c14a06
+                version.stdout_text) <= parse_version("0.56.7"):
c14a06
+            pytest.skip("Test requires slapi-nis with fix on fedora")
c14a06
         tasks.kinit_admin(self.master)
c14a06
         base_dn = str(self.master.domain.basedn)
c14a06
         base = "cn=admins,cn=groups,cn=compat,{basedn}".format(basedn=base_dn)
c14a06
-- 
c14a06
2.31.1
c14a06