Adding users to LDAP with JMeter



In this post I will explain how a jmeter script can be written to add a large group of new users to an OpenLDAP instance.

The objective of this task is to have a script where we can create any number of users, thus automating the user creation process. For this task we will be using config elements and samplers used with LDAP instances along with other config elements that helps in achieving this task.

As the first step, we will add a config element known as "user defined variables" that will help in parametrising the necessary areas throughout the script. As the screen shot below depicts, this config element will have the connection details for the OpenLDAP instance as well as other variables we will be using for creation of the user.


We then use the LDAP Request default config element, with this element we call the server name and port hosting the LDAP instance, as well as specify the user base of the OpenDAP instance we need to connect to. Using this element helps us to generate multiple request to the target Open LDAP instance.

 

We then need to pass the credentials that we will use to login to the Open LDAP instance. For this purpose we will call the login config element as shown below.



Since we are going to create a large number of users, we need a way to generate a large set of users. With the Random Variable Config element, we can achieve this objective.

 
LDAP Request sampler is what we use next, with this sampler, we will pass the required details to create the user accounts within the OpenLDAP instance. As shown below we call all the parameters we have set within the user defined variables config element. The Entry DN is where we call the variable that we created the Random users in order to pass with each request to the Open LDAP instance.


Once these configurations are set, we need to set the required number of threads that will be run for each test. As shown below, the threads can be set at a large value to enable the creation of the required users.



The sample jmeter script can be downloaded from hear

Comments