From: Pierangelo Masarati Date: Tue, 10 Feb 2009 14:10:58 +0000 (+0000) Subject: prefix '*' to only log first occurrence of ignored error X-Git-Tag: ACLCHECK_0~845 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=017e63119bb02a022a577f4a4e42a7d2b4b42021;p=openldap prefix '*' to only log first occurrence of ignored error --- diff --git a/tests/progs/slapd-bind.c b/tests/progs/slapd-bind.c index 8ccf0259f5..8a48edae79 100644 --- a/tests/progs/slapd-bind.c +++ b/tests/progs/slapd-bind.c @@ -348,7 +348,7 @@ do_bind( char *uri, char *dn, struct berval *pass, int maxloop, /* if ignore.. */ if ( first ) { /* only log if first occurrence */ - if ( first == 1 ) { + if ( ( force < 2 && first > 0 ) || abs(first) == 1 ) { tester_ldap_error( ld, "ldap_sasl_bind_s", NULL ); } rc = LDAP_SUCCESS; diff --git a/tests/progs/slapd-common.c b/tests/progs/slapd-common.c index 5b7845b66e..c7c18c1a48 100644 --- a/tests/progs/slapd-common.c +++ b/tests/progs/slapd-common.c @@ -147,6 +147,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++ ) { @@ -191,16 +195,22 @@ tester_ignore_err( int err ) 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 ]--; } } } diff --git a/tests/progs/slapd-read.c b/tests/progs/slapd-read.c index fee720524c..e3617065f7 100644 --- a/tests/progs/slapd-read.c +++ b/tests/progs/slapd-read.c @@ -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; diff --git a/tests/progs/slapd-search.c b/tests/progs/slapd-search.c index 76e52d2820..af82416405 100644 --- a/tests/progs/slapd-search.c +++ b/tests/progs/slapd-search.c @@ -447,7 +447,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, "ldap_search_ext_s", NULL ); } continue;