3.1. Generating Test Data

When you install OpenDJ, you have the option of importing sample data generated during the installation. This procedure demonstrates how to generate LDIF using the make-ldif command.

Procedure 3.1. To Generate Test LDIF Data

The make-ldif command uses templates to provide sample data. Default templates are located in the OpenDJ/config/MakeLDIF/ directory. The example.template file can be used to create a suffix with entries of the type inetOrgPerson. You can do the equivalent in OpenDJ Control Panel (Directory Data > New Base DN... > Import Automatically Generated Example Data).

  1. Write a file to act as the template for your generated LDIF.

    The resulting test data template depends on what data you expect to encounter in production. Base your work on your knowledge of the production data, and on the sample template, OpenDJ/config/MakeLDIF/example.template, and associated data.

    See make-ldif.template for reference information about template files.

  2. Create additional data files for the content in your template to be selected randomly from a file, rather than generated by an expression.

    Additional data files are located in the same directory as your template file.

  3. Decide whether you want to generate the same test data each time you run the make-ldif command with your template.

    If so, provide the same randomSeed integer each time you run the command.

  4. Before generating a very large LDIF file, make sure you have enough space on disk.

  5. Run the make-ldif command to generate your LDIF file.

    $ make-ldif
     --randomSeed 0
     --templateFile /path/to/my.template
     --ldifFile /path/to/generated.ldif
    Processed 1000 entries
    Processed 2000 entries
    ...
    Processed 10000 entries
    LDIF processing complete.  10003 entries written