test024-unique revision 1.1.1.10 1 1.1 lukem #! /bin/sh
2 1.1.1.4 tron # $OpenLDAP$
3 1.1 lukem ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 1.1 lukem ##
5 1.1.1.10 christos ## Copyright 2004-2024 The OpenLDAP Foundation.
6 1.1 lukem ## All rights reserved.
7 1.1 lukem ##
8 1.1 lukem ## Redistribution and use in source and binary forms, with or without
9 1.1 lukem ## modification, are permitted only as authorized by the OpenLDAP
10 1.1 lukem ## Public License.
11 1.1 lukem ##
12 1.1 lukem ## A copy of this license is available in the file LICENSE in the
13 1.1 lukem ## top-level directory of the distribution or, alternatively, at
14 1.1 lukem ## <http://www.OpenLDAP.org/license.html>.
15 1.1 lukem
16 1.1 lukem echo "running defines.sh"
17 1.1 lukem . $SRCDIR/scripts/defines.sh
18 1.1 lukem
19 1.1 lukem if test $UNIQUE = uniqueno; then
20 1.1 lukem echo "Attribute Uniqueness overlay not available, test skipped"
21 1.1 lukem exit 0
22 1.1 lukem fi
23 1.1 lukem
24 1.1.1.3 adam RCODEconstraint=19
25 1.1.1.9 christos RCODEnorelax=50
26 1.1.1.3 adam test $BACKEND = null && RCODEconstraint=0
27 1.1.1.3 adam
28 1.1 lukem mkdir -p $TESTDIR $DBDIR1
29 1.1 lukem
30 1.1 lukem $SLAPPASSWD -g -n >$CONFIGPWF
31 1.1 lukem echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
32 1.1 lukem
33 1.1 lukem echo "Running slapadd to build slapd database..."
34 1.1.1.9 christos . $CONFFILTER $BACKEND < $UNIQUECONF > $CONF1
35 1.1 lukem $SLAPADD -f $CONF1 -l $LDIFUNIQUE
36 1.1 lukem RC=$?
37 1.1 lukem if test $RC != 0 ; then
38 1.1 lukem echo "slapadd failed ($RC)!"
39 1.1 lukem exit $RC
40 1.1 lukem fi
41 1.1 lukem
42 1.1 lukem echo "Starting slapd on TCP/IP port $PORT1..."
43 1.1 lukem mkdir $TESTDIR/confdir
44 1.1.1.9 christos $SLAPD -f $CONF1 -F $TESTDIR/confdir -h $URI1 -d $LVL > $LOG1 2>&1 &
45 1.1 lukem PID=$!
46 1.1 lukem if test $WAIT != 0 ; then
47 1.1 lukem echo PID $PID
48 1.1 lukem read foo
49 1.1 lukem fi
50 1.1 lukem KILLPIDS="$PID"
51 1.1 lukem
52 1.1 lukem sleep 1
53 1.1 lukem
54 1.1 lukem echo "Testing slapd attribute uniqueness operations..."
55 1.1 lukem for i in 0 1 2 3 4 5; do
56 1.1.1.9 christos $LDAPSEARCH -s base -b "$MONITOR" -H $URI1 \
57 1.1 lukem 'objectclass=*' > /dev/null 2>&1
58 1.1 lukem RC=$?
59 1.1 lukem if test $RC = 0 ; then
60 1.1 lukem break
61 1.1 lukem fi
62 1.1 lukem echo "Waiting 5 seconds for slapd to start..."
63 1.1 lukem sleep 5
64 1.1 lukem done
65 1.1 lukem
66 1.1 lukem if test $RC != 0 ; then
67 1.1 lukem echo "ldapsearch failed ($RC)!"
68 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
69 1.1 lukem exit $RC
70 1.1 lukem fi
71 1.1 lukem
72 1.1 lukem echo "Adding a unique record..."
73 1.1.1.9 christos $LDAPADD -D "$UNIQUEDN" -H $URI1 -w $PASSWD \
74 1.1 lukem > /dev/null << EOTUNIQ1
75 1.1 lukem dn: uid=dave,ou=users,o=unique
76 1.1 lukem objectClass: inetOrgPerson
77 1.1.1.5 christos objectClass: simpleSecurityObject
78 1.1 lukem uid: dave
79 1.1 lukem sn: nothere
80 1.1 lukem cn: dave
81 1.1 lukem businessCategory: otest
82 1.1 lukem carLicense: TEST
83 1.1 lukem departmentNumber: 42
84 1.1 lukem # NOTE: use special chars in attr value to be used
85 1.1 lukem # in internal searches ITS#4212
86 1.1 lukem displayName: Dave (ITS#4212)
87 1.1 lukem employeeNumber: 69
88 1.1 lukem employeeType: contractor
89 1.1 lukem givenName: Dave
90 1.1.1.5 christos userpassword: $PASSWD
91 1.1 lukem EOTUNIQ1
92 1.1 lukem RC=$?
93 1.1 lukem if test $RC != 0 ; then
94 1.1 lukem echo "ldapadd failed ($RC)!"
95 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
96 1.1 lukem exit $RC
97 1.1 lukem fi
98 1.1 lukem
99 1.1 lukem echo "Adding a non-unique record..."
100 1.1.1.9 christos $LDAPADD -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
101 1.1 lukem $TESTOUT 2>&1 << EOTUNIQ2
102 1.1 lukem dn: uid=bill,ou=users,o=unique
103 1.1 lukem objectClass: inetOrgPerson
104 1.1 lukem uid: bill
105 1.1 lukem sn: johnson
106 1.1 lukem cn: bill
107 1.1 lukem businessCategory: rtest
108 1.1 lukem carLicense: ABC123
109 1.1 lukem departmentNumber: 42
110 1.1 lukem displayName: Bill
111 1.1 lukem employeeNumber: 5150
112 1.1 lukem employeeType: contractor
113 1.1 lukem givenName: Bill
114 1.1 lukem EOTUNIQ2
115 1.1 lukem RC=$?
116 1.1.1.3 adam if test $RC != $RCODEconstraint ; then
117 1.1 lukem echo "unique check failed ($RC)!"
118 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
119 1.1.1.10 christos exit 1
120 1.1 lukem fi
121 1.1 lukem
122 1.1.1.9 christos # ITS#6641/8057/8245
123 1.1.1.5 christos echo "Trying to bypass uniqueness as a normal user..."
124 1.1.1.9 christos $LDAPADD -e \!relax -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
125 1.1.1.9 christos $TESTOUT 2>&1 << EOTUNIQ2
126 1.1.1.9 christos dn: uid=bill,ou=users,o=unique
127 1.1.1.9 christos objectClass: inetOrgPerson
128 1.1.1.9 christos uid: bill
129 1.1.1.9 christos sn: johnson
130 1.1.1.9 christos cn: bill
131 1.1.1.9 christos businessCategory: rtest
132 1.1.1.9 christos carLicense: ABC123
133 1.1.1.9 christos departmentNumber: 42
134 1.1.1.9 christos displayName: Bill
135 1.1.1.9 christos employeeNumber: 5150
136 1.1.1.9 christos employeeType: contractor
137 1.1.1.9 christos givenName: Bill
138 1.1.1.9 christos EOTUNIQ2
139 1.1.1.9 christos RC=$?
140 1.1.1.9 christos if test $RC != $RCODEnorelax && test $RC != $RCODEconstraint ; then
141 1.1.1.9 christos echo "unique check failed ($RC)!"
142 1.1.1.9 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
143 1.1.1.10 christos exit 1
144 1.1.1.9 christos fi
145 1.1.1.9 christos
146 1.1.1.9 christos echo "Trying to bypass uniqueness as a normal user with ManageDSAIt..."
147 1.1.1.9 christos $LDAPADD -M -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
148 1.1.1.5 christos $TESTOUT 2>&1 << EOTUNIQ2
149 1.1.1.5 christos dn: uid=bill,ou=users,o=unique
150 1.1.1.5 christos objectClass: inetOrgPerson
151 1.1.1.5 christos uid: bill
152 1.1.1.5 christos sn: johnson
153 1.1.1.5 christos cn: bill
154 1.1.1.5 christos businessCategory: rtest
155 1.1.1.5 christos carLicense: ABC123
156 1.1.1.5 christos departmentNumber: 42
157 1.1.1.5 christos displayName: Bill
158 1.1.1.5 christos employeeNumber: 5150
159 1.1.1.5 christos employeeType: contractor
160 1.1.1.5 christos givenName: Bill
161 1.1.1.5 christos EOTUNIQ2
162 1.1.1.5 christos RC=$?
163 1.1.1.5 christos if test $RC != $RCODEconstraint ; then
164 1.1.1.5 christos echo "unique check failed ($RC)!"
165 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
166 1.1.1.10 christos exit 1
167 1.1.1.5 christos fi
168 1.1.1.5 christos
169 1.1.1.5 christos echo "Bypassing uniqueness as an admin user..."
170 1.1.1.9 christos $LDAPADD -e \!relax -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
171 1.1.1.5 christos $TESTOUT 2>&1 << EOTUNIQ2
172 1.1.1.5 christos dn: uid=bill,ou=users,o=unique
173 1.1.1.5 christos objectClass: inetOrgPerson
174 1.1.1.5 christos uid: bill
175 1.1.1.5 christos sn: johnson
176 1.1.1.5 christos cn: bill
177 1.1.1.5 christos businessCategory: rtest
178 1.1.1.5 christos carLicense: ABC123
179 1.1.1.5 christos departmentNumber: 42
180 1.1.1.5 christos displayName: Bill
181 1.1.1.5 christos employeeNumber: 5150
182 1.1.1.5 christos employeeType: contractor
183 1.1.1.5 christos givenName: Bill
184 1.1.1.5 christos EOTUNIQ2
185 1.1.1.5 christos RC=$?
186 1.1.1.5 christos if test $RC != 0 ; then
187 1.1.1.5 christos echo "spurious unique error ($RC)!"
188 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
189 1.1.1.5 christos exit $RC
190 1.1.1.5 christos fi
191 1.1.1.5 christos
192 1.1.1.5 christos echo "Cleaning up"
193 1.1.1.9 christos $LDAPDELETE -D "$UNIQUEDN" -H $URI1 -w $PASSWD \
194 1.1.1.5 christos "uid=bill,ou=users,o=unique" > $TESTOUT 2>&1
195 1.1.1.5 christos RC=$?
196 1.1.1.5 christos if test $RC != 0; then
197 1.1.1.5 christos echo "ldapdelete failed ($RC)!"
198 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
199 1.1.1.5 christos exit $RC
200 1.1.1.5 christos fi
201 1.1.1.5 christos
202 1.1 lukem echo Dynamically retrieving initial configuration...
203 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/initial-config.ldif
204 1.1 lukem cat <<EOF >$TESTDIR/initial-reference.ldif
205 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
206 1.1 lukem objectClass: olcOverlayConfig
207 1.1 lukem objectClass: olcUniqueConfig
208 1.1 lukem olcOverlay: {0}unique
209 1.1 lukem olcUniqueBase: o=unique
210 1.1 lukem olcUniqueAttribute: employeeNumber
211 1.1 lukem olcUniqueAttribute: displayName
212 1.1 lukem
213 1.1 lukem EOF
214 1.1 lukem diff $TESTDIR/initial-config.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
215 1.1 lukem RC=$?
216 1.1 lukem if test $RC != 0 ; then
217 1.1 lukem echo "Initial configuration is not reported correctly."
218 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
219 1.1.1.10 christos exit 1
220 1.1 lukem fi
221 1.1 lukem
222 1.1 lukem echo Dynamically trying to add a URI with legacy attrs present...
223 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
224 1.1 lukem > $TESTOUT 2>&1 <<EOF
225 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
226 1.1 lukem changetype: modify
227 1.1 lukem add: olcUniqueURI
228 1.1 lukem olcUniqueURI: ldap:///?employeeNumber,displayName?sub
229 1.1 lukem EOF
230 1.1 lukem RC=$?
231 1.1 lukem if test $RC != 80 ; then
232 1.1 lukem echo "legacy and unique_uri allowed together"
233 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
234 1.1.1.10 christos exit 1
235 1.1 lukem fi
236 1.1 lukem
237 1.1 lukem echo Dynamically trying to add legacy ignored attrs with legacy attrs present...
238 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
239 1.1 lukem > $TESTOUT 2>&1 <<EOF
240 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
241 1.1 lukem changetype: modify
242 1.1 lukem add: olcUniqueIgnore
243 1.1 lukem olcUniqueIgnore: objectClass
244 1.1 lukem EOF
245 1.1 lukem RC=$?
246 1.1 lukem if test $RC != 80 ; then
247 1.1 lukem echo "legacy attrs and legacy ignore attrs allowed together"
248 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
249 1.1.1.10 christos exit 1
250 1.1 lukem fi
251 1.1 lukem
252 1.1 lukem echo Verifying initial configuration intact...
253 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/initial-config-recheck.ldif
254 1.1 lukem diff $TESTDIR/initial-config-recheck.ldif $TESTDIR/initial-reference.ldif > /dev/null 2>&1
255 1.1 lukem RC=$?
256 1.1 lukem if test $RC != 0 ; then
257 1.1 lukem echo "Initial configuration damaged by unsuccessful modifies."
258 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
259 1.1.1.10 christos exit 1
260 1.1 lukem fi
261 1.1 lukem
262 1.1 lukem echo Dynamically removing legacy base...
263 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
264 1.1 lukem > $TESTOUT 2>&1 <<EOF
265 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
266 1.1 lukem changetype: modify
267 1.1 lukem delete: olcUniqueBase
268 1.1 lukem EOF
269 1.1 lukem RC=$?
270 1.1 lukem if test $RC != 0 ; then
271 1.1 lukem echo "base removal failed"
272 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
273 1.1.1.10 christos exit 1
274 1.1 lukem fi
275 1.1 lukem
276 1.1 lukem echo Verifying base removal...
277 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/baseremoval-config.ldif
278 1.1 lukem cat >$TESTDIR/baseremoval-reference.ldif <<EOF
279 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
280 1.1 lukem objectClass: olcOverlayConfig
281 1.1 lukem objectClass: olcUniqueConfig
282 1.1 lukem olcOverlay: {0}unique
283 1.1 lukem olcUniqueAttribute: employeeNumber
284 1.1 lukem olcUniqueAttribute: displayName
285 1.1 lukem
286 1.1 lukem EOF
287 1.1 lukem diff $TESTDIR/baseremoval-config.ldif $TESTDIR/baseremoval-reference.ldif > /dev/null 2>&1
288 1.1 lukem RC=$?
289 1.1 lukem if test $RC != 0 ; then
290 1.1 lukem echo "Configuration damaged by base removal"
291 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
292 1.1.1.10 christos exit 1
293 1.1 lukem fi
294 1.1 lukem
295 1.1 lukem echo "Adding a non-unique record..."
296 1.1.1.9 christos $LDAPADD -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
297 1.1 lukem $TESTOUT 2>&1 << EOTUNIQ2
298 1.1 lukem dn: uid=bill,ou=users,o=unique
299 1.1 lukem objectClass: inetOrgPerson
300 1.1 lukem uid: bill
301 1.1 lukem sn: johnson
302 1.1 lukem cn: bill
303 1.1 lukem businessCategory: rtest
304 1.1 lukem carLicense: ABC123
305 1.1 lukem departmentNumber: 42
306 1.1 lukem displayName: Bill
307 1.1 lukem employeeNumber: 5150
308 1.1 lukem employeeType: contractor
309 1.1 lukem givenName: Bill
310 1.1 lukem EOTUNIQ2
311 1.1 lukem RC=$?
312 1.1.1.3 adam if test $RC != $RCODEconstraint ; then
313 1.1 lukem echo "unique check failed ($RC)!"
314 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
315 1.1.1.10 christos exit 1
316 1.1 lukem fi
317 1.1 lukem
318 1.1 lukem echo Trying a legacy base outside of the backend...
319 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
320 1.1 lukem > $TESTOUT 2>&1 <<EOF
321 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
322 1.1 lukem changetype: modify
323 1.1 lukem add: olcUniqueBase
324 1.1 lukem olcUniqueBase: cn=config
325 1.1 lukem EOF
326 1.1 lukem RC=$?
327 1.1 lukem if test $RC != 80 ; then
328 1.1 lukem echo "out of backend scope base allowed"
329 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
330 1.1.1.10 christos exit 1
331 1.1 lukem fi
332 1.1 lukem
333 1.1 lukem echo "Adding and removing attrs..."
334 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
335 1.1 lukem > $TESTOUT 2>&1 <<EOF
336 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
337 1.1 lukem changetype: modify
338 1.1 lukem add: olcUniqueAttribute
339 1.1 lukem olcUniqueAttribute: description
340 1.1 lukem olcUniqueAttribute: telephoneNumber
341 1.1 lukem -
342 1.1 lukem delete: olcUniqueAttribute
343 1.1 lukem olcUniqueAttribute: displayName
344 1.1 lukem EOF
345 1.1 lukem RC=$?
346 1.1 lukem if test $RC != 0 ; then
347 1.1 lukem echo "Unable to remove an attribute"
348 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
349 1.1.1.10 christos exit 1
350 1.1 lukem fi
351 1.1 lukem
352 1.1 lukem echo "Verifying we removed the right attr..."
353 1.1.1.9 christos $LDAPADD -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
354 1.1 lukem $TESTOUT 2>&1 << EOTUNIQ2
355 1.1 lukem dn: uid=bill,ou=users,o=unique
356 1.1 lukem objectClass: inetOrgPerson
357 1.1 lukem uid: bill
358 1.1 lukem sn: johnson
359 1.1 lukem cn: bill
360 1.1 lukem businessCategory: rtest
361 1.1 lukem carLicense: ABC123
362 1.1 lukem departmentNumber: 42
363 1.1 lukem displayName: Bill
364 1.1 lukem employeeNumber: 5150
365 1.1 lukem employeeType: contractor
366 1.1 lukem givenName: Bill
367 1.1 lukem EOTUNIQ2
368 1.1 lukem RC=$?
369 1.1.1.3 adam if test $RC != $RCODEconstraint ; then
370 1.1.1.9 christos echo "olcUniqueAttribute single deletion hit the wrong value"
371 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
372 1.1.1.10 christos exit 1
373 1.1 lukem fi
374 1.1 lukem
375 1.1 lukem echo Removing legacy config and adding URIs...
376 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
377 1.1 lukem > $TESTOUT 2>&1 <<EOF
378 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
379 1.1 lukem changetype: modify
380 1.1 lukem delete: olcUniqueAttribute
381 1.1 lukem -
382 1.1 lukem add: olcUniqueURI
383 1.1 lukem olcUniqueURI: ldap:///?employeeNumber,displayName?sub
384 1.1 lukem olcUniqueURI: ldap:///?description?one
385 1.1 lukem EOF
386 1.1 lukem RC=$?
387 1.1 lukem if test $RC != 0 ; then
388 1.1 lukem echo "Reconfiguration to URIs failed"
389 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
390 1.1.1.10 christos exit 1
391 1.1 lukem fi
392 1.1 lukem
393 1.1 lukem echo Dynamically retrieving second configuration...
394 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/second-config.ldif
395 1.1 lukem cat >$TESTDIR/second-reference.ldif <<EOF
396 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
397 1.1 lukem objectClass: olcOverlayConfig
398 1.1 lukem objectClass: olcUniqueConfig
399 1.1 lukem olcOverlay: {0}unique
400 1.1 lukem olcUniqueURI: ldap:///?employeeNumber,displayName?sub
401 1.1 lukem olcUniqueURI: ldap:///?description?one
402 1.1 lukem
403 1.1 lukem EOF
404 1.1 lukem diff $TESTDIR/second-config.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
405 1.1 lukem RC=$?
406 1.1 lukem if test $RC != 0 ; then
407 1.1 lukem echo "Second configuration is not reported correctly."
408 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
409 1.1.1.10 christos exit 1
410 1.1 lukem fi
411 1.1 lukem
412 1.1 lukem echo "Adding a non-unique record..."
413 1.1.1.9 christos $LDAPADD -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
414 1.1 lukem $TESTOUT 2>&1 << EOTUNIQ2
415 1.1 lukem dn: uid=bill,ou=users,o=unique
416 1.1 lukem objectClass: inetOrgPerson
417 1.1 lukem uid: bill
418 1.1 lukem sn: johnson
419 1.1 lukem cn: bill
420 1.1 lukem businessCategory: rtest
421 1.1 lukem carLicense: ABC123
422 1.1 lukem departmentNumber: 42
423 1.1 lukem displayName: Bill
424 1.1 lukem employeeNumber: 5150
425 1.1 lukem employeeType: contractor
426 1.1 lukem givenName: Bill
427 1.1 lukem EOTUNIQ2
428 1.1 lukem RC=$?
429 1.1.1.3 adam if test $RC != $RCODEconstraint ; then
430 1.1 lukem echo "unique check failed ($RC)!"
431 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
432 1.1.1.10 christos exit 1
433 1.1 lukem fi
434 1.1 lukem
435 1.1 lukem echo Dynamically trying to add legacy base
436 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
437 1.1 lukem > $TESTOUT 2>&1 <<EOF
438 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
439 1.1 lukem changetype: modify
440 1.1 lukem add: olcUniqueBase
441 1.1 lukem olcUniqueBase: o=unique
442 1.1 lukem EOF
443 1.1 lukem RC=$?
444 1.1 lukem if test $RC != 80 ; then
445 1.1 lukem echo "legacy base allowed with URIs"
446 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
447 1.1.1.10 christos exit 1
448 1.1 lukem fi
449 1.1 lukem
450 1.1 lukem echo Dynamically trying to add legacy attrs
451 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
452 1.1 lukem > $TESTOUT 2>&1 <<EOF
453 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
454 1.1 lukem changetype: modify
455 1.1 lukem add: olcUniqueAttribute
456 1.1 lukem olcUniqueAttribute: description
457 1.1 lukem EOF
458 1.1 lukem RC=$?
459 1.1 lukem if test $RC != 80 ; then
460 1.1 lukem echo "legacy attributes allowed with URIs"
461 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
462 1.1.1.10 christos exit 1
463 1.1 lukem fi
464 1.1 lukem
465 1.1 lukem echo Dynamically trying to add legacy strictness
466 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
467 1.1 lukem > $TESTOUT 2>&1 <<EOF
468 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
469 1.1 lukem changetype: modify
470 1.1 lukem add: olcUniqueStrict
471 1.1 lukem olcUniqueStrict: TRUE
472 1.1 lukem EOF
473 1.1 lukem RC=$?
474 1.1 lukem if test $RC != 80 ; then
475 1.1 lukem echo "legacy strictness allowed with URIs"
476 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
477 1.1.1.10 christos exit 1
478 1.1 lukem fi
479 1.1 lukem
480 1.1 lukem #echo ----------------------
481 1.1 lukem echo Dynamically trying a bad filter...
482 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
483 1.1 lukem > $TESTOUT 2>&1 <<EOF
484 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
485 1.1 lukem changetype: modify
486 1.1 lukem replace: olcUniqueURI
487 1.1 lukem olcUniqueURI: ldap:///?sn?sub?((cn=e*))
488 1.1 lukem EOF
489 1.1 lukem RC=$?
490 1.1 lukem if test $RC != 80 ; then
491 1.1 lukem echo "bad filter allowed"
492 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
493 1.1.1.10 christos exit 1
494 1.1 lukem fi
495 1.1 lukem
496 1.1 lukem echo Verifying second configuration intact...
497 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/second-config-recheck.ldif
498 1.1 lukem diff $TESTDIR/second-config-recheck.ldif $TESTDIR/second-reference.ldif > /dev/null 2>&1
499 1.1 lukem RC=$?
500 1.1 lukem if test $RC != 0 ; then
501 1.1 lukem echo "Second configuration damaged by rejected modifies."
502 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
503 1.1.1.10 christos exit 1
504 1.1 lukem fi
505 1.1 lukem
506 1.1 lukem #echo ----------------------
507 1.1 lukem echo Dynamically reconfiguring to use different URIs...
508 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
509 1.1 lukem > $TESTOUT 2>&1 <<EOF
510 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
511 1.1 lukem changetype: modify
512 1.1 lukem add: olcUniqueURI
513 1.1 lukem olcUniqueURI: ldap:///?sn?sub?(cn=e*)
514 1.1.1.2 lukem olcUniqueURI: ldap:///?uid?sub?(cn=edgar)
515 1.1 lukem -
516 1.1 lukem delete: olcUniqueURI
517 1.1 lukem olcUniqueURI: ldap:///?description?one
518 1.1 lukem EOF
519 1.1 lukem RC=$?
520 1.1 lukem if test $RC != 0 ; then
521 1.1 lukem echo "unable to reconfigure"
522 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
523 1.1.1.10 christos exit 1
524 1.1 lukem fi
525 1.1 lukem
526 1.1 lukem echo Dynamically retrieving third configuration...
527 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/third-config.ldif
528 1.1 lukem cat >$TESTDIR/third-reference.ldif <<EOF
529 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
530 1.1 lukem objectClass: olcOverlayConfig
531 1.1 lukem objectClass: olcUniqueConfig
532 1.1 lukem olcOverlay: {0}unique
533 1.1 lukem olcUniqueURI: ldap:///?employeeNumber,displayName?sub
534 1.1 lukem olcUniqueURI: ldap:///?sn?sub?(cn=e*)
535 1.1.1.2 lukem olcUniqueURI: ldap:///?uid?sub?(cn=edgar)
536 1.1 lukem
537 1.1 lukem EOF
538 1.1 lukem diff $TESTDIR/third-config.ldif $TESTDIR/third-reference.ldif > /dev/null 2>&1
539 1.1 lukem RC=$?
540 1.1 lukem if test $RC != 0 ; then
541 1.1 lukem echo "Third configuration is not reported correctly."
542 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
543 1.1.1.10 christos exit 1
544 1.1 lukem fi
545 1.1 lukem
546 1.1 lukem echo "Adding a record unique in both domains if filtered..."
547 1.1 lukem
548 1.1.1.9 christos $LDAPADD -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
549 1.1 lukem $TESTOUT 2>&1 << EOF
550 1.1 lukem dn: uid=edgar,ou=users,o=unique
551 1.1 lukem objectClass: inetOrgPerson
552 1.1 lukem uid: edgar
553 1.1 lukem sn: johnson
554 1.1 lukem cn: edgar
555 1.1 lukem EOF
556 1.1 lukem
557 1.1 lukem RC=$?
558 1.1 lukem if test $RC != 0 ; then
559 1.1 lukem echo "unique check failed ($RC)!"
560 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
561 1.1.1.10 christos exit 1
562 1.1 lukem fi
563 1.1 lukem
564 1.1.1.2 lukem echo "Adding a record unique in all domains because of filter conditions "
565 1.1.1.9 christos $LDAPADD -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
566 1.1.1.2 lukem $TESTOUT 2>&1 << EOF
567 1.1.1.2 lukem dn: uid=empty,ou=users,o=unique
568 1.1.1.2 lukem objectClass: inetOrgPerson
569 1.1.1.2 lukem uid: edgar
570 1.1.1.2 lukem cn: empty
571 1.1.1.2 lukem sn: empty
572 1.1.1.2 lukem EOF
573 1.1.1.2 lukem
574 1.1.1.2 lukem RC=$?
575 1.1.1.2 lukem if test $RC != 0 ; then
576 1.1.1.2 lukem echo "spurious unique error ($RC)!"
577 1.1.1.2 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
578 1.1.1.10 christos exit 1
579 1.1.1.2 lukem fi
580 1.1.1.2 lukem
581 1.1.1.6 christos echo "Sending an empty modification"
582 1.1.1.6 christos
583 1.1.1.9 christos $LDAPMODIFY -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
584 1.1.1.6 christos $TESTOUT 2>&1 << EOF
585 1.1.1.6 christos dn: uid=empty,ou=users,o=unique
586 1.1.1.6 christos changetype: modify
587 1.1.1.6 christos EOF
588 1.1.1.6 christos
589 1.1.1.6 christos RC=$?
590 1.1.1.6 christos if test $RC != 0 ; then
591 1.1.1.6 christos echo "spurious unique error ($RC)!"
592 1.1.1.6 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
593 1.1.1.10 christos exit 1
594 1.1.1.6 christos fi
595 1.1.1.6 christos
596 1.1.1.5 christos echo "Making a record non-unique"
597 1.1.1.9 christos $LDAPMODIFY -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
598 1.1.1.5 christos $TESTOUT 2>&1 << EOF
599 1.1.1.5 christos dn: uid=empty,ou=users,o=unique
600 1.1.1.5 christos changetype: modify
601 1.1.1.5 christos replace: sn
602 1.1.1.5 christos sn: johnson
603 1.1.1.5 christos EOF
604 1.1.1.2 lukem
605 1.1.1.5 christos RC=$?
606 1.1.1.5 christos if test $RC != $RCODEconstraint ; then
607 1.1.1.5 christos echo "unique check failed ($RC)!"
608 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
609 1.1.1.10 christos exit 1
610 1.1.1.5 christos fi
611 1.1 lukem
612 1.1.1.9 christos # ITS#6641/8057/8245
613 1.1.1.5 christos echo "Trying to bypass uniqueness as a normal user..."
614 1.1.1.9 christos $LDAPMODIFY -e \!relax -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
615 1.1.1.9 christos $TESTOUT 2>&1 << EOF
616 1.1.1.9 christos dn: uid=empty,ou=users,o=unique
617 1.1.1.9 christos changetype: modify
618 1.1.1.9 christos replace: sn
619 1.1.1.9 christos sn: johnson
620 1.1.1.9 christos EOF
621 1.1.1.9 christos
622 1.1.1.9 christos RC=$?
623 1.1.1.9 christos if test $RC != $RCODEnorelax && test $RC != $RCODEconstraint ; then
624 1.1.1.9 christos echo "unique check failed ($RC)!"
625 1.1.1.9 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
626 1.1.1.10 christos exit 1
627 1.1.1.9 christos fi
628 1.1.1.9 christos
629 1.1.1.9 christos echo "Trying to bypass uniqueness as a normal user with ManageDSAIt..."
630 1.1.1.9 christos $LDAPMODIFY -M -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
631 1.1.1.5 christos $TESTOUT 2>&1 << EOF
632 1.1.1.5 christos dn: uid=empty,ou=users,o=unique
633 1.1.1.5 christos changetype: modify
634 1.1.1.5 christos replace: sn
635 1.1.1.5 christos sn: johnson
636 1.1.1.5 christos EOF
637 1.1.1.5 christos
638 1.1.1.5 christos RC=$?
639 1.1.1.5 christos if test $RC != $RCODEconstraint ; then
640 1.1.1.5 christos echo "unique check failed ($RC)!"
641 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
642 1.1.1.10 christos exit 1
643 1.1.1.5 christos fi
644 1.1.1.5 christos
645 1.1.1.5 christos echo "Bypassing uniqueness as an admin user..."
646 1.1.1.9 christos $LDAPMODIFY -e \!relax -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
647 1.1.1.5 christos $TESTOUT 2>&1 << EOF
648 1.1.1.5 christos dn: uid=empty,ou=users,o=unique
649 1.1.1.5 christos changetype: modify
650 1.1.1.5 christos replace: sn
651 1.1.1.5 christos sn: johnson
652 1.1.1.5 christos EOF
653 1.1.1.5 christos
654 1.1.1.5 christos RC=$?
655 1.1.1.5 christos if test $RC != 0 ; then
656 1.1.1.5 christos echo "spurious unique error ($RC)!"
657 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
658 1.1.1.5 christos exit $RC
659 1.1.1.5 christos fi
660 1.1.1.5 christos
661 1.1.1.5 christos echo "Cleaning up"
662 1.1.1.9 christos $LDAPMODIFY -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
663 1.1.1.5 christos $TESTOUT 2>&1 << EOF
664 1.1.1.5 christos dn: uid=empty,ou=users,o=unique
665 1.1.1.5 christos changetype: modify
666 1.1.1.5 christos replace: sn
667 1.1.1.5 christos sn: empty
668 1.1.1.5 christos EOF
669 1.1.1.5 christos
670 1.1.1.5 christos RC=$?
671 1.1.1.5 christos if test $RC != 0; then
672 1.1.1.5 christos echo "ldapmodify failed ($RC)!"
673 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
674 1.1.1.5 christos exit $RC
675 1.1.1.5 christos fi
676 1.1.1.5 christos
677 1.1.1.5 christos echo "Adding another unique record..."
678 1.1.1.9 christos $LDAPADD -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
679 1.1 lukem $TESTOUT 2>&1 << EOF
680 1.1.1.5 christos dn: uid=not edgar,uid=edgar,ou=users,o=unique
681 1.1.1.5 christos objectClass: inetOrgPerson
682 1.1.1.5 christos uid: not edgar
683 1.1.1.5 christos sn: Alan
684 1.1.1.5 christos cn: not edgar
685 1.1.1.5 christos EOF
686 1.1.1.5 christos
687 1.1.1.5 christos RC=$?
688 1.1.1.5 christos if test $RC != 0 ; then
689 1.1.1.5 christos echo "unique check failed ($RC)!"
690 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
691 1.1.1.10 christos exit 1
692 1.1.1.5 christos fi
693 1.1.1.5 christos
694 1.1.1.5 christos echo "Making the record non-unique with modrdn..."
695 1.1.1.9 christos $LDAPMODRDN -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD \
696 1.1.1.5 christos "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
697 1.1.1.5 christos
698 1.1.1.5 christos RC=$?
699 1.1.1.5 christos if test $RC != $RCODEconstraint ; then
700 1.1.1.5 christos echo "unique check failed ($RC)!"
701 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
702 1.1.1.10 christos exit 1
703 1.1.1.5 christos fi
704 1.1.1.5 christos
705 1.1.1.9 christos # ITS#6641/8057/8245
706 1.1.1.5 christos echo "Trying to bypass uniqueness as a normal user..."
707 1.1.1.9 christos $LDAPMODRDN -e \!relax -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD \
708 1.1.1.9 christos "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
709 1.1.1.9 christos
710 1.1.1.9 christos RC=$?
711 1.1.1.9 christos if test $RC != $RCODEnorelax && test $RC != $RCODEconstraint ; then
712 1.1.1.9 christos echo "unique check failed ($RC)!"
713 1.1.1.9 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
714 1.1.1.10 christos exit 1
715 1.1.1.9 christos fi
716 1.1.1.9 christos
717 1.1.1.9 christos echo "Trying to bypass uniqueness as a normal user with a ManageDSAIt control..."
718 1.1.1.9 christos $LDAPMODRDN -M -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD \
719 1.1.1.5 christos "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
720 1.1.1.5 christos
721 1.1.1.5 christos RC=$?
722 1.1.1.5 christos if test $RC != $RCODEconstraint ; then
723 1.1.1.5 christos echo "unique check failed ($RC)!"
724 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
725 1.1.1.10 christos exit 1
726 1.1.1.5 christos fi
727 1.1.1.5 christos
728 1.1.1.5 christos echo "Bypassing uniqueness as an admin user..."
729 1.1.1.9 christos $LDAPMODRDN -e \!relax -D "$UNIQUEDN" -H $URI1 -w $PASSWD \
730 1.1.1.5 christos "uid=not edgar,uid=edgar,ou=users,o=unique" "uid=edgar" > $TESTOUT 2>&1
731 1.1.1.5 christos
732 1.1.1.5 christos RC=$?
733 1.1.1.5 christos if test $RC != 0 ; then
734 1.1.1.5 christos echo "spurious unique error ($RC)!"
735 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
736 1.1.1.5 christos exit $RC
737 1.1.1.5 christos fi
738 1.1.1.5 christos
739 1.1.1.5 christos echo "Cleaning up"
740 1.1.1.9 christos $LDAPDELETE -D "$UNIQUEDN" -H $URI1 -w $PASSWD \
741 1.1.1.5 christos "uid=edgar,uid=edgar,ou=users,o=unique" > $TESTOUT 2>&1
742 1.1.1.5 christos RC=$?
743 1.1.1.5 christos if test $RC != 0; then
744 1.1.1.5 christos echo "ldapdelete failed ($RC)!"
745 1.1.1.5 christos test $KILLSERVERS != no && kill -HUP $KILLPIDS
746 1.1.1.5 christos exit $RC
747 1.1.1.5 christos fi
748 1.1.1.5 christos
749 1.1.1.5 christos echo "Adding a record unique in one domain, non-unique in the filtered domain..."
750 1.1.1.5 christos
751 1.1.1.9 christos $LDAPADD -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
752 1.1.1.5 christos $TESTOUT 2>&1 << EOF
753 1.1 lukem dn: uid=elvis,ou=users,o=unique
754 1.1 lukem objectClass: inetOrgPerson
755 1.1 lukem uid: elvis
756 1.1 lukem sn: johnson
757 1.1 lukem cn: elvis
758 1.1 lukem EOF
759 1.1 lukem
760 1.1 lukem RC=$?
761 1.1.1.3 adam if test $RC != $RCODEconstraint ; then
762 1.1 lukem echo "unique check failed ($RC)!"
763 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
764 1.1.1.10 christos exit 1
765 1.1 lukem fi
766 1.1 lukem
767 1.1 lukem #echo ----------------------
768 1.1 lukem echo Dynamically reconfiguring to use attribute-ignore URIs...
769 1.1.1.9 christos $LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF \
770 1.1 lukem > $TESTOUT 2>&1 <<EOF
771 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
772 1.1 lukem changetype: modify
773 1.1 lukem replace: olcUniqueURI
774 1.1 lukem olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
775 1.1 lukem EOF
776 1.1 lukem RC=$?
777 1.1 lukem if test $RC != 0 ; then
778 1.1 lukem echo "unable to reconfigure"
779 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
780 1.1.1.10 christos exit 1
781 1.1 lukem fi
782 1.1 lukem
783 1.1 lukem echo Dynamically retrieving fourth configuration...
784 1.1.1.9 christos $LDAPSEARCH -S "" -b olcOverlay='{0}'unique,olcDatabase='{1}'$BACKEND,cn=config -D cn=config -y $CONFIGPWF -H $URI1 -LLL | tr -d \\r >$TESTDIR/fourth-config.ldif
785 1.1 lukem cat >$TESTDIR/fourth-reference.ldif <<EOF
786 1.1 lukem dn: olcOverlay={0}unique,olcDatabase={1}$BACKEND,cn=config
787 1.1 lukem objectClass: olcOverlayConfig
788 1.1 lukem objectClass: olcUniqueConfig
789 1.1 lukem olcOverlay: {0}unique
790 1.1 lukem olcUniqueURI: ignore ldap:///?objectClass,uid,cn,sn?sub
791 1.1 lukem
792 1.1 lukem EOF
793 1.1 lukem diff $TESTDIR/fourth-config.ldif $TESTDIR/fourth-reference.ldif > /dev/null 2>&1
794 1.1 lukem RC=$?
795 1.1 lukem if test $RC != 0 ; then
796 1.1 lukem echo "Fourth configuration is not reported correctly."
797 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
798 1.1.1.10 christos exit 1
799 1.1 lukem fi
800 1.1 lukem
801 1.1 lukem echo "Adding a record unique in the ignore-domain..."
802 1.1 lukem
803 1.1.1.9 christos $LDAPADD -D "$UNIQUEDN" -H $URI1 -w $PASSWD > \
804 1.1 lukem $TESTOUT 2>&1 << EOF
805 1.1 lukem dn: uid=elvis,ou=users,o=unique
806 1.1 lukem objectClass: inetOrgPerson
807 1.1 lukem uid: elvis
808 1.1 lukem sn: johnson
809 1.1 lukem cn: elvis
810 1.1 lukem description: left the building
811 1.1 lukem EOF
812 1.1 lukem
813 1.1 lukem RC=$?
814 1.1 lukem if test $RC != 0 ; then
815 1.1 lukem echo "unique check failed ($RC)!"
816 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
817 1.1.1.10 christos exit 1
818 1.1 lukem fi
819 1.1 lukem
820 1.1 lukem echo "Adding a record non-unique in the ignore-domain..."
821 1.1 lukem
822 1.1.1.9 christos $LDAPADD -D "uid=dave,ou=users,o=unique" -H $URI1 -w $PASSWD > \
823 1.1 lukem $TESTOUT 2>&1 << EOF
824 1.1 lukem dn: uid=harry,ou=users,o=unique
825 1.1 lukem objectClass: inetOrgPerson
826 1.1 lukem uid: harry
827 1.1 lukem sn: johnson
828 1.1 lukem cn: harry
829 1.1 lukem description: left the building
830 1.1 lukem EOF
831 1.1 lukem
832 1.1 lukem RC=$?
833 1.1.1.3 adam if test $RC != $RCODEconstraint ; then
834 1.1 lukem echo "unique check failed ($RC)!"
835 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
836 1.1.1.10 christos exit 1
837 1.1 lukem fi
838 1.1 lukem
839 1.1 lukem test $KILLSERVERS != no && kill -HUP $KILLPIDS
840 1.1 lukem
841 1.1 lukem echo ">>>>> Test succeeded"
842 1.1 lukem
843 1.1 lukem test $KILLSERVERS != no && wait
844 1.1 lukem
845 1.1 lukem exit 0
846