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

ITS#6345

parent 1901f85d
......@@ -16,6 +16,7 @@ OpenLDAP 2.4.20 Engineering
Build Environment
Fixed slapd MAXPATHLEN handling (ITS#6342)
Fixed test057 handling of memberof/refint (ITS#6343)
Fixed slapd test error ignoring (ITS#6345)
Documentation
ldap_get_dn(3) typos (ITS#5366)
slapd.conf(5) note hex server IDs (ITS#6297)
......
......@@ -38,13 +38,17 @@ pid_t pid;
static char progname[ BUFSIZ ];
tester_t progtype;
#define TESTER_SERVER_LAST (LDAP_OTHER + 1)
#define TESTER_CLIENT_LAST (- LDAP_REFERRAL_LIMIT_EXCEEDED + 1)
static int ignore_server[ TESTER_SERVER_LAST ];
static int ignore_client[ TESTER_CLIENT_LAST ];
/*
* ignore_count[] is indexed by result code:
* negative for OpenLDAP client-side errors, positive for protocol codes.
*/
#define TESTER_CLIENT_FIRST LDAP_REFERRAL_LIMIT_EXCEEDED /* negative */
#define TESTER_SERVER_LAST LDAP_OTHER
static int ignore_base [ -TESTER_CLIENT_FIRST + TESTER_SERVER_LAST + 1 ];
#define ignore_count (ignore_base - TESTER_CLIENT_FIRST)
static struct {
char *name;
static const struct {
const char *name;
int err;
} ignore_str2err[] = {
{ "OPERATIONS_ERROR", LDAP_OPERATIONS_ERROR },
......@@ -130,15 +134,9 @@ tester_ignore_str2err( const char *err )
if ( strcmp( err, "ALL" ) == 0 ) {
for ( i = 0; ignore_str2err[ i ].name != NULL; i++ ) {
int err = ignore_str2err[ i ].err;
if ( err > 0 ) {
ignore_server[ err ] = 1;
} else if ( err < 0 ) {
ignore_client[ -err ] = 1;
}
ignore_count[ ignore_str2err[ i ].err ] = 1;
}
ignore_count[ LDAP_SUCCESS ] = 0;
return 0;
}
......@@ -156,11 +154,8 @@ tester_ignore_str2err( const char *err )
if ( strcmp( err, ignore_str2err[ i ].name ) == 0 ) {
int err = ignore_str2err[ i ].err;
if ( err > 0 ) {
ignore_server[ err ] = ignore;
} else if ( err < 0 ) {
ignore_client[ -err ] = ignore;
if ( err != LDAP_SUCCESS ) {
ignore_count[ err ] = ignore;
}
return err;
......@@ -191,26 +186,10 @@ tester_ignore_err( int err )
{
int rc = 1;
if ( err > 0 ) {
if ( err < TESTER_SERVER_LAST ) {
rc = ignore_server[ err ];
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 > 0 ) {
ignore_client[ -err ]++;
} else if ( rc < 0 ) {
ignore_server[ err ]--;
}
if ( err && TESTER_CLIENT_FIRST <= err && err <= TESTER_SERVER_LAST ) {
rc = ignore_count[ err ];
if ( rc != 0 ) {
ignore_count[ err ] = rc + (rc > 0 ? 1 : -1);
}
}
......@@ -319,4 +298,3 @@ tester_error( const char *msg )
{
fprintf( stderr, "%s: %s\n", progname, msg );
}
Supports Markdown
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