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 -MM -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
62 $TESTOUT 2>&1 << EOMODS
65 # LEADING COMMENT AND WHITE SPACE
67 dn: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
68 # update structural object class of entry via objectClass replace
71 objectClass: testPerson
73 dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
74 # update structural object class of entry via objectClass modify
77 objectClass: OpenLDAPperson
80 objectClass: testPerson
82 dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
86 entryUUID: B51EE239-C24A-11D9-A541-000D9342AD1E
88 dn: ou=Groups,dc=example,dc=com
92 creatorsName: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
94 dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
95 # change modifiersName
97 replace: modifiersName
98 modifiersName: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
103 if test $RC != 0 ; then
104 echo "ldapmodify failed ($RC)!"
105 test $KILLSERVERS != no && kill -HUP $KILLPIDS
109 echo "Using ldapsearch to retrieve all the entries..."
110 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
111 'objectClass=*' > $SEARCHOUT 2>&1
113 test $KILLSERVERS != no && kill -HUP $KILLPIDS
114 if test $RC != 0 ; then
115 echo "ldapsearch failed ($RC)!"
119 LDIF=$MODIFYOUTMASTER
121 echo "Filtering ldapsearch results..."
122 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
123 echo "Filtering original ldif used to create database..."
124 . $LDIFFILTER < $LDIF > $LDIFFLT
125 echo "Comparing filter output..."
126 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
128 if test $? != 0 ; then
129 echo "comparison failed - manage operations did not complete correctly"
133 echo ">>>>> Test succeeded"