mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
second level interval support, interval=dd:hh:mm:ss
changed the test scripts and test conf files accordingly
This commit is contained in:
parent
f8fe312a16
commit
cc5e417234
@ -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",
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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 \
|
||||||
|
@ -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 \
|
||||||
|
@ -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 \
|
||||||
|
Loading…
Reference in New Issue
Block a user