Friday, July 4, 2014

How to use Jmeter LDAP reuest sampler to populate users to a LDAP

This post describes how to populate users to LDAP from Jmeter LDAP request sampler.

In this scenario I'm going to populate 100000 users to openLDAP.

Now lets configure the Jmeter test plan. First add a LDAP Request sampler and configure the sampler as shown in below. For user name I'm going to add username and post-fix to the username. To do that add a counter config element to get a auto increment number as shown in below screen-shot. Then assigned that variable to end of the username user${no}. I'm giving a same password for all users.

This kind of user population is more useful for test the system behaviours with large users base.

LDAP Request sampler configurations
Username: cn=admin,dc=wso2qa,dc=com
Password: qwert
Server Name:192.168.5.5
Port:389
Entry DN: cn=user${no},ou=people,dc=wso2qa,dc=com
Properties:
cn - user${no}
sn - user${no}
userPassword - user123



Then configure Tread Properties as fallows, depends on your requirement. In this scenario I'm populating 100000 users to openLDAP. Therefore configure the Tread Properties as follows.
Number of treads : 1
Ramp-up period : 1
Loop count : 100000

Then execute the jmeter script.

URL appending issue for REST invocations

Have you experienced the URL appending issue when invoking a WSO2 ESB proxy service as REST ?

In this scenario I'm using a 'JsonReqestProxy' proxy service to write into a file via vfs protocol and JsonReqestProxy is exposed as API in WSO2 API Manager. When we do Post REST invocation to write a file, you'll get URL appending error similar to the following issue.

ERROR {org.apache.synapse.core.axis2.Axis2Sender} -  Unexpected error during sending message out {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: Couldn't send the message to file : file:///home/aparna/Release_testing/abc/xyz/response.txt/services/JsonReqestProxy

In the above issue "/services/JsonReqestProxy" path has beed appended to the endpoint path, so therefore ESB cannot find the correct path and it will throw an error.

To resolve URL Appending issue you have to set the following property inside the InSequnce.
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>

Likewise, there are several HTTP Transport properties that can be configured in the WSO2 ESB.