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
openldap
OpenLDAP
Compare Revisions
b8f61d114228cfdce4f6a2c3ddeaf884cd6468d9...97adca9151b547b9b99f8bf97cf3cfb66cf44575
Commits (2)
ITS#7344 fix test064-constraint
· 42644cbc
Howard Chu
authored
Aug 07, 2020
Remove bash-isms
42644cbc
Merge remote-tracking branch 'origin/master' into OPENLDAP_REL_ENG_2_5
· 97adca91
Quanah Gibson-Mount
authored
Aug 07, 2020
97adca91
Hide whitespace changes
Inline
Side-by-side
tests/scripts/test064-constraint
View file @
97adca91
#!/bin/bash
#!/bin/sh
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
## Copyright 1998-2020 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
echo
"running defines.sh"
echo
"running defines.sh"
.
$SRCDIR
/scripts/defines.sh
.
$SRCDIR
/scripts/defines.sh
...
@@ -136,14 +149,14 @@ if test $RC != 0 ; then
...
@@ -136,14 +149,14 @@ if test $RC != 0 ; then
fi
fi
echo
"Adding basic structure..."
echo
"Adding basic structure..."
$LDAPADD
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
-f
$ROOTLDIF
&
>/dev/null
$LDAPADD
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
-f
$ROOTLDIF
>
/dev/null
2>&1
RC
=
$?
RC
=
$?
if
test
$RC
!=
0
;
then
if
test
$RC
!=
0
;
then
echo
"ldapadd failed (
$RC
)!"
echo
"ldapadd failed (
$RC
)!"
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$PID
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$PID
exit
$RC
exit
$RC
fi
fi
$LDAPADD
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
-f
$USERLDIF
&
>/dev/null
$LDAPADD
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
-f
$USERLDIF
>
/dev/null
2>&1
RC
=
$?
RC
=
$?
if
test
$RC
!=
0
;
then
if
test
$RC
!=
0
;
then
echo
"ldapadd failed (
$RC
)!"
echo
"ldapadd failed (
$RC
)!"
...
@@ -152,16 +165,16 @@ if test $RC != 0 ; then
...
@@ -152,16 +165,16 @@ if test $RC != 0 ; then
fi
fi
echo
"Running constraint tests..."
echo
"Running constraint tests..."
for
ldif
in
$
SRCDIR
/data/constraint/
{
*
ok
*
,
*
fail
*
}
.ldif
;
do
for
ldif
in
$
CONSTRAINTDIR
/
*
ok
*
.ldif
$CONSTRAINTDIR
/
*
fail
*
.ldif
;
do
### reload
### reload
$LDAPDELETE
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
"
$USERDN
"
&
>/dev/null
$LDAPDELETE
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
"
$USERDN
"
>
/dev/null
2>&1
RC
=
$?
RC
=
$?
if
test
$RC
!=
0
;
then
if
test
$RC
!=
0
;
then
echo
"ldapdelete failed (
$RC
)!"
echo
"ldapdelete failed (
$RC
)!"
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$PID
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$PID
exit
$RC
exit
$RC
fi
fi
$LDAPADD
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
-f
$USERLDIF
&
>/dev/null
$LDAPADD
-D
"
$MANAGERDN
"
-H
$URI1
-w
$PASSWD
-f
$USERLDIF
>
/dev/null
2>&1
RC
=
$?
RC
=
$?
if
test
$RC
!=
0
;
then
if
test
$RC
!=
0
;
then
echo
"ldapadd failed (
$RC
)!"
echo
"ldapadd failed (
$RC
)!"
...
@@ -173,11 +186,11 @@ for ldif in $SRCDIR/data/constraint/{*ok*,*fail*}.ldif; do
...
@@ -173,11 +186,11 @@ for ldif in $SRCDIR/data/constraint/{*ok*,*fail*}.ldif; do
echo
-n
" [
$ldif
]: "
echo
-n
" [
$ldif
]: "
### modify
### modify
$LDAPMODIFY
-H
$URI1
-x
-D
"
$MANAGERDN
"
-f
$ldif
-w
$PASSWD
&
>/dev/null
$LDAPMODIFY
-H
$URI1
-x
-D
"
$MANAGERDN
"
-f
$ldif
-w
$PASSWD
>
/dev/null
2>&1
RC
=
$?
RC
=
$?
if
test
$RC
=
=
0
;
then
if
test
$RC
=
0
;
then
echo
"OK"
|
tee
-a
$SCRIPTOUT
echo
"OK"
|
tee
-a
$SCRIPTOUT
elif
test
$RC
=
=
19
;
then
elif
test
$RC
=
19
;
then
echo
"FAIL"
|
tee
-a
$SCRIPTOUT
echo
"FAIL"
|
tee
-a
$SCRIPTOUT
else
else
echo
"UNEXPECTED (
$RC
)"
echo
"UNEXPECTED (
$RC
)"
...
...