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

View File

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

View File

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

View File

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

View File

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

View File

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