Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 922538

Summary: improve dbgen rdn generation, output
Product: Red Hat Enterprise Linux 7 Reporter: Nathan Kinder <nkinder>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: low    
Version: 7.0CC: amsharma, jgalipea, nhosoi, rmeggins
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.6-18.el7 Doc Type: Enhancement
Doc Text:
Feature: Added these options to dbgen.pl -o filename output file can use "-" to output to stdout -z extra objectclasses to add to base used in -O - should be AUXILIARY or SUB -j 0 pad numbers used in RDN to this many digits e.g. with 4 1 becomes 0001 -m naming attribute for RDN -n number of entries to generate -b beginning number for RDN (default 1 - ending number is -n value) Reason: Different load testing tools require different database values. This gives dbgen.pl the flexibility to generate LDIF databases for those different tools (such as ldclt). Result (if any):
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:06:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 970750    
Bug Blocks:    

Description Nathan Kinder 2013-03-17 19:07:19 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/612

Need to allow dbgen to create rdns like uid=000001 instead of uid=1 - that is, zero pad to some number of digits
Need to specify the rdn value for dbgen to use
Allow dbgen to output to stdout - e.g. for piping into bzip2

Comment 1 Rich Megginson 2013-10-01 23:25:59 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata).  When the errata is created, the bugs should be automatically moved back to ON_QA.

Comment 3 Amita Sharma 2014-01-31 09:17:35 UTC
Hi Rich,

Few questions ::
What all have been fixed under this bug ::
===========================================
a. zero pad to some number of digits
b. Need to specify the rdn value for dbgen to use
c. Allow dbgen to output to stdout
d. -j is for zero pad, I used dbgen.pl -o /export/testdb.ldif -n 10 -j 4 -v but it did not give me desired uid as 00001.

Request you to please share one liner dbgen.pl command which can cover the fixes validation.

Thank you,
-Ami

Comment 4 Rich Megginson 2014-01-31 15:10:09 UTC
Something is broken - reopening

Comment 5 Rich Megginson 2014-02-03 23:04:12 UTC
changing to POST since 970750 is in POST now

Comment 6 Amita Sharma 2014-02-04 10:51:20 UTC
Hi Noriko/Rich,

Request to please reply ::
Few questions ::
What all have been fixed under this bug ::
===========================================
a. zero pad to some number of digits
b. Need to specify the rdn value for dbgen to use
c. Allow dbgen to output to stdout
d. -j is for zero pad, I used dbgen.pl -o /export/testdb.ldif -n 10 -j 4 -v but it did not give me desired uid as 00001.

Request you to please share one liner dbgen.pl command which can cover the fixes validation.

Thanks,
Ami

Comment 7 Nathan Kinder 2014-02-04 11:16:31 UTC
(In reply to Amita Sharma from comment #6)
> Hi Noriko/Rich,
> 
> Request to please reply ::
> Few questions ::
> What all have been fixed under this bug ::
> ===========================================
> a. zero pad to some number of digits
> b. Need to specify the rdn value for dbgen to use
> c. Allow dbgen to output to stdout
> d. -j is for zero pad, I used dbgen.pl -o /export/testdb.ldif -n 10 -j 4 -v
> but it did not give me desired uid as 00001.
> 
> Request you to please share one liner dbgen.pl command which can cover the
> fixes validation.
> 
> Thanks,
> Ami

From looking at the patch, the zero padding option (-j) is only used when you are also specifying the begin number option (-b):

    -b beginning number for RDN (default 1 - ending number is -n value)

It seems like we should still allow zero padding even when a beginning number isn't explicitly specified.

Comment 8 Rich Megginson 2014-02-04 15:35:37 UTC
(In reply to Nathan Kinder from comment #7)
> (In reply to Amita Sharma from comment #6)
> > Hi Noriko/Rich,
> > 
> > Request to please reply ::
> > Few questions ::
> > What all have been fixed under this bug ::
> > ===========================================
> > a. zero pad to some number of digits
> > b. Need to specify the rdn value for dbgen to use
> > c. Allow dbgen to output to stdout
> > d. -j is for zero pad, I used dbgen.pl -o /export/testdb.ldif -n 10 -j 4 -v
> > but it did not give me desired uid as 00001.
> > 
> > Request you to please share one liner dbgen.pl command which can cover the
> > fixes validation.
> > 
> > Thanks,
> > Ami
> 
> From looking at the patch, the zero padding option (-j) is only used when
> you are also specifying the begin number option (-b):
> 
>     -b beginning number for RDN (default 1 - ending number is -n value)
> 
> It seems like we should still allow zero padding even when a beginning
> number isn't explicitly specified.

The -b flag also means "use a numeric value for RDN".  We don't have another switch to say "use a numeric value for RDN".  So I guess if there is a bug here, it's that the -b usage text should not have a default value, since there is not a default value.  And, using -j is ignored if not also using -b.  Note that -n is for the number of entries, regardless of the RDN style.

Here is a one liner to test:

$ dbgen.pl -b 1 -j 4 -o - -n 1 -x -y|grep \^dn
dn: uid=0001,ou=People,dc=example,dc=com
$ dbgen.pl -b 1 -j 10 -o - -n 1 -x -y|grep \^dn
dn: uid=0000000001,ou=People,dc=example,dc=com

Finally, the main reason why these changes were done was to make dbgen.pl work much better with ldclt and other testing tools:
* ldclt wants zero padded numeric RDNs (unless you actually provide files containing rdn values)
* output to -o means you can output to stdout with -o -, which means you can pipe the output to ldapmodify or ldif2db or gzip/bzip2, which is really nice when you have a 100MB of ldif data

It's not really expected that the typical end user will use dbgen.pl, mostly people doing performance testing.

Comment 9 Nathan Kinder 2014-02-04 15:41:59 UTC
(In reply to Rich Megginson from comment #8)
> (In reply to Nathan Kinder from comment #7)
> 
> The -b flag also means "use a numeric value for RDN".  We don't have another
> switch to say "use a numeric value for RDN".  So I guess if there is a bug
> here, it's that the -b usage text should not have a default value, since
> there is not a default value.  And, using -j is ignored if not also using
> -b.  Note that -n is for the number of entries, regardless of the RDN style.
> 
> 
> It's not really expected that the typical end user will use dbgen.pl, mostly
> people doing performance testing.

A separate bug should be filed against RHEL 7.1 to improve the usage output.  I agree that this is really a low priority, so we should file it against RHEL 7.1 for now.  Amita - please file this bug.

This bug fix should be verified using the command mentioned in comment#8.

Comment 10 Amita Sharma 2014-02-05 06:18:22 UTC
Thank you Rich and Nathan.

[root@dhcp201-149 ~]# dbgen.pl -b 1 -j 4 -o - -n 1 -x -y | grep -i "dn: uid=0001,ou=People,dc=example,dc=com"
dn: uid=0001,ou=People,dc=example,dc=com

[root@dhcp201-149 ~]# dbgen.pl -b 1 -j 10 -o - -n 1 -x -y | grep -i "dn: uid=0000000001,ou=People,dc=example,dc=com"
dn: uid=0000000001,ou=People,dc=example,dc=com

Hence, marking this bug as VERIFIED.

New bug for RHEL7.1 :: https://bugzilla.redhat.com/show_bug.cgi?id=1061572

Comment 11 Amita Sharma 2014-05-12 10:06:54 UTC
[RHEL7]
[svrbld@dhcp201-149 basic]$ svn ci basic.sh -m "test case added for bug922538"
Sending        basic.sh
Transmitting file data .
Committed revision 8660.
[TET]
[amsharma@amsharma basic]$ svn ci basic.sh -m "test case added for bug922538"
Sending        basic.sh
Transmitting file data .
Committed revision 8661.

Comment 12 Ludek Smid 2014-06-13 10:06:40 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.