2005-04-16 10:27:27 +08:00
|
|
|
#! /bin/sh
|
|
|
|
# $OpenLDAP$
|
|
|
|
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
##
|
|
|
|
## Copyright 1998-2005 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"
|
|
|
|
. $SRCDIR/scripts/defines.sh
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
if test $BACKMETA = metano ; then
|
|
|
|
echo "meta backend not available, test skipped"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf $TESTDIR
|
|
|
|
|
|
|
|
mkdir -p $TESTDIR $DBDIR1 $DBDIR2
|
|
|
|
|
|
|
|
echo "Starting slapd on TCP/IP port $PORT1..."
|
|
|
|
. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
|
|
|
|
$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
|
|
|
|
PID=$!
|
|
|
|
if test $WAIT != 0 ; then
|
|
|
|
echo PID $PID
|
|
|
|
read foo
|
|
|
|
fi
|
|
|
|
KILLPIDS="$PID"
|
|
|
|
|
2005-09-30 15:32:49 +08:00
|
|
|
sleep 1
|
|
|
|
|
2005-04-16 10:27:27 +08:00
|
|
|
echo "Using ldapsearch to check that slapd is running..."
|
|
|
|
for i in 0 1 2 3 4 5; do
|
|
|
|
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
|
|
|
|
'objectclass=*' > /dev/null 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC = 0 ; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
echo "Waiting 5 seconds for slapd to start..."
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using ldapadd to populate the database..."
|
|
|
|
$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
|
|
|
|
$LDIFORDERED > $TESTOUT 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapadd failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Starting slapd on TCP/IP port $PORT2..."
|
2005-04-23 05:47:55 +08:00
|
|
|
. $CONFFILTER $BACKEND $MONITORDB < $METACONF2 > $CONF2
|
2005-04-16 10:27:27 +08:00
|
|
|
$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
|
|
|
|
PID=$!
|
|
|
|
if test $WAIT != 0 ; then
|
|
|
|
echo PID $PID
|
|
|
|
read foo
|
|
|
|
fi
|
|
|
|
KILLPIDS="$KILLPIDS $PID"
|
|
|
|
|
2005-09-30 15:32:49 +08:00
|
|
|
sleep 1
|
|
|
|
|
2005-04-16 10:27:27 +08:00
|
|
|
echo "Using ldapsearch to check that slapd is running..."
|
|
|
|
for i in 0 1 2 3 4 5; do
|
|
|
|
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
|
|
|
|
'objectclass=*' > /dev/null 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC = 0 ; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
echo "Waiting 5 seconds for slapd to start..."
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using ldapadd to populate the database..."
|
|
|
|
$LDAPADD -D "$METAMANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD < \
|
|
|
|
$LDIFMETA >> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapadd failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2005-04-23 05:47:55 +08:00
|
|
|
echo "Starting slapd on TCP/IP port $PORT3..."
|
|
|
|
. $CONFFILTER $BACKEND $MONITORDB < $METACONF > $CONF3
|
|
|
|
$SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING > $LOG3 2>&1 &
|
|
|
|
PID=$!
|
|
|
|
if test $WAIT != 0 ; then
|
|
|
|
echo PID $PID
|
|
|
|
read foo
|
|
|
|
fi
|
|
|
|
KILLPIDS="$KILLPIDS $PID"
|
|
|
|
|
2005-09-30 15:32:49 +08:00
|
|
|
sleep 1
|
|
|
|
|
2005-04-23 05:47:55 +08:00
|
|
|
echo "Using ldapsearch to check that slapd is running..."
|
|
|
|
for i in 0 1 2 3 4 5; do
|
|
|
|
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
|
|
|
|
'objectclass=*' > /dev/null 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC = 0 ; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
echo "Waiting 5 seconds for slapd to start..."
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2005-04-16 10:27:27 +08:00
|
|
|
cat /dev/null > $SEARCHOUT
|
|
|
|
|
|
|
|
BASEDN="o=Example,c=US"
|
|
|
|
echo "Searching base=\"$BASEDN\"..."
|
|
|
|
echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
|
2005-04-16 10:27:27 +08:00
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Search failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Search failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Do some modifications
|
|
|
|
#
|
|
|
|
|
|
|
|
BASEDN="o=Example,c=US"
|
|
|
|
echo "Modifying database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPMODIFY -v -D "cn=Manager,$BASEDN" -h $LOCALHOST -p $PORT3 -w $PASSWD \
|
2005-04-16 10:27:27 +08:00
|
|
|
-M >> $TESTOUT 2>&1 << EOMODS
|
|
|
|
# These operations (updates with objectClass mapping) triggered ITS#3499
|
|
|
|
dn: cn=Added Group,ou=Groups,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: groupOfNames
|
|
|
|
objectClass: uidObject
|
|
|
|
cn: Added Group
|
|
|
|
member: cn=Added Group,ou=Groups,$BASEDN
|
|
|
|
uid: added
|
|
|
|
|
|
|
|
dn: cn=Another Added Group,ou=Groups,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: groupOfNames
|
|
|
|
cn: Another Added Group
|
|
|
|
member: cn=Added Group,ou=Groups,$BASEDN
|
|
|
|
member: cn=Another Added Group,ou=Groups,$BASEDN
|
|
|
|
|
|
|
|
dn: cn=Another Added Group,ou=Groups,$BASEDN
|
|
|
|
changetype: modify
|
|
|
|
add: objectClass
|
|
|
|
objectClass: uidObject
|
|
|
|
-
|
|
|
|
add: uid
|
|
|
|
uid: added
|
|
|
|
-
|
|
|
|
|
|
|
|
dn: cn=Added Group,ou=Groups,$BASEDN
|
|
|
|
changetype: modify
|
|
|
|
delete: objectClass
|
|
|
|
objectClass: uidObject
|
|
|
|
-
|
|
|
|
delete: uid
|
|
|
|
-
|
|
|
|
|
|
|
|
dn: ou=Meta,$BASEDN
|
|
|
|
changetype: modify
|
|
|
|
add: description
|
|
|
|
description: added to "ou=Meta,$BASEDN"
|
|
|
|
-
|
|
|
|
|
|
|
|
dn: ou=Who's going to handle this?,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: organizationalUnit
|
|
|
|
ou: Who's going to handle this?
|
|
|
|
description: added
|
|
|
|
description: will be deleted
|
|
|
|
|
|
|
|
dn: ou=Same as above,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: organizationalUnit
|
|
|
|
ou: Same as above
|
|
|
|
description: added right after "Who's going to handle this?"
|
|
|
|
description: will be preserved
|
|
|
|
|
|
|
|
dn: ou=Who's going to handle this?,$BASEDN
|
|
|
|
changetype: delete
|
|
|
|
|
|
|
|
dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: organizationalUnit
|
|
|
|
ou: Who's going to handle this?
|
|
|
|
description: added
|
|
|
|
description: will be deleted
|
|
|
|
|
|
|
|
dn: ou=Same as above,ou=Meta,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: organizationalUnit
|
|
|
|
ou: Same as above
|
|
|
|
description: added right after "Who's going to handle this?"
|
|
|
|
description: will be preserved
|
|
|
|
|
|
|
|
dn: cn=Added User,ou=Same as above,ou=Meta,$BASEDN
|
|
|
|
changetype: add
|
|
|
|
objectClass: inetOrgPerson
|
|
|
|
cn: Added User
|
|
|
|
sn: User
|
|
|
|
userPassword: secret
|
|
|
|
|
|
|
|
dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
|
|
|
|
changetype: delete
|
|
|
|
EOMODS
|
|
|
|
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Modify failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-09-28 04:10:12 +08:00
|
|
|
echo "Modify failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Searching base=\"$BASEDN\"..."
|
|
|
|
echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
|
2005-04-16 10:27:27 +08:00
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Search failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Search failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
BASEDN="o=Example,c=US"
|
|
|
|
echo " base=\"$BASEDN\"..."
|
|
|
|
echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" -M "$FILTER" '*' ref \
|
2005-04-16 10:27:27 +08:00
|
|
|
>> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Search failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Search failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
BASEDN="o=Example,c=US"
|
|
|
|
FILTER="(seeAlso=cn=all staff,ou=Groups,$BASEDN)"
|
|
|
|
echo "Searching filter=\"$FILTER\""
|
|
|
|
echo " attrs=\"seeAlso\""
|
|
|
|
echo " base=\"$BASEDN\"..."
|
|
|
|
echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
|
|
|
|
echo "# attrs=\"seeAlso\"" >> $SEARCHOUT
|
|
|
|
echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" seeAlso \
|
2005-04-16 10:27:27 +08:00
|
|
|
>> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Search failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Search failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
FILTER="(uid=example)"
|
|
|
|
echo "Searching filter=\"$FILTER\""
|
|
|
|
echo " attrs=\"uid\""
|
|
|
|
echo " base=\"$BASEDN\"..."
|
|
|
|
echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
|
|
|
|
echo "# attrs=\"uid\"" >> $SEARCHOUT
|
|
|
|
echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" uid \
|
2005-04-16 10:27:27 +08:00
|
|
|
>> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Search failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Search failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
FILTER="(member=cn=Another Added Group,ou=Groups,$BASEDN)"
|
|
|
|
echo "Searching filter=\"$FILTER\""
|
|
|
|
echo " attrs=\"member\""
|
|
|
|
echo " base=\"$BASEDN\"..."
|
|
|
|
echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
|
|
|
|
echo "# attrs=\"member\"" >> $SEARCHOUT
|
|
|
|
echo "# base=\"$BASEDN\"..." >> $SEARCHOUT
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" member \
|
2005-04-16 10:27:27 +08:00
|
|
|
>> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Search failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Search failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Filtering ldapsearch results..."
|
|
|
|
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
|
|
|
|
echo "Filtering original ldif used to create database..."
|
|
|
|
. $LDIFFILTER < $METAOUT > $LDIFFLT
|
|
|
|
echo "Comparing filter output..."
|
|
|
|
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
|
|
|
|
|
|
|
if test $? != 0 ; then
|
|
|
|
echo "comparison failed - meta search/modification didn't succeed"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
BASEDN="o=Example,c=US"
|
|
|
|
echo "Changing password to database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPPASSWD -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
|
2005-04-16 10:27:27 +08:00
|
|
|
-s $PASSWD "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
|
|
|
|
>> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Passwd ExOp failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Passwd ExOp failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Binding with newly changed password to database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
|
2005-04-16 10:27:27 +08:00
|
|
|
-D "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
|
|
|
|
-w $PASSWD >> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "WhoAmI failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "WhoAmI failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Binding as newly added user to database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
|
2005-04-16 10:27:27 +08:00
|
|
|
-D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
|
|
|
|
-w $PASSWD >> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "WhoAmI failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
;;
|
|
|
|
*)
|
2005-09-28 04:10:12 +08:00
|
|
|
echo "WhoAmI failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Changing password to database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPPASSWD -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
|
2005-04-16 10:27:27 +08:00
|
|
|
-s meta "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
|
|
|
|
>> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "Passwd ExOp failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "Passwd ExOp failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Binding with newly changed password to database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
|
2005-04-16 10:27:27 +08:00
|
|
|
-D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
|
|
|
|
-w meta >> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 0 ; then
|
|
|
|
# echo "WhoAmI failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
;;
|
|
|
|
*)
|
2005-04-30 00:01:59 +08:00
|
|
|
echo "WhoAmI failed ($RC)!"
|
2005-04-29 23:43:15 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
echo "Comparing to database \"$BASEDN\"..."
|
2005-04-23 05:47:55 +08:00
|
|
|
$LDAPCOMPARE -h $LOCALHOST -p $PORT3 \
|
2005-04-16 10:27:27 +08:00
|
|
|
"cn=Another Added Group,ou=Groups,$BASEDN" \
|
|
|
|
"member:cn=Added Group,ou=Groups,$BASEDN" >> $TESTOUT 2>&1
|
|
|
|
RC=$?
|
2005-04-29 23:43:15 +08:00
|
|
|
#if test $RC != 6 ; then
|
|
|
|
# echo "Compare failed ($RC)!"
|
|
|
|
# test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
# exit $RC
|
|
|
|
#fi
|
|
|
|
case $RC in
|
|
|
|
6)
|
|
|
|
;;
|
|
|
|
51)
|
|
|
|
echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Compare failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
;;
|
|
|
|
esac
|
2005-04-16 10:27:27 +08:00
|
|
|
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
|
|
|
|
echo ">>>>> Test succeeded"
|
|
|
|
exit 0
|
|
|
|
|