3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2005 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 echo "skipping test (not yet implemented)"
19 echo "running defines.sh"
20 . $SRCDIR/scripts/defines.sh
22 mkdir -p $TESTDIR $DBDIR1
24 echo "Running slapadd to build slapd database..."
25 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
26 $SLAPADD -f $CONF1 -l $LDIFORDERED
28 if test $RC != 0 ; then
29 echo "slapadd failed ($RC)!"
33 echo "Starting slapd on TCP/IP port $PORT1..."
34 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
36 if test $WAIT != 0 ; then
42 echo "Testing slapd Manage operations..."
43 for i in 0 1 2 3 4 5; do
44 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
45 'objectclass=*' > /dev/null 2>&1
47 if test $RC = 0 ; then
50 echo "Waiting 5 seconds for slapd to start..."
54 if test $RC != 0 ; then
55 echo "ldapsearch failed ($RC)!"
56 test $KILLSERVERS != no && kill -HUP $KILLPIDS
60 echo "Testing modify, add, and delete..."
61 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
63 $TESTOUT 2>&1 << EOMODS
66 # LEADING COMMENT AND WHITE SPACE
68 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
69 # update structural object class of entry via objectClass replace
72 objectClass: testPerson
75 objectClass: structuralObjectClass
77 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
78 # update structural object class of entry via objectClass modify
81 objectClass: OpenLDAPperson
84 objectClass: testPerson
86 delete: structuralObjectClass
89 objectClass: testPerson
91 dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
95 entryUUID: B51EE239-C24A-11D9-A541-000D9342AD1E
97 dn: ou=Groups,dc=example,dc=com
100 replace: creatorsName
101 creatorsName: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
103 dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
104 # change modifiersName
106 replace: modifiersName
107 modifiersName: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
112 if test $RC != 0 ; then
113 echo "ldapmodify failed ($RC)!"
114 test $KILLSERVERS != no && kill -HUP $KILLPIDS
118 echo "Using ldapsearch to retrieve all the entries..."
119 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
120 'objectClass=*' > $SEARCHOUT 2>&1
122 test $KILLSERVERS != no && kill -HUP $KILLPIDS
123 if test $RC != 0 ; then
124 echo "ldapsearch failed ($RC)!"
128 LDIF=$MODIFYOUTMASTER
130 echo "Filtering ldapsearch results..."
131 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
132 echo "Filtering original ldif used to create database..."
133 . $LDIFFILTER < $LDIF > $LDIFFLT
134 echo "Comparing filter output..."
135 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
137 if test $? != 0 ; then
138 echo "comparison failed - manage operations did not complete correctly"
142 echo ">>>>> Test succeeded"