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