I've not tried using the LDAP Sampler, so this may not apply, but could you
not use a response assertion to check for the required condition?

S.
-----Original Message-----
From: Mcgladrey, Kayne [mailto:[EMAIL PROTECTED]
Sent: 10 November 2003 16:38
To: JMeter Developers List
Subject: RE: PATCH LdapClient.java


As an alternate implementation, it could be a user-configurable test. Add a
checkbox to the search form and the end user could decide if they want to
test for the correct result (or at least any result) or just the correct
response code. We have a clear need to verify that a Directory server is
returing results consistently under heavy load. There's a problem if no
results are being returned for a valid search that refers to a valid record.


Kayne McGladrey
Member - Technical Group
AT&T Wireless


-----Original Message-----
From:   Dolf Smits [mailto:[EMAIL PROTECTED]
Sent:   Sun 11/9/2003 5:13 AM
To:     JMeter Developers List
Cc:     
Subject:        Re: PATCH LdapClient.java
Hi,

I don't think this is a good idea.
If you want to make a diffrence between "search succesfull, some results
found" and "search successfull, no results found" you schould not declare
the last result as being unsuccessfull.

If you want to stress test an ldap server, the difference between success
and failure are not whteher there are any results, but whether the LDAP
server is responding properly.

If you want to make a difference, I think we can better start to define some
sort of XML template for an ldap answer, and implement a way to translate an
ldap answer into this template and show this template as being the ldap
result.
You can then use all kind of asertions to see or the answer is conform your
own wishes.

Just a short idea about fields ( I don't know whether all these files can be
read by the JAVA LDAP tools, but I think that these fields should be present
in such a template.

---
Start Time     :Tue Oct 28 14:28:24 2003
  Duration       :0.020 sec
  User           :cn=admin,o=Fasr
  IP             :127.0.0.1
  Op-Name        :LDAP_Con1953_Op21
  ConnID         :1953
  Operation      :SEARCH
  Version        :3
  MessageID      :4302
  Base Obj       :ou=ctscApplicationDataRepository, o=Fasr
  Scope          :onelevel
  Filter
:(&(objectclass=ctscPropertyDefinition)(ctscObjectClass=User))
  Size Limit     :0
  Time Limit     :0
  Deref Alias    :never
  Types Only     :no
  Req Attr #     :all
  Found Entries  :0
  Found Attrs    :0
  Controls #     :0
  Bytes Received :136
  Bytes Returned :41
  Abandoned      :no
  Result Code    :0 (success)
----------------

Greets, Dolf


----- Original Message -----
From: "Mcgladrey, Kayne" <[EMAIL PROTECTED]>
To: "jMeter Developers List" <[EMAIL PROTECTED]>
Sent: Thursday, November 06, 2003 23:57
Subject: PATCH LdapClient.java


Hello,

This patch addresses the current behavior of the LDAP Search operation.
Under the current version, LDAP Searches that are successful but do not
return results are marked as successful. The LDAP RFC states that result
code 0 will be returned if no results were returned.

However, this makes the results from jMeter misleading. Consider this
example:
 - Thread Group
  - LDAP Sampler: add
   - Server: Master Directory Server, incorrect user name, valid DN
  - LDAP Sampler: search
   - Server: Replicate Directory Server, same DN as in "Add"

(Assume a working one-way replication agreement between the Master and the
Replicate)

Under these circumstances, the "Add" operation against the Master Directory
Server will fail with error 32, 34, or 50 (depending on the server
implementation). However, the search for the new record against the
Replicate Directory Server will appear (to the end user) to be successful.
In fact, it will have returned no results.

The patched version addresses this behavior. If no results are returned,
jMeter will mark the search as failed.

Thank you,


Kayne McGladrey
Member - Technical Group
AT&T Wireless



--- LdapClient.java.backup      2003-11-05 16:31:38.000000000 -0800
+++ LdapClient.java     2003-11-06 14:24:00.000000000 -0800
@@ -65,6 +65,8 @@
 import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;

+import javax.naming.NamingEnumeration;
+
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;

@@ -136,7 +138,11 @@
     {
         SearchControls searchcontrols =
             new SearchControls(2, 1L, 0, null, false, false);
-        dirContext.search(searchBase, searchFilter, searchcontrols);
+        //dirContext.search(searchBase, searchFilter, searchcontrols);
+               NamingEnumeration result = dirContext.search(searchBase,
searchFilter, searchcontrols);
+        if (! result.hasMore()) {
+                       throw new NamingException(" [LDAP: error code 0 - No
Results Returned];");
+        }
     }

     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]









---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to