3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2017 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 "running defines.sh"
17 . $SRCDIR/scripts/defines.sh
20 echo " This test tracks a case where the -g flag to slapcat fails to work"
21 echo " correctly, exporting the subordinate dbs as well as the root db."
22 echo " See http://www.openldap.org/its/index.cgi/?findid=8667 for more information."
25 DBDIR1=$TESTDIR/db.1.a
26 DBDIR2=$TESTDIR/db.2.a
27 DBDIR3=$TESTDIR/db.3.a
28 DBDIR4=$TESTDIR/db.4.a
29 CFPRO=$TESTDIR/slapd.d
31 mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $CFPRO
33 $SLAPPASSWD -g -n >$CONFIGPWF
36 ITSDIR=$DATADIR/regressions/its$ITS
38 echo "Starting slapd on TCP/IP port $PORT1..."
39 . $CONFFILTER $BACKEND $MONITORDB < $ITSDIR/slapd.ldif > $CONFLDIF
40 $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF
42 echo "Populating root database..."
43 $SLAPADD -F $CFPRO -b "dc=example,dc=com" -l $ITSDIR/root.ldif >> $TESTOUT 2>&1
45 if test $RC != 0 ; then
46 echo "slapadd failed for root database ($RC)!"
50 echo "Populating accounting database..."
51 $SLAPADD -F $CFPRO -b "dc=accounting,dc=example,dc=com" -l $ITSDIR/accounting.ldif >> $TESTOUT 2>&1
53 if test $RC != 0 ; then
54 echo "slapadd failed for accounting database ($RC)!"
58 echo "Populating administrative database..."
59 $SLAPADD -F $CFPRO -b "dc=administrative,dc=example,dc=com" -l $ITSDIR/administrative.ldif >> $TESTOUT 2>&1
61 if test $RC != 0 ; then
62 echo "slapadd failed for administrative database ($RC)!"
66 echo "Populating janitorial database..."
67 $SLAPADD -F $CFPRO -b "dc=janitorial,dc=example,dc=com" -l $ITSDIR/janitorial.ldif >> $TESTOUT 2>&1
69 if test $RC != 0 ; then
70 echo "slapadd failed for janitorial database ($RC)!"
74 echo "Using slapcat -g to export only the root database..."
75 $SLAPCAT -F $CFPRO -g -b "dc=example,dc=com" -l $TESTDIR/slapcat.out >> $TESTOUT 2>&1
78 if test $RC != 0 ; then
79 echo "slapcat -g failed for root databse ($RC)!"
83 echo "Verifying Administrative subordinate is not found..."
84 grep "dn: ou=Administrative,dc=example,dc=com" $TESTDIR/slapcat.out >> $TESTOUT 2>&1
87 if test $RC = 0 ; then
88 echo "test failed - Administrative subordinate found."
89 echo "This is a regression of ITS8667"
93 echo "Verifying Accounting subordinate is not found..."
94 grep "dn: ou=Accounting,dc=example,dc=com" $TESTDIR/slapcat.out >> $TESTOUT 2>&1
97 if test $RC = 0 ; then
98 echo "test failed - Accounting subordinate found."
99 echo "This is a regression of ITS8667"
103 echo "Verifying Janitorial subordinate is not found..."
104 grep "dn: ou=Janitorial,dc=example,dc=com" $TESTDIR/slapcat.out >> $TESTOUT 2>&1
107 if test $RC = 0 ; then
108 echo "test failed - Janitorial subordinate found."
109 echo "This is a regression of ITS8667"
114 echo ">>>>> Test succeeded"