Sun ONE Directory Server Resource Kit 5.2 Tools Reference |
Chapter 19
The Custom Schema LDIF Generator ToolThe ldifgen tool creates Lightweight Directory Access Protocol (LDAP) entries with randomly generated content. The entries can then be loaded into an LDAP server to create a test directory. This chapter provides instructions on how to use the command. It contains the following sections:
OverviewThe ldifgen (LDIF generator) tool creates LDAP entries with randomly generated content. The output is generated as LDIF (LDAP Data Interchange Format) text that can be loaded into an LDAP server to create a test directory. As with the dbgen.pl script (detailed in Chapter 18, "The Standard Schema LDIF Generator Tool"), this generated file can be used to run performance tests.
After generating the LDIF file, you may use the ldapmodify tool to import both the schema and the generated entries. (See Chapter 4, "The ldapmodify Tool" for information.)
Note
The xyzmember schema defines this custom object class and is generated by one of the command-line options. See Options for more information.
The DNs of generated entries fit within the minimal hierarchy shown in Figure 19-1. The structure of this tree is not configurable although the number of leaf entries is determined by the -n option on the command-line.
Figure 19-1 LDAP Directory Hierarchy Created by ldifgen
The ldifgen 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.
Command UsageThe 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 Sample Output.)
Syntax
The syntax of the ldifgen tool on the command-line can take one of two forms:
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 Sun ONE 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, "The ldapmodify Tool" for information.)
- filename.ldif is a writable file that will contain the LDIF output.
Options
The ldifgen options and parameters are described in Table 19-1. Running the ldifgen command without any options or parameters will display the brief usage help text.
Table 19-1 Command-Line Options for ldifgen
Option
Parameter
Purpose
-s
Generates the version of the custom schema corresponding to your directory. The schema is given as an LDIF update statement that may be loaded using the ldapmodify command. See Chapter 4, "The ldapmodify Tool" for information.
-n
Specifies the number of leaf entries.
none
Display the usage help text that briefly describes all options.
Sample OutputCode Example 19-1 shows a sample output of the ldifgen tool. Only the first leaf entry is shown in its entirety. Some attribute values have been shortened to fit on a single line.