From: Tim Beale Date: Fri, 14 Sep 2018 02:06:30 +0000 (+1200) Subject: tests: test ldap search requesting non-existent attribute X-Git-Tag: tdb-1.3.17~1517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d8667514af9db5283eb9cfe07e9881ff4cf46f3;p=thirdparty%2Fsamba.git tests: test ldap search requesting non-existent attribute As an after-thought to commit 563e454e8c55e94a950, we thought it might be a good idea to add a test case that requests an non-existent attribute in the attribute-filter as well the search-filter. Signed-off-by: Tim Beale Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index affc3b85a3b..37ccfb4edc7 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -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