Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
3ce6a2d0
Commit
3ce6a2d0
authored
Nov 22, 2015
by
Ondřej Kuzník
Committed by
Quanah Gibson-Mount
Oct 11, 2017
Browse files
ITS#7100 Test for entryTtl reflecting time to live
parent
70dbc04d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/scripts/test046-dds
View file @
3ce6a2d0
...
...
@@ -150,6 +150,7 @@ fi
SEARCH
=
0
SEARCH
=
`
expr
$SEARCH
+ 1
`
sleep
$SLEEP0
echo
"# [
$SEARCH
] Searching the dynamic portion of the database..."
>>
$SEARCHOUT
$LDAPSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=dynamicObject)'
'*'
entryTtl
\
...
...
@@ -253,6 +254,7 @@ if test $RC != 0 ; then
fi
SEARCH
=
`
expr
$SEARCH
+ 1
`
sleep
$SLEEP0
echo
"# [
$SEARCH
] Searching the dynamic portion of the database..."
>>
$SEARCHOUT
$LDAPSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=dynamicObject)'
'*'
entryTtl
\
...
...
@@ -307,6 +309,7 @@ if test $RC != 0 ; then
fi
SEARCH
=
`
expr
$SEARCH
+ 1
`
sleep
$SLEEP0
echo
"# [
$SEARCH
] Searching the dynamic portion of the database..."
>>
$SEARCHOUT
$LDAPSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=dynamicObject)'
'*'
entryTtl
\
...
...
@@ -332,6 +335,7 @@ if test $RC != 0 ; then
fi
SEARCH
=
`
expr
$SEARCH
+ 1
`
sleep
$SLEEP0
echo
"# [
$SEARCH
] Searching the dynamic portion of the database..."
>>
$SEARCHOUT
$LDAPSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=dynamicObject)'
'*'
entryTtl
\
...
...
@@ -355,6 +359,7 @@ if test $RC != 0 ; then
fi
SEARCH
=
`
expr
$SEARCH
+ 1
`
sleep
$SLEEP0
echo
"# [
$SEARCH
] Searching the dynamic portion of the database..."
>>
$SEARCHOUT
$LDAPSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=dynamicObject)'
'*'
entryTtl
\
...
...
@@ -371,6 +376,7 @@ echo "Waiting $SLEEP seconds for remaining entry to expire..."
sleep
$SLEEP
SEARCH
=
`
expr
$SEARCH
+ 1
`
sleep
$SLEEP0
echo
"# [
$SEARCH
] Searching the dynamic portion of the database..."
>>
$SEARCHOUT
$LDAPSEARCH
-S
""
-b
"
$BASEDN
"
-h
$LOCALHOST
-p
$PORT1
\
'(objectClass=dynamicObject)'
'*'
entryTtl
\
...
...
@@ -530,18 +536,38 @@ test $KILLSERVERS != no && kill -HUP $KILLPIDS
LDIF
=
$DDSOUT
# dds removes entryTtl and re-adds it, changing the order of attributes
echo
"Filtering ldapsearch results..."
$LDIFFILTER
<
$SEARCHOUT
>
$SEARCHFLT
$LDIFFILTER
-s
a <
$SEARCHOUT
>
$SEARCHFLT
grep
-i
-v
-e
'^entryttl: '
<
$SEARCHFLT
>
$SEARCHFLT2
echo
"Filtering original ldif used to create database..."
$LDIFFILTER
<
$LDIF
>
$LDIFFLT
$LDIFFILTER
-s
a <
$LDIF
>
$LDIFFLT
grep
-i
-v
-e
'^entryttl: '
<
$LDIFFLT
>
$LDIFFLT2
echo
"Comparing filter output..."
$CMP
$SEARCHFLT
$LDIFFLT
>
$CMPOUT
$CMP
$SEARCHFLT
2
$LDIFFLT
2
>
$CMPOUT
if
test
$?
!=
0
;
then
echo
"Comparison failed"
exit
1
fi
echo
"Listing entryTtl values from ldapsearch results..."
grep
-i
-e
'^entryttl: '
<
$SEARCHFLT
|
awk
'{ print $2 }'
>
$SEARCHFLT2
echo
"Listing entryTtl values from original ldif used to create database..."
grep
-i
-e
'^entryttl: '
<
$LDIFFLT
|
awk
'{ print $2 }'
>
$LDIFFLT2
if
!
type paste
>
/dev/null 2>&1
;
then
echo
"Cannot find 'paste' command, skipping entryTtl checks..."
else
echo
"Checking entryTtl appears to decrease with time..."
paste
$SEARCHFLT2
$LDIFFLT2
|
while
read
resultTTL savedTTL
;
do
if
[
`
expr
$savedTTL
-
$resultTTL
`
-lt
$SLEEP0
]
;
then
echo
"TTL has not reduced accordingly"
exit
1
fi
done
fi
echo
">>>>> Test succeeded"
test
$KILLSERVERS
!=
no
&&
wait
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment