From 2a93a58a34c92bac004ec9f0bb2e8cdeed583cad Mon Sep 17 00:00:00 2001 From: ned Date: Tue, 2 Jun 2015 16:15:06 -0600 Subject: Fixed bug with SizeLimit=1 --- server_search_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'server_search_test.go') diff --git a/server_search_test.go b/server_search_test.go index ed05f68..8b8fa65 100644 --- a/server_search_test.go +++ b/server_search_test.go @@ -114,6 +114,26 @@ func TestSearchSizelimit(t *testing.T) { if !strings.Contains(string(out), "numEntries: 3") { t.Errorf("ldapsearch sizelimit 0 failed - wrong number of entries: %v", string(out)) } + + cmd = exec.Command("ldapsearch", "-H", ldapURL, "-x", + "-b", serverBaseDN, "-D", "cn=testy,"+serverBaseDN, "-w", "iLike2test", "-z", "1", "(uid=trent)") + out, _ = cmd.CombinedOutput() + if !strings.Contains(string(out), "result: 0 Success") { + t.Errorf("ldapsearch failed: %v", string(out)) + } + if !strings.Contains(string(out), "numEntries: 1") { + t.Errorf("ldapsearch sizelimit 1 with filter failed - wrong number of entries: %v", string(out)) + } + + cmd = exec.Command("ldapsearch", "-H", ldapURL, "-x", + "-b", serverBaseDN, "-D", "cn=testy,"+serverBaseDN, "-w", "iLike2test", "-z", "0", "(uid=trent)") + out, _ = cmd.CombinedOutput() + if !strings.Contains(string(out), "result: 0 Success") { + t.Errorf("ldapsearch failed: %v", string(out)) + } + if !strings.Contains(string(out), "numEntries: 1") { + t.Errorf("ldapsearch sizelimit 0 with filter failed - wrong number of entries: %v", string(out)) + } done <- true }() -- cgit v1.2.3