Previous     Contents     Index     Next     
iPlanet Directory Server Resource Kit 5.1 Tools Reference



Chapter 17   ldifgen


The ldifgen (LDIF generator) tool creates LDAP entries with randomly generated content. The output is LDIF (LDAP Data Interchange Format) text that can be loaded into an LDAP server to create a test directory. As with the dbgen.pl tool, this generated directory can be used to run performance tests.

This tool creates a simple directory structure with leaf entries belonging to the xyzmember object class. The schema for this custom object class is given by one of the command-line options. You may then use the ldapmodify tool to import both this schema and the generated entries.

This chapter contains the following sections:



Command Usage

The ldifgen tool generates entries that are xyzmember objects. This custom object class acts as a template, and the tool generates random values for each of its attributes. If you do not already have the schema for this object class, use the -S option to generate the version corresponding to your directory. You will need to load this schema entry into the directory before loading the generated entries. An example of this class and its attributes is shown in "Example and Sample Output".

The DNs of generated entries fit within the minimal hierarchy shown in the following diagram. The structure of this tree is not configurable. Only the number of leaf entries is determined by the -n option on the command line.

Figure 17-1    LDAP Directory Hierarchy Created by ldifgen


The tool generates the parent entries so that its output is a complete and valid LDAP directory hierarchy expressed in LDIF text. The three parent entries do not contain any attributes and are always the same.



Note The DNs of generated entries use sequential numbering to ensure that no two entries of the same invocation will be identical.

However, due to the implementation of randomizing functions on certain platforms, the ldifgen tool may generate exactly the same attribute values every time it is invoked. While the values are seemingly random, they may in fact be identical to the other entries with the same DN created by different invocations of the command.




Syntax

The syntax of the ldifgen command has the following two forms. The tool uses the standard output, so you need to redirect this to a file in order to save the LDIF text:

ldifgen -n number > filename .ldif

ldifgen -S version > filename .ldif

Where:

  • number is the number of leaf entries that will be generated, in addition to the 3 hierarchical entries that are always present.

  • version is the major version number, either 4 or 5, of the iPlanet Directory Server instance into which the generated entries will be loaded. Using this option, the ldifgen tool will output the corresponding schema for the xyzmember class and its attributes. The schema is given as an LDIF update statement that may be loaded using the ldapmodify command (see Chapter 4).

  • filename .ldif is a writable file that will contain the LDIF output.

Running the ldifgen command without any options or parameters will display the brief usage help text.



Example and Sample Output



The following example shows the output of the ldifgen tool. Only the first leaf entry is shown in full, and some attribute values have been shortened to fit on a single line:

$ ldifgen -n 3

dn: C=US
c: US
objectclass: top
objectclass: country

dn: O=XYZ,C=US
o: XYZ
objectclass: top
objectclass: organization

dn: OU=1,O=XYZ,C=US
ou: 1
objectclass: top
objectclass: organizationunit

dn: UID=0,OU=1,O=XYZ,C=US
objectclass: top
objectclass: xyzmember
uid: 0
sponsorId: 18080291083208191342756198584726724745154694425751126868
cn: fozepdkdnqlhfejdzksc cfykdxnlorwvfwavbmyq
login: cl1ldo51y5fam665jwlxvhpxdnyuj6z2y6dhl88p
userpassword: 00000000000000000000000000000000000000000000000000000
postalCode: 0080227
st: jq
cityCode: iwk
city: 49i0zztw1dsrvw3vvcb8siyhghio0aea921ys00z
cityIds: 3yw4lqpm870qv4d1clwi10ig9pk7gaw9zykquf2sc99x3c5l4rtvx22whs
l: tb3y0tuky2
signId: 33382363622400408168917651334147477905498730992720714579805
createTimestamp: 20000101000001Z
modifyTimestamp: 20000101000001Z
mail: cl1ldo51y5fam665jwlxvhpxdnyuj6z2y6dhl88p@xyz.com
topics: gb1cuwjzi0083xogiyleo3kae3w841xaios2r27zsddlg77ovit9rjqvssu
searchFlag: jx2rblz8tddbgg2ndzhy7gep5aqosa0hdtefkjt3mxk93cmn19regb9
myPageTitle: 6wwavgv5qeei1ohbq9ox9l1fn1wohc4tyqtzdeutjy1qcpr8olvnx2
customization: xy01vjqy4qxde49wjrayivb5nalnvg9ykzplplpj1s2ln1nwyn0n
defBookmarks: wa7mz2eudtjkcbb5jornhi0bq5ie5jn7zkj4c3pvny55g6050xi7l
hints: ly8qoxl6r0rk42faell48ahkpvrfy3gp7u6mhxiyngoxotet4p3jpr9ksq5w
birthdate: zbcxbo9jbxn4j27y1bxc76lmnkx6g886qatr48gl
flags: buvl2tptucvr8mkmcnyjlwf1dyjnc5zdpkoh33h4li1kvbcx4gmgirn1vcfx
sourceAppId: 8khnubb4lyewm5m7n4bha3nzlhq6jbahlhbmysw9w0w8vom8j3wzwp
timeZone: 62
c: fo
pageRefresh: 3647
layout: ocra2dp3r1igak6wzkq2bgeo6d8zuog86xpegknebbkrlgtb7938f72rq0g
colors: u356qkqdu4hb5r8heryrrr5w4yu040h59ch62y92sgj3dhqxyeefbaile2c
givenName: fozepdkdnqlhfejdzksc
sn: cfykdxnlorwvfwavbmyq
address: 8jz817ktvj1t5a2ohjc53wrlczwg7evl30zux9tyykhtkqo7f638s0zv5m
phone: 63714139647-45991442
occupation: opsxdliwvjmemuapxydvewsddzwznyfcozztmjsi
householdIncome: 2620083169
gender: F
friend: uid=0,ou=1,o=xyz

dn: UID=1,OU=1,O=XYZ,C=US
objectclass: top
objectclass: xyzmember
uid: 1
...

dn: UID=2,OU=1,O=XYZ,C=US
objectclass: top
objectclass: xyzmember
uid: 2
...

Previous     Contents     Index     Next     
Copyright 2002 Sun Microsystems, Inc.. All rights reserved.

Last Updated April 15, 2002