Commit f46ff946 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5893

parent c4fd3ed5
......@@ -65,6 +65,7 @@ OpenLDAP 2.4.14 Engineering
Added contrib/passwd sha2 support (ITS#5660)
Build Environment
Fixed test006 appending to log file (ITS#5910)
Fixed test036,test039 behavior on error (ITS#5893)
Fixed test048 sed pathname substitution (ITS#5910)
Fixed test049,test050 to work on windows (ITS#5842)
Updated test017,test018,test019 to cover more cases (ITS#5883)
......
......@@ -249,13 +249,17 @@ main( int argc, char **argv )
uri = tester_uri( uri, host, port );
for ( i = 0; i < outerloops; i++ ) {
int rc;
if ( base != NULL ) {
do_base( uri, dn, &pass, base, filter, pwattr, loops,
rc = do_base( uri, dn, &pass, base, filter, pwattr, loops,
force, chaserefs, noinit, delay, -1, NULL );
} else {
do_bind( uri, dn, &pass, loops,
rc = do_bind( uri, dn, &pass, loops,
force, chaserefs, noinit, NULL, -1, NULL );
}
if ( rc == LDAP_SERVER_DOWN )
break;
}
exit( EXIT_SUCCESS );
......@@ -339,12 +343,12 @@ do_bind( char *uri, char *dn, struct berval *pass, int maxloop,
rc = ldap_sasl_bind_s( ld, dn, LDAP_SASL_SIMPLE, pass, NULL, NULL, NULL );
if ( rc ) {
unsigned first = tester_ignore_err( rc );
int first = tester_ignore_err( rc );
/* if ignore.. */
if ( first ) {
/* only log if first occurrence */
if ( force < 2 || first == 1 ) {
if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) {
tester_ldap_error( ld, "ldap_sasl_bind_s", NULL );
}
rc = LDAP_SUCCESS;
......
......@@ -40,8 +40,8 @@ tester_t progtype;
#define TESTER_SERVER_LAST (LDAP_OTHER + 1)
#define TESTER_CLIENT_LAST (- LDAP_REFERRAL_LIMIT_EXCEEDED + 1)
static unsigned ignore_server[ TESTER_SERVER_LAST ];
static unsigned ignore_client[ TESTER_CLIENT_LAST ];
static int ignore_server[ TESTER_SERVER_LAST ];
static int ignore_client[ TESTER_CLIENT_LAST ];
static struct {
char *name;
......@@ -126,8 +126,7 @@ static struct {
static int
tester_ignore_str2err( const char *err )
{
int i;
unsigned ignore = 1;
int i, ignore = 1;
if ( strcmp( err, "ALL" ) == 0 ) {
for ( i = 0; ignore_str2err[ i ].name != NULL; i++ ) {
......@@ -147,6 +146,10 @@ tester_ignore_str2err( const char *err )
if ( err[ 0 ] == '!' ) {
ignore = 0;
err++;
} else if ( err[ 0 ] == '*' ) {
ignore = -1;
err++;
}
for ( i = 0; ignore_str2err[ i ].name != NULL; i++ ) {
......@@ -183,24 +186,30 @@ tester_ignore_str2errlist( const char *err )
return 0;
}
unsigned
int
tester_ignore_err( int err )
{
unsigned rc = 1;
int rc = 1;
if ( err > 0 ) {
if ( err < TESTER_SERVER_LAST ) {
rc = ignore_server[ err ];
if ( rc ) {
if ( rc > 0 ) {
ignore_server[ err ]++;
} else if ( rc < 0 ) {
ignore_server[ err ]--;
}
}
} else if ( err < 0 ) {
if ( -err < TESTER_CLIENT_LAST ) {
rc = ignore_client[ -err ];
if ( rc ) {
if ( rc > 0 ) {
ignore_client[ -err ]++;
} else if ( rc < 0 ) {
ignore_server[ err ]--;
}
}
}
......
......@@ -37,7 +37,7 @@ extern void tester_error( const char *msg );
extern void tester_perror( const char *fname, const char *msg );
extern void tester_ldap_error( LDAP *ld, const char *fname, const char *msg );
extern int tester_ignore_str2errlist( const char *err );
extern unsigned tester_ignore_err( int err );
extern int tester_ignore_err( int err );
extern pid_t pid;
......
......@@ -389,7 +389,7 @@ retry:;
}
if ( rc ) {
unsigned first = tester_ignore_err( rc );
int first = tester_ignore_err( rc );
char buf[ BUFSIZ ];
snprintf( buf, sizeof( buf ), "ldap_search_ext_s(%s)", entry );
......@@ -397,7 +397,7 @@ retry:;
/* if ignore.. */
if ( first ) {
/* only log if first occurrence */
if ( force < 2 || first == 1 ) {
if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) {
tester_ldap_error( ld, buf, NULL );
}
continue;
......
......@@ -443,11 +443,11 @@ retry:;
}
if ( rc ) {
unsigned first = tester_ignore_err( rc );
int first = tester_ignore_err( rc );
/* if ignore.. */
if ( first ) {
/* only log if first occurrence */
if ( force < 2 || first == 1 ) {
if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) {
tester_ldap_error( ld, "ldap_search_ext_s", NULL );
}
continue;
......
......@@ -195,8 +195,8 @@ $MONITORDATA "$MONITORDB" "$TESTDIR/$DATADIR" "$TESTDIR"
echo "Using tester for concurrent server access..."
$SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR" -h $LOCALHOST -p $PORT3 \
-D "cn=Manager,$METABASEDN" -w $PASSWD -l $TESTLOOPS -r 20 -FF \
-i '!REFERRAL'
-D "cn=Manager,$METABASEDN" -w $PASSWD -l $TESTLOOPS -r 20 \
-i '!REFERRAL' -i '*INVALID_CREDENTIALS'
RC=$?
if test $RC != 0 ; then
......
......@@ -184,8 +184,8 @@ $MONITORDATA "$MONITORDB" "$TESTDIR/$DATADIR" "$TESTDIR"
echo "Using tester for concurrent server access..."
$SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR" -h $LOCALHOST -p $PORT3 \
-D "cn=Manager,$METABASEDN" -w $PASSWD \
-l $TESTLOOPS -L $TESTOLOOPS -r 20 -FF \
-i '!REFERRAL'
-l $TESTLOOPS -L $TESTOLOOPS -r 20 \
-i '!REFERRAL' -i '*INVALID_CREDENTIALS'
RC=$?
if test $RC != 0 ; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment