tests: test ldap search requesting non-existent attribute
[amitay/samba.git] / source4 / dsdb / tests / python / ldap.py
index affc3b85a3bc29c822542a4a5f3800e0d91f182a..37ccfb4edc7a3813de25cf61ce9b7f0cfcf5e783 100755 (executable)
@@ -637,6 +637,14 @@ class BasicTests(samba.tests.TestCase):
         self.assertTrue(len(res) == 1,
                         "Search including unknown attribute failed")
 
+        # likewise, if we specifically request an unknown attribute
+        res = ldb.search(base=self.base_dn,
+                         expression="(cn=ldaptestgroup)",
+                         scope=SCOPE_SUBTREE,
+                         attrs=["thisdoesnotexist"])
+        self.assertTrue(len(res) == 1,
+                        "Search requesting unknown attribute failed")
+
         delete_force(self.ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         # attributes not in objectclasses and mandatory attributes missing test