second level interval support, interval=dd:hh:mm:ss

changed the test scripts and test conf files accordingly
This commit is contained in:
Jong Hyuk Choi 2003-11-05 16:10:43 +00:00
parent f8fe312a16
commit cc5e417234
6 changed files with 57 additions and 34 deletions

View File

@ -3053,10 +3053,15 @@ parse_syncrepl_line(
} else if ( !strncasecmp( cargv[ i ], } else if ( !strncasecmp( cargv[ i ],
INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) ) INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) )
{ {
val = cargv[ i ] + sizeof( INTERVALSTR );
if ( si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
si->si_interval = 0;
} else {
char *hstr; char *hstr;
char *mstr; char *mstr;
char *dstr; char *dstr;
val = cargv[ i ] + sizeof( INTERVALSTR ); char *sstr;
int dd, hh, mm, ss;
dstr = val; dstr = val;
hstr = strchr( dstr, ':' ); hstr = strchr( dstr, ':' );
if ( hstr == NULL ) { if ( hstr == NULL ) {
@ -3072,9 +3077,27 @@ parse_syncrepl_line(
return 1; return 1;
} }
*mstr++ = '\0'; *mstr++ = '\0';
si->si_interval = (( atoi( dstr ) * 24 + atoi( hstr )) * 60 sstr = strchr( mstr, ':' );
+ atoi( mstr )) * 60; if ( sstr == NULL ) {
fprintf( stderr, "Error: parse_syncrepl_line: "
"invalid interval \"%s\"\n", val );
return 1;
}
*sstr++ = '\0';
dd = atoi( dstr );
hh = atoi( hstr );
mm = atoi( mstr );
ss = atoi( sstr );
if (( hh > 24 ) || ( hh < 0 ) ||
( mm > 60 ) || ( mm < 0 ) ||
( ss > 60 ) || ( ss < 0 ) || ( dd < 0 )) {
fprintf( stderr, "Error: parse_syncrepl_line: "
"invalid interval \"%s\"\n", val );
return 1;
}
si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss;
}
if ( si->si_interval < 0 ) { if ( si->si_interval < 0 ) {
fprintf( stderr, "Error: parse_syncrepl_line: " fprintf( stderr, "Error: parse_syncrepl_line: "
"invalid interval \"%ld\"\n", "invalid interval \"%ld\"\n",

View File

@ -42,4 +42,4 @@ syncrepl id=1
schemachecking=off schemachecking=off
scope=sub scope=sub
type=refreshOnly type=refreshOnly
interval=00:00:01 interval=00:00:00:10

View File

@ -42,4 +42,4 @@ syncrepl id=1
schemachecking=off schemachecking=off
scope=sub scope=sub
type=refreshOnly type=refreshOnly
interval=00:00:01 interval=00:00:00:10

View File

@ -91,8 +91,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
echo "Waiting 90 seconds for syncrepl to receive changes..." echo "Waiting 15 seconds for syncrepl to receive changes..."
sleep 90 sleep 15
echo "Using ldapmodify to modify master directory..." echo "Using ldapmodify to modify master directory..."
@ -180,8 +180,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
echo "Waiting 90 seconds for syncrepl to receive changes..." echo "Waiting 15 seconds for syncrepl to receive changes..."
sleep 90 sleep 15
echo "Using ldapsearch to read all the entries from the master..." echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \

View File

@ -91,8 +91,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
echo "Waiting 20 seconds for syncrepl to receive changes..." echo "Waiting 15 seconds for syncrepl to receive changes..."
sleep 20 sleep 15
echo "Using ldapmodify to modify master directory..." echo "Using ldapmodify to modify master directory..."
@ -180,8 +180,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
echo "Waiting 20 seconds for syncrepl to receive changes..." echo "Waiting 15 seconds for syncrepl to receive changes..."
sleep 20 sleep 15
echo "Using ldapsearch to read all the entries from the master..." echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \

View File

@ -203,8 +203,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
echo "Waiting 90 seconds for syncrepl to receive changes..." echo "Waiting 25 seconds for syncrepl to receive changes..."
sleep 90 sleep 25
echo "Using ldapmodify to modify master directory..." echo "Using ldapmodify to modify master directory..."
@ -292,8 +292,8 @@ if test $RC != 0 ; then
exit $RC exit $RC
fi fi
echo "Waiting 90 seconds for syncrepl to receive changes..." echo "Waiting 25 seconds for syncrepl to receive changes..."
sleep 90 sleep 25
echo "Using ldapsearch to read all the entries from the master..." echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \