From 4287153a2c0323d20e6619c4ea52fa8057ff946d Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Wed, 25 Jul 2007 17:31:32 +0000
Subject: [PATCH] Fix for issue #1015: ldapsearch --verbose option doesn't work. This change causes ldapsearch and ldapmodify verbose options to trace the contents of incoming and outgoing LDAP messages and ASN.1 elements to standard error stream. It excludes search-result-entry messages from the trace since this would be rather too verbose and not very useful. The main use for verbose output is to investigate connection problems, referral following and such. A possible improvement would be to use a separate option for the ASN.1 tracing, and add session related output such as connection details, security context details and auth details as well as referral chasing details (all this must currently be derived from the protocol trace).

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java
index b641d03..2fa306d 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java
@@ -566,6 +566,29 @@
 
 
   /**
+   * Tests a simple search with verbose output.
+   */
+  @Test()
+  public void testSimpleVerboseSearch()
+  {
+    String[] args =
+    {
+      "-h", "127.0.0.1",
+      "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
+      "-v",
+      "-D", "cn=Directory Manager",
+      "-w", "password",
+      "-b", "",
+      "-s", "base",
+      "(objectClass=*)"
+    };
+
+    assertEquals(LDAPSearch.mainSearch(args, false, null, System.err), 0);
+  }
+
+
+
+  /**
    * Tests a simple invocation using the "--dry-run" option with a valid argument
    * set.
    */

--
Gitblit v1.10.0