ldcltU.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2007 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #include <stdio.h>
  13. /*
  14. * usage: ldclt [-qQvV] [-E <max errors>]
  15. * [-b <base DN>] [-h <host>] [-p <port>] [-t <timeout>]
  16. * [-D <bind DN>] [-w <passwd>] [-o <SASL option>]
  17. * [-e <execParams>] [-a <max pending>]
  18. * [-n <nb threads>] [-i <nb times>] [-N <nb samples>]
  19. * [-I <err number>] [-T <total>]
  20. * [-r <low> -R <high>]
  21. * [-f <filter>] [-s <scope>]
  22. * [-S <slave>] [-P<master port>]
  23. * [-W <waitsec>] [-Z <certfile>]
  24. *
  25. * This tool is a ldap client targeted to validate the reliability of
  26. * the product under test under hard use.
  27. *
  28. * The valid options are:
  29. * -a Asynchronous mode, with max pending operations.
  30. * -b Give the base DN to use. Default "dc=example,dc=com".
  31. * -D Bind DN. See -w
  32. * -E Max errors allowed. Default 1000.
  33. * -e Execution parameters:
  34. * abandon : abandon asyncronous search requests.
  35. * add : ldap_add() entries.
  36. * append : append entries to the genldif file.
  37. * ascii : ascii 7-bits strings.
  38. * attreplace=name:mask : replace attribute of existing entry.
  39. * attrlist=name:name:name : specify list of attribs to retrieve
  40. * attrsonly=0|1 : ldap_search() parameter. Set 0 to read values.
  41. * bindeach : ldap_bind() for each operation.
  42. * bindonly : only bind/unbind, no other operation is performed.
  43. * close : will close() the fd, rather than ldap_unbind().
  44. * cltcertname=name : name of the SSL client certificate
  45. * commoncounter : all threads share the same counter.
  46. * counteach : count each operation not only successful ones.
  47. * delete : ldap_delete() entries.
  48. * deref[=deref:attr] : This option works with -e add and -e esearch.
  49. * : With -e esearch:
  50. * : adds dereference control.
  51. * : if =deref:attr is given, the deref and attr
  52. * : pair is set to the control request.
  53. * : if not given, "secretary:cn" is set.
  54. * : With -e add:
  55. * : adds "secretary" attr to the netOrgPerson
  56. * : entries to prepare for the search with the
  57. * : default "secretary:cn" dereference control.
  58. * dontsleeponserverdown : will loop very fast if server down.
  59. * emailPerson : objectclass=emailPerson (-e add only).
  60. * esearch : exact search.
  61. * genldif=filename : generates a ldif file
  62. * imagesdir=path : specify where are the images.
  63. * incr : incremental values.
  64. * inetOrgPerson : objectclass=inetOrgPerson (-e add only).
  65. * keydbfile=file : filename of the key database
  66. * keydbpin=password : password for accessing the key database
  67. * noglobalstats : don't print periodical global statistics
  68. * noloop : does not loop the incremental numbers.
  69. * object=filename : build object from input file
  70. * person : objectclass=person (-e add only).
  71. * random : random filters, etc...
  72. * randomattrlist=name:name:name : random select attrib in the list
  73. * randombase : random base DN.
  74. * randombaselow=value : low value for random generator.
  75. * randombasehigh=value : high value for random generator.
  76. * randombinddn : random bind DN.
  77. * randombinddnfromfile=file : retrieve bind DN & passwd from file
  78. * randombinddnlow=value : low value for random generator.
  79. * randombinddnhigh=value : high value for random generator.
  80. * rdn=attrname:value : alternate for -f.
  81. * referral=on|off|rebind : change referral behaviour.
  82. * scalab01 : activates scalab01 scenario.
  83. * scalab01_cnxduration : maximum connection duration.
  84. * scalab01_maxcnxnb : modem pool size.
  85. * scalab01_wait : sleep() between 2 attempts to connect.
  86. * smoothshutdown : main thread waits till the worker threads exit.
  87. * string : create random strings rather than random numbers.
  88. * v2 : ldap v2.
  89. * withnewparent : rename with newparent specified as argument.
  90. * -f Filter for searches.
  91. * -h Host to connect. Default "localhost".
  92. * -i Number of times inactivity allowed. Default 3 (30 seconds)
  93. * -I Ignore errors (cf. -E). Default none.
  94. * -n Number of threads. Default 10.
  95. * -N Number of samples (10 seconds each). Default infinite.
  96. * -o SASL Option.
  97. * -p Server port. Default 389.
  98. * -P Master port (to check replication). Default 16000.
  99. * -q Quiet mode. See option -I.
  100. * -Q Super quiet mode.
  101. * -r Range's low value.
  102. * -R Range's high value.
  103. * -s Scope. May be base, subtree or one. Default subtree.
  104. * -S Slave to check.
  105. * -t LDAP operations timeout. Default 30 seconds.
  106. * -T Total number of operations per thread. Default infinite.
  107. * -v Verbose.
  108. * -V Very verbose.
  109. * -w Bind passwd. See -D.
  110. * -W Wait between two operations. Default 0 seconds.
  111. * -Z certfile. Turn on SSL and use certfile as the certificate DB
  112. */
  113. void usage ()
  114. {
  115. (void) printf ("\n");
  116. (void) printf ("usage: ldclt [-qQvV] [-E <max errors>]\n");
  117. (void) printf (" [-b <base DN>] [-h <host>] [-p <port>] [-t <timeout>]\n");
  118. (void) printf (" [-D <bind DN>] [-w <passwd>] [-o <SASL option>]\n");
  119. (void) printf (" [-e <execParams>] [-a <max pending>]\n");
  120. (void) printf (" [-n <nb threads>] [-i <nb times>] [-N <nb samples>]\n");
  121. (void) printf (" [-I <err number>] [-T <total>]\n");
  122. (void) printf (" [-r <low> -R <high>]\n");
  123. (void) printf (" [-f <filter>] [-s <scope>]\n");
  124. (void) printf (" [-S <slave>] [-P<master port>]\n");
  125. (void) printf (" [-W <waitsec>] [-Z <certfile>]\n");
  126. (void) printf ("\n");
  127. (void) printf (" This tool is a ldap client targeted to validate the reliability of\n");
  128. (void) printf (" the product under test under hard use.\n");
  129. (void) printf ("\n");
  130. (void) printf (" The valid options are:\n");
  131. (void) printf (" -a Asynchronous mode, with max pending operations.\n");
  132. (void) printf (" -b Give the base DN to use. Default \"o=sun,c=us\".\n");
  133. (void) printf (" -D Bind DN. See -w\n");
  134. (void) printf (" -E Max errors allowed. Default 1000.\n");
  135. (void) printf (" -e Execution parameters:\n");
  136. (void) printf (" abandon : abandon async search requests.\n");
  137. (void) printf (" add : ldap_add() entries.\n");
  138. (void) printf (" append : append entries to the genldif file.\n");
  139. (void) printf (" ascii : ascii 7-bits strings.\n");
  140. (void) printf (" attreplacefile=attrname:<file name> : replace attribute with given file content.\n");
  141. (void) printf (" attreplace=name:mask : replace attribute of existing entry.\n");
  142. (void) printf (" attrlist=name:name:name : specify list of attribs to retrieve\n");
  143. (void) printf (" attrsonly=0|1 : ldap_search() parameter. Set 0 to read values.\n");
  144. (void) printf (" bindeach : ldap_bind() for each operation.\n");
  145. (void) printf (" bindonly : only bind/unbind, no other operation is performed.\n");
  146. (void) printf (" close : will close() the fd, rather than ldap_unbind().\n");
  147. (void) printf (" cltcertname=name : name of the SSL client certificate\n");
  148. (void) printf (" commoncounter : all threads share the same counter.\n");
  149. (void) printf (" counteach : count each operation not only successful ones.\n");
  150. (void) printf (" delete : ldap_delete() entries.\n");
  151. (void) printf (" deref[=deref:attr]: This option works with -e add and esearch.\n");
  152. (void) printf (" : With -e esearch:\n");
  153. (void) printf (" : adds dereference control.\n");
  154. (void) printf (" : if =deref:attr is given, the deref and attr\n");
  155. (void) printf (" : pair is set to the control request.\n");
  156. (void) printf (" : if not given, \"secretary:cn\" is set.\n");
  157. (void) printf (" : With -e add:\n");
  158. (void) printf (" : adds \"secretary\" attr to the inetOrgPerson\n");
  159. (void) printf (" : entries to prepare for -e esearch using\n");
  160. (void) printf (" : the default deref attr pair.\n");
  161. (void) printf (" dontsleeponserverdown : will loop very fast if server down.\n");
  162. (void) printf (" emailPerson : objectclass=emailPerson (-e add only).\n");
  163. (void) printf (" esearch : exact search.\n");
  164. (void) printf (" genldif=filename : generates a ldif file\n");
  165. (void) printf (" imagesdir=path : specify where are the images.\n");
  166. (void) printf (" incr : incremental values.\n");
  167. (void) printf (" inetOrgPerson : objectclass=inetOrgPerson (-e add only).\n");
  168. (void) printf (" keydbfile=file : filename of the key database\n");
  169. (void) printf (" keydbpin=password : password for accessing the key database\n");
  170. (void) printf (" noglobalstats : don't print periodical global statistics\n");
  171. (void) printf (" noloop : does not loop the incremental numbers.\n");
  172. (void) printf (" object=filename : build object from input file\n");
  173. (void) printf (" person : objectclass=person (-e add only).\n");
  174. (void) printf (" random : random filters, etc...\n");
  175. (void) printf (" randomattrlist=name:name:name : random select attrib in the list\n");
  176. (void) printf (" randombase : random base DN.\n");
  177. (void) printf (" randombaselow=value : low value for random generator.\n");
  178. (void) printf (" randombasehigh=value : high value for random generator.\n");
  179. (void) printf (" randombinddn : random bind DN.\n");
  180. (void) printf (" randombinddnfromfile=file : retrieve bind DN & passwd from file\n");
  181. (void) printf (" randombinddnlow=value : low value for random generator.\n");
  182. (void) printf (" randombinddnhigh=value : high value for random generator.\n");
  183. (void) printf (" rdn=attrname:value : alternate for -f.\n");
  184. (void) printf (" referral=on|off|rebind : change referral behaviour.\n");
  185. (void) printf (" scalab01 : activates scalab01 scenario.\n");
  186. (void) printf (" scalab01_cnxduration : maximum connection duration.\n");
  187. (void) printf (" scalab01_maxcnxnb : modem pool size.\n");
  188. (void) printf (" scalab01_wait : sleep() between 2 attempts to connect.\n");
  189. (void) printf (" smoothshutdown : main thread waits till the worker threads exit.\n");
  190. (void) printf (" string : create random strings rather than random numbers.\n");
  191. (void) printf (" v2 : ldap v2.\n");
  192. (void) printf (" withnewparent : rename with newparent specified as argument.\n");
  193. (void) printf (" randomauthid : random SASL Authid.\n");
  194. (void) printf (" randomauthidlow=value : low value for random SASL Authid.\n");
  195. (void) printf (" randomauthidhigh=value : high value for random SASL Authid.\n");
  196. (void) printf (" -f Filter for searches.\n");
  197. (void) printf (" -h Host to connect. Default \"localhost\".\n");
  198. (void) printf (" -i Number of times inactivity allowed. Default 3 (30 seconds)\n");
  199. (void) printf (" -I Ignore errors (cf. -E). Default none.\n");
  200. (void) printf (" -n Number of threads. Default 10.\n");
  201. (void) printf (" -N Number of samples (10 seconds each). Default infinite.\n");
  202. (void) printf (" -o SASL Option.\n");
  203. (void) printf (" -p Server port. Default 389.\n");
  204. (void) printf (" -P Master port (to check replication). Default 16000.\n");
  205. (void) printf (" -q Quiet mode. See option -I.\n");
  206. (void) printf (" -Q Super quiet mode.\n");
  207. (void) printf (" -r Range's low value.\n");
  208. (void) printf (" -R Range's high value.\n");
  209. (void) printf (" -s Scope. May be base, subtree or one. Default subtree.\n");
  210. (void) printf (" -S Slave to check.\n");
  211. (void) printf (" -t LDAP operations timeout. Default 30 seconds.\n");
  212. (void) printf (" -T Total number of operations per thread. Default infinite.\n");
  213. (void) printf (" -v Verbose.\n");
  214. (void) printf (" -V Very verbose.\n");
  215. (void) printf (" -w Bind passwd. See -D.\n");
  216. (void) printf (" -W Wait between two operations. Default 0 seconds.\n");
  217. (void) printf (" -Z certfile. Turn on SSL and use certfile as the certificate DB\n");
  218. (void) printf ("\n");
  219. } /* usage() */
  220. /* End of file */