From 017e63119bb02a022a577f4a4e42a7d2b4b42021 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 10 Feb 2009 14:10:58 +0000 Subject: [PATCH] prefix '*' to only log first occurrence of ignored error --- tests/progs/slapd-bind.c | 2 +- tests/progs/slapd-common.c | 14 ++++++++++++-- tests/progs/slapd-read.c | 2 +- tests/progs/slapd-search.c | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) 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;