static void
do_addel( char *uri, char *manager, struct berval *passwd,
char *dn, LDAPMod **attrs, int maxloop, int maxretries, int delay,
- int friendly );
+ int friendly, int chaserefs );
static void
usage( char *name )
"[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>] "
- "[-F]\n",
+ "[-F] "
+ "[-C]\n",
name );
exit( EXIT_FAILURE );
}
int retries = RETRIES;
int delay = 0;
int friendly = 0;
+ int chaserefs = 0;
LDAPMod **attrs = NULL;
tester_init( "slapd-modify" );
- while ( (i = getopt( argc, argv, "FH:h:p:D:w:f:l:L:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "CFH:h:p:D:w:f:l:L:r:t:" )) != EOF ) {
switch( i ) {
+ case 'C':
+ chaserefs++;
+ break;
+
case 'F':
friendly++;
break;
for ( i = 0; i < outerloops; i++ ) {
do_addel( uri, manager, &passwd, entry, attrs,
- loops, retries, delay, friendly );
+ loops, retries, delay, friendly, chaserefs );
}
exit( EXIT_SUCCESS );
int maxloop,
int maxretries,
int delay,
- int friendly
-)
+ int friendly,
+ int chaserefs )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON : LDAP_OPT_OFF );
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Add/Delete(%d): entry=\"%s\".\n",
#define LOOPS 100
static int
-do_bind( char *uri, char *dn, struct berval *pass, int maxloop, int force, int noinit, LDAP **ldp );
+do_bind( char *uri, char *dn, struct berval *pass, int maxloop,
+ int force, int chaserefs, int noinit, LDAP **ldp );
static int
-do_base( char *uri, struct berval *base, struct berval *pass, int maxloop, int force, int noinit, int delay );
+do_base( char *uri, struct berval *base, struct berval *pass, int maxloop,
+ int force, int chaserefs, int noinit, int delay );
/* This program can be invoked two ways: if -D is used to specify a Bind DN,
* that DN will be used repeatedly for all of the Binds. If instead -b is used
"[-l <loops>] "
"[-L <outerloops>] "
"[-F] "
+ "[-C] "
"[-I] "
"[-t delay]\n",
name );
int loops = LOOPS;
int outerloops = 1;
int force = 0;
+ int chaserefs = 0;
int noinit = 0;
int delay = 0;
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 'b': /* base DN of a tree of user DNs */
+ ber_str2bv( optarg, 0, 0, &base );
+ break;
- case 'H': /* the server uri */
- uri = strdup( optarg );
- break;
+ case 'C':
+ chaserefs++;
+ break;
- case 'h': /* the servers host */
- host = strdup( optarg );
- break;
+ case 'H': /* the server uri */
+ uri = strdup( optarg );
+ break;
- case 'p': /* the servers port */
- if ( lutil_atoi( &port, optarg ) != 0 ) {
- usage( argv[0] );
- }
- break;
+ case 'h': /* the servers host */
+ host = strdup( optarg );
+ break;
- case 'D':
- dn = strdup( optarg );
- break;
+ case 'p': /* the servers port */
+ if ( lutil_atoi( &port, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
- case 'w':
- pass.bv_val = strdup( optarg );
- pass.bv_len = strlen( optarg );
- break;
+ case 'D':
+ dn = strdup( optarg );
+ break;
- case 'l': /* the number of loops */
- if ( lutil_atoi( &loops, optarg ) != 0 ) {
- usage( argv[0] );
- }
- break;
+ case 'w':
+ pass.bv_val = strdup( optarg );
+ pass.bv_len = strlen( optarg );
+ break;
- case 'L': /* the number of outerloops */
- if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
- usage( argv[0] );
- }
- break;
+ case 'l': /* the number of loops */
+ if ( lutil_atoi( &loops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
- case 'f':
- filter = optarg;
- break;
+ case 'L': /* the number of outerloops */
+ if ( lutil_atoi( &outerloops, optarg ) != 0 ) {
+ usage( argv[0] );
+ }
+ break;
- case 'F':
- force++;
- break;
+ case 'f':
+ filter = optarg;
+ break;
- case 'I':
- /* reuse connection */
- noinit++;
- break;
+ case 'F':
+ force++;
+ break;
- case 't':
- /* sleep between binds */
- if ( lutil_atoi( &delay, optarg ) != 0 ) {
- usage( argv[0] );
- }
- break;
+ case 'I':
+ /* reuse connection */
+ noinit++;
+ break;
- default:
+ case 't':
+ /* sleep between binds */
+ if ( lutil_atoi( &delay, optarg ) != 0 ) {
usage( argv[0] );
- break;
+ }
+ break;
+
+ default:
+ usage( argv[0] );
+ break;
}
}
for ( i = 0; i < outerloops; i++ ) {
if ( base.bv_val != NULL ) {
- do_base( uri, &base, &pass, loops, force, noinit, delay );
+ do_base( uri, &base, &pass, loops,
+ force, chaserefs, noinit, delay );
} else {
- do_bind( uri, dn, &pass, loops, force, noinit, NULL );
+ do_bind( uri, dn, &pass, loops,
+ force, chaserefs, noinit, NULL );
}
}
static int
-do_bind( char *uri, char *dn, struct berval *pass, int maxloop, int force, int noinit, LDAP **ldp )
+do_bind( char *uri, char *dn, struct berval *pass, int maxloop,
+ int force, int chaserefs, int noinit, LDAP **ldp )
{
LDAP *ld = ldp ? *ldp : NULL;
int i, first = 1, rc = -1;
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION,
&version );
(void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
- LDAP_OPT_OFF );
+ chaserefs ? LDAP_OPT_ON: LDAP_OPT_OFF );
}
rc = ldap_sasl_bind_s( ld, dn, LDAP_SASL_SIMPLE, pass, NULL, NULL, NULL );
static int
-do_base( char *uri, struct berval *base, struct berval *pass, int maxloop, int force, int noinit, int delay )
+do_base( char *uri, struct berval *base, struct berval *pass, int maxloop,
+ int force, int chaserefs, int noinit, int delay )
{
LDAP *ld = NULL;
int i = 0;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON: LDAP_OPT_OFF );
rc = ldap_sasl_bind_s( ld, NULL, LDAP_SASL_SIMPLE, &pw, NULL, NULL, NULL );
if ( rc != LDAP_SUCCESS ) {
ptr = lutil_strcopy(dn, rdns[j].bv_val);
strcpy(ptr, base->bv_val);
- if ( do_bind( uri, dn, pass, 1, force, noinit, &ld ) && !force ) {
+ if ( do_bind( uri, dn, pass, 1, force, chaserefs, noinit, &ld )
+ && !force )
+ {
break;
}
static void
do_modify( char *uri, char *manager, struct berval *passwd,
char *entry, char *attr, char *value, int maxloop,
- int maxretries, int delay, int friendly );
+ int maxretries, int delay, int friendly, int chaserefs );
static void
"[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>] "
- "[-F]\n",
+ "[-F] "
+ "[-C]\n",
name );
exit( EXIT_FAILURE );
}
int retries = RETRIES;
int delay = 0;
int friendly = 0;
+ int chaserefs = 0;
tester_init( "slapd-modify" );
- while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:a:l:L:r:t:" )) != EOF ) {
- switch( i ) {
+ while ( (i = getopt( argc, argv, "CFH:h:p:D:w:e:a:l:L:r:t:" )) != EOF ) {
+ switch ( i ) {
+ case 'C':
+ chaserefs++;
+ break;
+
case 'F':
friendly++;
break;
for ( i = 0; i < outerloops; i++ ) {
do_modify( uri, manager, &passwd, entry, ava, value,
- loops, retries, delay, friendly );
+ loops, retries, delay, friendly, chaserefs );
}
exit( EXIT_SUCCESS );
static void
do_modify( char *uri, char *manager,
struct berval *passwd, char *entry, char* attr, char* value,
- int maxloop, int maxretries, int delay, int friendly )
+ int maxloop, int maxretries, int delay, int friendly, int chaserefs )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON : LDAP_OPT_OFF );
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Modify(%d): entry=\"%s\".\n",
static void
do_modrdn( char *uri, char *manager, struct berval *passwd,
char *entry, int maxloop, int maxretries, int delay,
- int friendly );
+ int friendly, int chaserefs );
static void
usage( char *name )
"[-L <outerloops>] "
"[-r <maxretries>] "
"[-t <delay>] "
- "[-F]\n",
+ "[-F] "
+ "[-C]\n",
name );
exit( EXIT_FAILURE );
}
int retries = RETRIES;
int delay = 0;
int friendly = 0;
+ int chaserefs = 0;
tester_init( "slapd-modrdn" );
- while ( (i = getopt( argc, argv, "FH:h:p:D:w:e:l:L:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "CFH:h:p:D:w:e:l:L:r:t:" )) != EOF ) {
switch( i ) {
+ case 'C':
+ chaserefs++;
+ break;
+
case 'F':
friendly++;
break;
for ( i = 0; i < outerloops; i++ ) {
do_modrdn( uri, manager, &passwd, entry,
- loops, retries, delay, friendly );
+ loops, retries, delay, friendly, chaserefs );
}
exit( EXIT_SUCCESS );
static void
do_modrdn( char *uri, char *manager,
- struct berval *passwd, char *entry, int maxloop, int maxretries, int delay,
- int friendly )
+ struct berval *passwd, char *entry, int maxloop, int maxretries,
+ int delay, int friendly, int chaserefs )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON : LDAP_OPT_OFF );
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Modrdn(%d): entry=\"%s\".\n",
static void
do_read( char *uri, char *entry, int maxloop,
- int maxretries, int delay, int force );
+ int maxretries, int delay, int force, int chaserefs );
static void
usage( char *name )
"-H <uri> | ([-h <host>] -p <port>) "
"-e <entry> "
"[-F] "
+ "[-C] "
"[-l <loops>] "
"[-L <outerloops>] "
"[-r <maxretries>] "
int retries = RETRIES;
int delay = 0;
int force = 0;
+ int chaserefs = 0;
tester_init( "slapd-read" );
- while ( (i = getopt( argc, argv, "H:h:p:e:Fl:L:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "CH:h:p:e:Fl:L:r:t:" )) != EOF ) {
switch( i ) {
+ case 'C':
+ chaserefs++;
+ break;
+
case 'H': /* the server uri */
uri = strdup( optarg );
break;
uri = tester_uri( uri, host, port );
for ( i = 0; i < outerloops; i++ ) {
- do_read( uri, entry, loops, retries, delay, force );
+ do_read( uri, entry, loops, retries, delay, force, chaserefs );
}
exit( EXIT_SUCCESS );
static void
do_read( char *uri, char *entry, int maxloop,
- int maxretries, int delay, int force )
+ int maxretries, int delay, int force, int chaserefs )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON : LDAP_OPT_OFF );
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Read(%d): entry=\"%s\".\n",
static void
do_search( char *uri, char *manager, struct berval *passwd,
char *sbase, char *filter, LDAP **ldp,
- int innerloop, int maxretries, int delay, int force );
+ int innerloop, int maxretries, int delay, int force, int chaserefs );
static void
do_random( char *uri, char *manager, struct berval *passwd,
char *sbase, char *filter, char *attr, int innerloop,
- int maxretries, int delay, int force );
+ int maxretries, int delay, int force, int chaserefs );
static void
usage( char *name )
"-f <searchfilter> "
"[-a <attr>] "
"[-F] "
+ "[-C] "
"[-l <loops>] "
"[-L <outerloops>] "
"[-r <maxretries>] "
int retries = RETRIES;
int delay = 0;
int force = 0;
+ int chaserefs = 0;
tester_init( "slapd-search" );
- while ( (i = getopt( argc, argv, "a:b:D:f:FH:h:l:L:p:w:r:t:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "a:b:CD:f:FH:h:l:L:p:w:r:t:" )) != EOF ) {
switch( i ) {
+ case 'C':
+ chaserefs++;
+ break;
+
case 'H': /* the server uri */
uri = strdup( optarg );
break;
for ( i = 0; i < outerloops; i++ ) {
if ( attr != NULL ) {
do_random( uri, manager, &passwd, sbase, filter, attr,
- loops, retries, delay, force );
+ loops, retries, delay, force, chaserefs );
} else {
do_search( uri, manager, &passwd, sbase, filter, NULL,
- loops, retries, delay, force );
+ loops, retries, delay, force, chaserefs );
}
}
static void
do_random( char *uri, char *manager, struct berval *passwd,
char *sbase, char *filter, char *attr,
- int innerloop, int maxretries, int delay, int force )
+ int innerloop, int maxretries, int delay, int force, int chaserefs )
{
LDAP *ld = NULL;
int i = 0, do_retry = maxretries;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON : LDAP_OPT_OFF );
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Search(%d): base=\"%s\", filter=\"%s\" attr=\"%s\".\n",
snprintf( buf, sizeof( buf ), "(%s=%s)", attr, values[ rand() % nvalues ] );
do_search( uri, manager, passwd, sbase, buf, &ld,
- 1, maxretries, delay, force );
+ 1, maxretries, delay, force, chaserefs );
}
}
static void
do_search( char *uri, char *manager, struct berval *passwd,
char *sbase, char *filter, LDAP **ldp,
- int innerloop, int maxretries, int delay, int force )
+ int innerloop, int maxretries, int delay,
+ int force, int chaserefs )
{
LDAP *ld = ldp ? *ldp : NULL;
int i = 0, do_retry = maxretries;
}
(void) ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
- (void) ldap_set_option( ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF );
+ (void) ldap_set_option( ld, LDAP_OPT_REFERRALS,
+ chaserefs ? LDAP_OPT_ON : LDAP_OPT_OFF );
if ( do_retry == maxretries ) {
fprintf( stderr, "PID=%ld - Search(%d): base=\"%s\", filter=\"%s\".\n",
"-P <progdir> "
"[-r <maxretries>] "
"[-t <delay>] "
- "[-F]\n",
+ "[-F] "
+ "[-C]\n",
name );
exit( EXIT_FAILURE );
}
DIR *datadir;
struct dirent *file;
int friendly = 0;
+ int chaserefs = 0;
/* search */
char *sfile = NULL;
char *sreqs[MAXREQS];
tester_init( "slapd-tester" );
- while ( (i = getopt( argc, argv, "D:d:FH:h:j:l:L:P:p:r:t:w:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "CD:d:FH:h:j:l:L:P:p:r:t:w:" )) != EOF ) {
switch( i ) {
+ case 'C':
+ chaserefs++;
+ break;
+
case 'D': /* slapd manager */
manager = ArgDup( optarg );
break;
if ( friendly ) {
sargs[sanum++] = friendlyOpt;
}
+ if ( chaserefs ) {
+ sargs[sanum++] = "-C";
+ }
sargs[sanum++] = "-b";
sargs[sanum++] = NULL; /* will hold the search base */
sargs[sanum++] = "-f";
if ( friendly ) {
rargs[ranum++] = friendlyOpt;
}
+ if ( chaserefs ) {
+ rargs[ranum++] = "-C";
+ }
rargs[ranum++] = "-e";
rargs[ranum++] = NULL; /* will hold the read entry */
rargs[ranum++] = NULL;
if ( friendly ) {
margs[manum++] = friendlyOpt;
}
+ if ( chaserefs ) {
+ margs[manum++] = "-C";
+ }
margs[manum++] = "-e";
margs[manum++] = NULL; /* will hold the modrdn entry */
margs[manum++] = NULL;
if ( friendly ) {
modargs[modanum++] = friendlyOpt;
}
+ if ( chaserefs ) {
+ modargs[modanum++] = "-C";
+ }
modargs[modanum++] = "-e";
modargs[modanum++] = NULL; /* will hold the modify entry */
modargs[modanum++] = "-a";;
if ( friendly ) {
aargs[aanum++] = friendlyOpt;
}
+ if ( chaserefs ) {
+ aargs[aanum++] = "-C";
+ }
aargs[aanum++] = "-f";
aargs[aanum++] = NULL; /* will hold the add data file */
aargs[aanum++] = NULL;
if ( friendly ) {
bargs[banum++] = friendlyOpt;
}
+ if ( chaserefs ) {
+ bargs[banum++] = "-C";
+ }
bargs[banum++] = "-D";
bargs[banum++] = NULL;
bargs[banum++] = "-w";