4 if test $# -eq 0 ; then
9 if test $# -eq 1 ; then
13 echo "running defines.sh $SRCDIR $BACKEND"
14 . $SRCDIR/scripts/defines.sh
16 echo "Cleaning up in $DBDIR..."
20 echo "Starting slapd on TCP/IP port $PORT..."
21 $SLAPD -f $PWCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
24 echo "Using ldapsearch to check that slapd is running..."
25 for i in 0 1 2 3 4 5; do
26 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
27 'objectclass=*' > /dev/null 2>&1
29 if test $RC = 1 ; then
30 echo "Waiting 5 seconds for slapd to start..."
35 echo "Using ldapadd to populate the database..."
36 $LDAPADD -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD < \
37 $LDIFPASSWD > $TESTOUT 2>&1
39 if test $RC != 0 ; then
40 echo "ldapadd failed ($RC)!"
48 echo "Using ldapsearch to verify population ..."
49 echo "++ Initial search" >> $SEARCHOUT
50 $LDAPSEARCH -h localhost -p $PORT \
51 -D "$MANAGERDN" -w $PASSWD \
53 'objectclass=*' >> $SEARCHOUT 2>&1
55 echo "Using ldappasswd (PASS 1) ..."
56 echo "Pass 1" >> $TESTOUT
57 $LDAPPASSWD -h localhost -p $PORT \
58 -w secret -s newsecret \
59 "cn=md5, $BASEDN" >> $TESTOUT 2>&1
61 if test $RC != 0 ; then
62 echo "ldappasswd failed ($RC)!"
66 $LDAPPASSWD -h localhost -p $PORT \
67 -w secret -s newsecret \
68 "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
69 if test $RC != 0 ; then
70 echo "ldappasswd failed ($RC)!"
74 $LDAPPASSWD -h localhost -p $PORT \
75 -w secret -s newsecret \
76 "cn=sha, $BASEDN" >> $TESTOUT 2>&1
77 if test $RC != 0 ; then
78 echo "ldappasswd failed ($RC)!"
82 $LDAPPASSWD -h localhost -p $PORT \
83 -w secret -s newsecret \
84 "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
85 if test $RC != 0 ; then
86 echo "ldappasswd failed ($RC)!"
92 echo "Pass 2" >> $TESTOUT
93 echo "Using ldappasswd (PASS 2) ..."
94 $LDAPPASSWD -h localhost -p $PORT \
96 "cn=md5, $BASEDN" >> $TESTOUT 2>&1
97 if test $RC != 0 ; then
98 echo "ldappasswd failed ($RC)!"
102 $LDAPPASSWD -h localhost -p $PORT \
104 "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
105 if test $RC != 0 ; then
106 echo "ldappasswd failed ($RC)!"
110 $LDAPPASSWD -h localhost -p $PORT \
112 "cn=sha, $BASEDN" >> $TESTOUT 2>&1
113 if test $RC != 0 ; then
114 echo "ldappasswd failed ($RC)!"
118 $LDAPPASSWD -h localhost -p $PORT \
120 "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
121 if test $RC != 0 ; then
122 echo "ldappasswd failed ($RC)!"
129 echo ">>>>> Test succeeded"