# environment variable RACE_TESTS can be set to the number of race test
# iterations the script should perform.
-case "$BACKEND" in ldif | null)
- # LDIF lacks ACL support, NULL lacks cn=config support
- echo "This test does not support the $BACKEND backend"
- exit 0;;
-esac
+if test "$BACKEND" = ldif ; then
+ echo "$backend backend does not support access controls, test skipped"
+ exit 0
+fi
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
fi
fi
+nullExclude="" nullOK="" wantNoObj=32
+test $BACKEND = null && nullExclude="# " nullOK="OK" wantNoObj=0
+
$LDAPADD -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SMC_DIR/db
+${nullExclude}olcDbDirectory: $SMC_DIR/db
olcSuffix: $BASEDN
olcRootDN: $MANAGERDN
olcRootPW: $PASSWD
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SMC_DIR/ou1
+${nullExclude}olcDbDirectory: $SMC_DIR/ou1
olcSubordinate: TRUE
olcSuffix: ou=ou1,$BASEDN
olcRootDN: $MANAGERDN
dn: olcDatabase={2}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {2}$BACKEND
-olcDbDirectory: $SMC_DIR/ou2
+${nullExclude}olcDbDirectory: $SMC_DIR/ou2
olcSubordinate: TRUE
olcSuffix: ou=ou2,$BASEDN
olcRootDN: $MANAGERDN
dn: olcDatabase={3}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {3}$BACKEND
-olcDbDirectory: $SMC_DIR/sm1ou1
+${nullExclude}olcDbDirectory: $SMC_DIR/sm1ou1
olcSubordinate: TRUE
olcSuffix: ou=sm1ou1,$BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={4}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {4}$BACKEND
-olcDbDirectory: $SMC_DIR/sm1ou2
+${nullExclude}olcDbDirectory: $SMC_DIR/sm1ou2
olcSubordinate: TRUE
olcSuffix: ou=sm1ou2,$BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={5}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {5}$BACKEND
-olcDbDirectory: $SMC_DIR/sm2ou1
+${nullExclude}olcDbDirectory: $SMC_DIR/sm2ou1
olcSubordinate: TRUE
olcSuffix: ou=sm2ou1,$BASEDN
olcRootDN: $UPDATEDN
$LDAPADD -D cn=config -H $URI2 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SM1_DIR/db
+${nullExclude}olcDbDirectory: $SM1_DIR/db
olcSuffix: $BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SM1_DIR/ou1
+${nullExclude}olcDbDirectory: $SM1_DIR/ou1
olcSubordinate: TRUE
olcSuffix: ou=ou1,$BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={2}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {2}$BACKEND
-olcDbDirectory: $SM1_DIR/sm1ou1
+${nullExclude}olcDbDirectory: $SM1_DIR/sm1ou1
olcSubordinate: TRUE
olcSuffix: ou=sm1ou1,$BASEDN
olcRootDN: ou=sm1ou1,$BASEDN
dn: olcDatabase={3}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {3}$BACKEND
-olcDbDirectory: $SM1_DIR/sm1ou2
+${nullExclude}olcDbDirectory: $SM1_DIR/sm1ou2
olcSubordinate: TRUE
olcSuffix: ou=sm1ou2,$BASEDN
olcRootDN: ou=sm1ou1,$BASEDN
$LDAPADD -D cn=config -H $URI3 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SM2_DIR/db
+${nullExclude}olcDbDirectory: $SM2_DIR/db
olcSuffix: $BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SM2_DIR/ou2
+${nullExclude}olcDbDirectory: $SM2_DIR/ou2
olcSubordinate: TRUE
olcSuffix: ou=ou2,$BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={2}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {2}$BACKEND
-olcDbDirectory: $SM2_DIR/sm1ou1
+${nullExclude}olcDbDirectory: $SM2_DIR/sm1ou1
olcSubordinate: TRUE
olcSuffix: ou=sm1ou1,$BASEDN
olcRootDN: $UPDATEDN
dn: olcDatabase={3}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {3}$BACKEND
-olcDbDirectory: $SM2_DIR/sm2ou1
+${nullExclude}olcDbDirectory: $SM2_DIR/sm2ou1
olcSubordinate: TRUE
olcSuffix: ou=sm2ou1,$BASEDN
olcRootDN: ou=sm2ou1,$BASEDN
dn: olcDatabase={4}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {4}$BACKEND
-olcDbDirectory: $SM2_DIR/sm2ou2
+${nullExclude}olcDbDirectory: $SM2_DIR/sm2ou2
olcSubordinate: TRUE
olcSuffix: ou=sm2ou2,$BASEDN
olcRootDN: ou=sm2ou1,$BASEDN
$LDAPADD -D cn=config -H $URI4 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SSC_DIR/db
+${nullExclude}olcDbDirectory: $SSC_DIR/db
olcSuffix: $BASEDN
olcRootDN: $UPDATEDN
$LDAPADD -D cn=config -H $URI5 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SS1_DIR/db
+${nullExclude}olcDbDirectory: $SS1_DIR/db
olcSuffix: $BASEDN
olcRootDN: $UPDATEDN
$LDAPADD -D cn=config -H $URI6 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
objectClass: olcDatabaseConfig
-objectClass: olc${BACKEND}Config
+${nullExclude}objectClass: olc${BACKEND}Config
olcDatabase: {1}$BACKEND
-olcDbDirectory: $SS2_DIR/db
+${nullExclude}olcDbDirectory: $SS2_DIR/db
olcSuffix: $BASEDN
olcRootDN: $UPDATEDN
RESULT=`$LDAPSEARCH -H $URI2 \
-s base -b "ou=ou1,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI3 \
-s base -b "ou=ou1,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI1 \
-s base -b "ou=sm2ou1,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI1 \
-s base -b "ou=sm1ou1,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI4 \
-s base -b "$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI5 \
-s base -b "$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI6 \
-s base -b "$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
EOF
+test $BACKEND = null && echo : > $TESTDIR/checkcsn.sh
+
chmod +x $TESTDIR/checkcsn.sh
RESULT=`$LDAPSEARCH -H $URI4 \
-s base -b "ou=ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI5 \
-s base -b "ou=ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI6 \
-s base -b "ou=ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI6 \
-s base -b "ou=ou2,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI5 \
-s base -b "ou=sm1ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI3 \
-s base -b "ou=sm1ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI5 \
-s base -b "ou=sm1ou2,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI1 \
-s base -b "ou=sm2ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI6 \
-s base -b "ou=sm2ou1,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI6 \
-s base -b "ou=sm2ou2,$BASEDN" \
"(description=Modify$MNUM)" 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI3 \
-s base -b "$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI6 \
-s base -b "$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI1 \
-s base -b "ou=sm1ou2,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI1 \
-s base -b "ou=sm1ou2,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI4 \
-s base -b "ou=sm1ou2,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
RESULT=`$LDAPSEARCH -H $URI4 \
-s base -b "ou=sm1ou2,$BASEDN" \
'(objectClass=*)' 2>&1 | awk '/^dn:/ {print "OK"}'`
- if test "x$RESULT" = "xOK" ; then
+ if test "x$RESULT$nullOK" = "xOK" ; then
RC=0
break
fi
for i in 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$SUB_DN" -H $URI1 > /dev/null 2>&1
RC=$?
- if test $RC = 32; then break; fi
+ if test $RC = $wantNoObj; then break; fi
sleep $i
done
- if test $RC != 32; then
+ if test $RC != $wantNoObj; then
if test $RC != 0; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
sleep $i
done
- if test $RC != 32; then
+ if test $RC != $wantNoObj; then
echo "ERROR: Entry not removed on central search! (RC=$RC)"
RACE_ERROR=1
break