Chapter 23. Creating Test Entries


The dsctl ldifgen command creates LDIF files with different types of test entries. For example, you can use this LDIF file to populate a test instance or a sub-tree to test the performance of Directory Server with the example entries.
You can pass one of the following entry type arguments to dsctl ldifgen:
  • users: Creates an LDIF file that contains user entries.
  • groups: Creates an LDIF file that contains static group and member entries.
  • cos-def: Creates an LDIF file that either contains a classic pointer or an indirect Class of Service (CoS) definition.
  • cos-template: Creates an LDIF file that contains a CoS template.
  • roles: Creates an LDIF file that contains managed, filtered, or indirect role entries.
  • mod-load: Creates an LDIF file that contains modify operations. Import this file using the ldapmodify utility.
  • nested: Creates an LDIF file that contains heavily nested entries in a cascading or fractal tree design.

Note

The dsctl ldifgen command creates only the LDIF file. To load the file into your Directory Server instance, use the:
  • ldapmodify utility after you created an LDIF file using the mod-load option
  • ldapadd utility for all other options
Except for the nested entry type, if you do not provide any command line options, the dsctl ldifgen command uses an interactive mode:
# dsctl instance_name ldifgen entry_type

23.1. Creating an LDIF File with Example User Entries

Use the dsctl ldifgen users command to create an LDIF file with example user entries. For example, to create an LDIF file named /tmp/users.ldif that adds 100,000 generic users to the dc=example,dc=com suffix, enter:
# dsctl instance_name ldifgen users --suffix "dc=example,dc=com" --number 100000 --generic --ldif-file=/tmp/users.ldif
Note that the command creates the following organizational units (OU) and randomly assigns the users to these OUs:
  • ou=accounting
  • ou=product development
  • ou=product testing
  • ou=human resources
  • ou=payroll
  • ou=people
  • ou=groups
For further details and other options you can use to create the LDIF file, enter:
# dsctl instance_name ldifgen users --help
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.