"-w <passwd> "
"-f <addfile> "
"[-l <loops>] "
+ "[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>] "
"[-F]\n",
char *filename = NULL;
char *entry = NULL;
int loops = LOOPS;
+ int outerloops = 1;
int retries = RETRIES;
int delay = 0;
int friendly = 0;
tester_init( "slapd-modify" );
- while ( (i = getopt( argc, argv, "FH:h:p:D:w:f:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "FH:h:p:D:w:f:l:L:r:t:" )) != EOF ) {
switch( i ) {
case 'F':
friendly++;
}
break;
+ case 'L': /* the number of outerloops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
case 'r': /* number of retries */
if ( lutil_atoi( &retries, optarg ) != 0 ) {
usage( argv[0] );
uri = tester_uri( uri, host, port );
- do_addel( uri, manager, &passwd, entry, attrs,
- loops, retries, delay, friendly );
+ for ( i = 0; i < outerloops; i++ ) {
+ do_addel( uri, manager, &passwd, entry, attrs,
+ loops, retries, delay, friendly );
+ }
exit( EXIT_SUCCESS );
}
static void
usage( char *name )
{
- fprintf( stderr, "usage: %s [-h <host>] -p port (-D <dn>|-b <baseDN> [-f <searchfilter>]) -w <passwd> [-l <loops>] [-F] [-I] [-t delay]\n",
- name );
+ fprintf( stderr, "usage: %s "
+ "[-h <host>] "
+ "-p port "
+ "(-D <dn>|-b <baseDN> [-f <searchfilter>]) "
+ "-w <passwd> "
+ "[-l <loops>] "
+ "[-L <outerloops>] "
+ "[-F] "
+ "[-I] "
+ "[-t delay]\n",
+ name );
exit( EXIT_FAILURE );
}
struct berval pass = { 0, NULL };
int port = -1;
int loops = LOOPS;
+ int outerloops = 1;
int force = 0;
int noinit = 0;
int delay = 0;
tester_init( "slapd-bind" );
- while ( (i = getopt( argc, argv, "b:H:h:p:D:w:l:f:FIt:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "b:H:h:p:D:w:l:L:f:FIt:" )) != EOF ) {
switch( i ) {
case 'b': /* base DN of a tree of user DNs */
ber_str2bv( optarg, 0, 0, &base );
}
break;
+ case 'L': /* the number of outerloops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
case 'f':
filter = optarg;
break;
uri = tester_uri( uri, host, port );
- if ( base.bv_val != NULL ) {
- do_base( uri, &base, &pass, ( 20 * loops ), force, noinit, delay );
- } else {
- do_bind( uri, dn, &pass, ( 20 * loops ), force, noinit, NULL );
+ for ( i = 0; i < outerloops; i++ ) {
+ if ( base.bv_val != NULL ) {
+ do_base( uri, &base, &pass, loops, force, noinit, delay );
+ } else {
+ do_bind( uri, dn, &pass, loops, force, noinit, NULL );
+ }
}
+
exit( EXIT_SUCCESS );
}
"-w <passwd> "
"-e <entry> "
"[-l <loops>] "
+ "[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>] "
"[-F]\n",
char *ava = NULL;
char *value = NULL;
int loops = LOOPS;
+ int outerloops = 1;
int retries = RETRIES;
int delay = 0;
int friendly = 0;
tester_init( "slapd-modify" );
- while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:a:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:a:l:L:r:t:" )) != EOF ) {
switch( i ) {
case 'F':
friendly++;
}
break;
+ case 'L': /* the number of outerloops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
case 'r': /* number of retries */
if ( lutil_atoi( &retries, optarg ) != 0 ) {
usage( argv[0] );
uri = tester_uri( uri, host, port );
- do_modify( uri, manager, &passwd, entry, ava, value,
- loops, retries, delay, friendly );
+ for ( i = 0; i < outerloops; i++ ) {
+ do_modify( uri, manager, &passwd, entry, ava, value,
+ loops, retries, delay, friendly );
+ }
+
exit( EXIT_SUCCESS );
}
"-w <passwd> "
"-e <entry> "
"[-l <loops>] "
+ "[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>] "
"[-F]\n",
struct berval passwd = { 0, NULL };
char *entry = NULL;
int loops = LOOPS;
+ int outerloops = 1;
int retries = RETRIES;
int delay = 0;
int friendly = 0;
tester_init( "slapd-modrdn" );
- while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:l:L:r:t:" )) != EOF ) {
switch( i ) {
case 'F':
friendly++;
}
break;
+ case 'L': /* the number of outerloops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
case 'r': /* the number of retries */
if ( lutil_atoi( &retries, optarg ) != 0 ) {
usage( argv[0] );
uri = tester_uri( uri, host, port );
- do_modrdn( uri, manager, &passwd, entry,
- loops, retries, delay, friendly );
+ for ( i = 0; i < outerloops; i++ ) {
+ do_modrdn( uri, manager, &passwd, entry,
+ loops, retries, delay, friendly );
+ }
+
exit( EXIT_SUCCESS );
}
"-H <uri> | ([-h <host>] -p <port>) "
"-e <entry> "
"[-l <loops>] "
+ "[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>]\n",
- name );
+ name );
exit( EXIT_FAILURE );
}
int port = -1;
char *entry = NULL;
int loops = LOOPS;
+ int outerloops = 1;
int retries = RETRIES;
int delay = 0;
tester_init( "slapd-read" );
- while ( (i = getopt( argc, argv, "H:h:p:e:l:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "H:h:p:e:l:L:r:t:" )) != EOF ) {
switch( i ) {
case 'H': /* the server uri */
uri = strdup( optarg );
}
break;
+ case 'L': /* the number of outerloops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
case 'r': /* the number of retries */
if ( lutil_atoi( &retries, optarg ) != 0 ) {
usage( argv[0] );
uri = tester_uri( uri, host, port );
- do_read( uri, entry, ( 20 * loops ), retries, delay );
+ for ( i = 0; i < outerloops; i++ ) {
+ do_read( uri, entry, loops, retries, delay );
+ }
+
exit( EXIT_SUCCESS );
}
static void
do_search( char *uri, char *manager, struct berval *passwd,
- char *sbase, char *filter, int maxloop, int maxretries, int delay );
+ char *sbase, char *filter, int innerloop,
+ int maxretries, int delay );
static void
usage( char *name )
"-b <searchbase> "
"-f <searchfilter> "
"[-l <loops>] "
+ "[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>]\n",
name );
char *sbase = NULL;
char *filter = NULL;
int loops = LOOPS;
+ int outerloops = 1;
int retries = RETRIES;
int delay = 0;
tester_init( "slapd-search" );
- while ( (i = getopt( argc, argv, "b:D:f:H:h:l:p:w:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "b:D:f:H:h:l:L:p:w:r:t:" )) != EOF ) {
switch( i ) {
case 'H': /* the server uri */
uri = strdup( optarg );
}
break;
+ case 'L': /* number of loops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
case 'r': /* number of retries */
if ( lutil_atoi( &retries, optarg ) != 0 ) {
usage( argv[0] );
uri = tester_uri( uri, host, port );
- do_search( uri, manager, &passwd, sbase, filter,
- ( 10 * loops ), retries, delay );
+ for ( i = 0; i < outerloops; i++ ) {
+ do_search( uri, manager, &passwd, sbase, filter,
+ loops, retries, delay );
+ }
+
exit( EXIT_SUCCESS );
}
static void
do_search( char *uri, char *manager, struct berval *passwd,
- char *sbase, char *filter, int maxloop, int maxretries, int delay )
+ char *sbase, char *filter, int innerloop, int maxretries, int delay )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Search(%d): base=\"%s\", filter=\"%s\".\n",
- (long) pid, maxloop, sbase, filter );
+ (long) pid, innerloop, sbase, filter );
}
rc = ldap_sasl_bind_s( ld, manager, LDAP_SASL_SIMPLE, passwd, NULL, NULL, NULL );
exit( EXIT_FAILURE );
}
- for ( ; i < maxloop; i++ ) {
+ for ( ; i < innerloop; i++ ) {
LDAPMessage *res;
rc = ldap_search_ext_s( ld, sbase, LDAP_SCOPE_SUBTREE,
#define BINDCMD "slapd-bind"
#define MAXARGS 100
#define MAXREQS 5000
-#define LOOPS "100"
+#define LOOPS 100
+#define OUTERLOOPS "1"
#define RETRIES "0"
#define TSEARCHFILE "do_search.0"
"-d <datadir> "
"[-j <maxchild>] "
"[-l <loops>] "
+ "[-L <outerloops>] "
"-P <progdir> "
"[-r <maxretries>] "
"[-t <delay>] "
char *passwd = NULL;
char *dirname = NULL;
char *progdir = NULL;
- char *loops = LOOPS;
+ int loops = LOOPS;
+ char *outerloops = OUTERLOOPS;
char *retries = RETRIES;
char *delay = "0";
DIR *datadir;
char *sargs[MAXARGS];
int sanum;
char scmd[MAXPATHLEN];
+ char sloops[] = "18446744073709551615UL";
/* read */
char *rfile = NULL;
char *rreqs[MAXREQS];
char *rargs[MAXARGS];
int ranum;
char rcmd[MAXPATHLEN];
+ char rloops[] = "18446744073709551615UL";
/* addel */
char *afiles[MAXREQS];
int anum = 0;
char *aargs[MAXARGS];
int aanum;
char acmd[MAXPATHLEN];
+ char aloops[] = "18446744073709551615UL";
/* modrdn */
char *mfile = NULL;
char *mreqs[MAXREQS];
char *margs[MAXARGS];
int manum;
char mcmd[MAXPATHLEN];
+ char mloops[] = "18446744073709551615UL";
/* modify */
char *modfile = NULL;
char *modreqs[MAXREQS];
char *modargs[MAXARGS];
int modanum;
char modcmd[MAXPATHLEN];
+ char modloops[] = "18446744073709551615UL";
/* bind */
char *bfile = NULL;
char *breqs[MAXREQS];
char *bargs[MAXARGS];
int banum;
char bcmd[MAXPATHLEN];
+ char bloops[] = "18446744073709551615UL";
char *friendlyOpt = NULL;
tester_init( "slapd-tester" );
- while ( (i = getopt( argc, argv, "D:d:FH:h:j:l:P:p:r:t:w:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "D:d:FH:h:j:l:L:P:p:r:t:w:" )) != EOF ) {
switch( i ) {
case 'D': /* slapd manager */
manager = ArgDup( optarg );
break;
case 'l': /* the number of loops per client */
- loops = strdup( optarg );
+ if ( lutil_atoi( &loops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
+
+ case 'L': /* the number of outerloops per client */
+ outerloops = strdup( optarg );
break;
case 'P': /* prog directory */
break;
}
+ snprintf( sloops, sizeof( sloops ), "%d", 10 * loops );
+ snprintf( rloops, sizeof( rloops ), "%d", 20 * loops );
+ snprintf( aloops, sizeof( aloops ), "%d", loops );
+ snprintf( mloops, sizeof( mloops ), "%d", loops );
+ snprintf( modloops, sizeof( modloops ), "%d", loops );
+ snprintf( bloops, sizeof( bloops ), "%d", 20 * loops );
+
/*
* generate the search clients
*/
sargs[sanum++] = "-w";
sargs[sanum++] = passwd;
sargs[sanum++] = "-l";
- sargs[sanum++] = loops;
+ sargs[sanum++] = sloops;
+ sargs[sanum++] = "-L";
+ sargs[sanum++] = outerloops;
sargs[sanum++] = "-r";
sargs[sanum++] = retries;
sargs[sanum++] = "-t";
rargs[ranum++] = port;
}
rargs[ranum++] = "-l";
- rargs[ranum++] = loops;
+ rargs[ranum++] = rloops;
+ rargs[ranum++] = "-L";
+ rargs[ranum++] = outerloops;
rargs[ranum++] = "-r";
rargs[ranum++] = retries;
rargs[ranum++] = "-t";
margs[manum++] = "-w";
margs[manum++] = passwd;
margs[manum++] = "-l";
- margs[manum++] = loops;
+ margs[manum++] = mloops;
+ margs[manum++] = "-L";
+ margs[manum++] = outerloops;
margs[manum++] = "-r";
margs[manum++] = retries;
margs[manum++] = "-t";
modargs[modanum++] = "-w";
modargs[modanum++] = passwd;
modargs[modanum++] = "-l";
- modargs[modanum++] = loops;
+ modargs[modanum++] = modloops;
+ modargs[modanum++] = "-L";
+ modargs[modanum++] = outerloops;
modargs[modanum++] = "-r";
modargs[modanum++] = retries;
modargs[modanum++] = "-t";
aargs[aanum++] = "-w";
aargs[aanum++] = passwd;
aargs[aanum++] = "-l";
- aargs[aanum++] = loops;
+ aargs[aanum++] = aloops;
+ aargs[aanum++] = "-L";
+ aargs[aanum++] = outerloops;
aargs[aanum++] = "-r";
aargs[aanum++] = retries;
aargs[aanum++] = "-t";
bargs[banum++] = port;
}
bargs[banum++] = "-l";
- bargs[banum++] = loops;
+ bargs[banum++] = bloops;
+ bargs[banum++] = "-L";
+ bargs[banum++] = outerloops;
#if 0
bargs[banum++] = "-r";
bargs[banum++] = retries;