Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 17. 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.
17.1. Overview of testing entries you can create Link kopierenLink in die Zwischenablage kopiert!
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. Use theldapmodifyutility to load the file into the directory. -
nested: Creates an LDIF file that contains heavily nested entries in a cascading or fractal tree design.
The dsctl ldifgen command creates only the LDIF file. To load the file into your Directory Server instance, use the:
-
ldapmodifyutility after you created an LDIF file using themod-loadoption -
ldapaddutility 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
# dsctl instance_name ldifgen entry_type
17.2. Creating an LDIF file with example user entries Link kopierenLink in die Zwischenablage kopiert!
Use the dsctl ldifgen users command to create an LDIF file with example user entries.
Procedure
For example, to create an LDIF file named
/tmp/users.ldifthat adds 100,000 generic users to thedc=example,dc=comsuffix, enter:dsctl instance_name ldifgen users --suffix "dc=example,dc=com" --number 100000 --generic --ldif-file=/tmp/users.ldif
# dsctl instance_name ldifgen users --suffix "dc=example,dc=com" --number 100000 --generic --ldif-file=/tmp/users.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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=groupsFor further details and other options you can use to create the LDIF file, enter:
dsctl instance_name ldifgen users --help
# dsctl instance_name ldifgen users --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Optional: Add the test entries to the directory:
ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/users.ldif
# ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/users.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow
17.3. Creating an LDIF file with example group entries Link kopierenLink in die Zwischenablage kopiert!
Use the dsctl ldifgen groups command to create an LDIF file with example user entries.
Procedure
For example, to create an LDIF file named
/tmp/groups.ldifthat adds 500 groups to theou=groups,dc=example,dc=comentry, and each group has 100 members, enter:dsctl instance_name ldifgen groups --number 500 --suffix "dc=example,dc=com" --parent "ou=groups,dc=example,dc=com" --num-members 100 --create-members --member-parent "ou=People,dc=example,dc=com" --ldif-file /tmp/groups.ldif example_group__
# dsctl instance_name ldifgen groups --number 500 --suffix "dc=example,dc=com" --parent "ou=groups,dc=example,dc=com" --num-members 100 --create-members --member-parent "ou=People,dc=example,dc=com" --ldif-file /tmp/groups.ldif example_group__Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the command also creates LDIF statements to add the user entries in
ou=People,dc=example,dc=com.For further details and other options you can use to create the LDIF file, enter:
dsctl instance_name ldifgen groups --help
# dsctl instance_name ldifgen groups --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Add the test entries to the directory:
ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/groups.ldif
# ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/groups.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow
17.4. Creating an LDIF file with an example CoS definition Link kopierenLink in die Zwischenablage kopiert!
Use the dsctl ldifgen cos-def command to create an LDIF file with a Class of Service (CoS) definition.
Procedure
For example, to create an LDIF file named
/tmp/cos-definition.ldifthat adds a classic CoS definition to theou=cos-definitions,dc=example,dc=comentry, enter:dsctl instance_name ldifgen cos-def Postal_Def --type classic --parent "ou=cos definitions,dc=example,dc=com" --cos-specifier businessCatagory --cos-template "cn=sales,cn=classicCoS,dc=example,dc=com" --cos-attr postalcode telephonenumber --ldif-file /tmp/cos-definition.ldif
# dsctl instance_name ldifgen cos-def Postal_Def --type classic --parent "ou=cos definitions,dc=example,dc=com" --cos-specifier businessCatagory --cos-template "cn=sales,cn=classicCoS,dc=example,dc=com" --cos-attr postalcode telephonenumber --ldif-file /tmp/cos-definition.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow For further details and other options you can use to create the LDIF file, enter:
dsctl instance_name ldifgen cos-def --help
# dsctl instance_name ldifgen cos-def --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Add the test entries to the directory:
ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/cos-definition.ldif
# ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/cos-definition.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow
17.5. Creating an LDIF file with example modification statements Link kopierenLink in die Zwischenablage kopiert!
Use the dsctl ldifgen mod-load command to create an LDIF file that contains update operations.
Procedure
For example, to create an LDIF file named
/tmp/modifications.ldif:dsctl instance_name ldifgen mod-load --num-users 1000 --create-users --parent="ou=People,dc=example,dc=com" --mod-attrs="sn" --add-users 10 --modrdn-users 100 --del-users 100 --delete-users --ldif-file=/tmp/modifications.ldif
# dsctl instance_name ldifgen mod-load --num-users 1000 --create-users --parent="ou=People,dc=example,dc=com" --mod-attrs="sn" --add-users 10 --modrdn-users 100 --del-users 100 --delete-users --ldif-file=/tmp/modifications.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command creates a file named
/tmp/modifications.ldiffile with the statements that do the following:-
Create an LDIF file with 1000
ADDoperations to create user entries inou=People,dc=example,dc=com. -
Modify all entries by changing their
snattributes. - Add additional 10 user entries.
-
Perform 100
MODRDNoperations. - Delete 100 entries
Delete all remaining entries at the end
For further details and other options you can use to create the LDIF file, enter:
dsctl instance_name ldifgen mod-load --help
# dsctl instance_name ldifgen mod-load --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Create an LDIF file with 1000
Optional: Add the test entries to the directory:
ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/modifications.ldif
# ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/modifications.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow
17.6. Creating an LDIF file with nested example entries Link kopierenLink in die Zwischenablage kopiert!
Use the dsctl ldifgen nested command to create an LDIF file that contains a heavily nested cascading fractal structure.
Procedure
For example, to create an LDIF file named
/tmp/nested.ldifthat adds 600 users in total in different organizational units (OU) under thedc=example,dc=comentry, with each OU containing a maximum number of 100 users, enter:dsctl instance_name ldifgen nested --num-users 600 --node-limit 100 --suffix "dc=example,dc=com" --ldif-file /tmp/nested.ldif
# dsctl instance_name ldifgen nested --num-users 600 --node-limit 100 --suffix "dc=example,dc=com" --ldif-file /tmp/nested.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow For further details and other options you can use to create the LDIF file, enter:
dsctl instance_name ldifgen nested --help
# dsctl instance_name ldifgen nested --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Add the test entries to the directory:
ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/nested.ldif
# ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/nested.ldifCopy to Clipboard Copied! Toggle word wrap Toggle overflow