12de962bdSlukem#! /bin/sh 2d11b170bStron# $OpenLDAP$ 32de962bdSlukem## This work is part of OpenLDAP Software <http://www.openldap.org/>. 42de962bdSlukem## 5*e670fd5cSchristos## Copyright 1998-2021 The OpenLDAP Foundation. 62de962bdSlukem## All rights reserved. 72de962bdSlukem## 82de962bdSlukem## Redistribution and use in source and binary forms, with or without 92de962bdSlukem## modification, are permitted only as authorized by the OpenLDAP 102de962bdSlukem## Public License. 112de962bdSlukem## 122de962bdSlukem## A copy of this license is available in the file LICENSE in the 132de962bdSlukem## top-level directory of the distribution or, alternatively, at 142de962bdSlukem## <http://www.OpenLDAP.org/license.html>. 152de962bdSlukem 162de962bdSlukemecho "running defines.sh" 172de962bdSlukem. $SRCDIR/scripts/defines.sh 182de962bdSlukem 192de962bdSlukemmkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR1C 202de962bdSlukem 212de962bdSlukemecho "Running slapadd to build glued slapd databases..." 22*e670fd5cSchristos. $CONFFILTER $BACKEND < $GLUECONF > $CONF1 232de962bdSlukem$SLAPADD -d $LVL -f $CONF1 -l $LDIFORDERED > $SLAPADDLOG1 2>&1 242de962bdSlukemRC=$? 252de962bdSlukemif test $RC != 0 ; then 262de962bdSlukem echo "slapadd failed ($RC)!" 272de962bdSlukem exit $RC 282de962bdSlukemfi 292de962bdSlukem 302de962bdSlukemecho "Starting slapd on TCP/IP port $PORT1..." 31*e670fd5cSchristos$SLAPD -f $CONF1 -h $URI1 -d $LVL > $LOG1 2>&1 & 322de962bdSlukemPID=$! 332de962bdSlukemif test $WAIT != 0 ; then 342de962bdSlukem echo PID $PID 352de962bdSlukem read foo 362de962bdSlukemfi 372de962bdSlukemKILLPIDS="$PID" 382de962bdSlukem 392de962bdSlukemsleep 1 402de962bdSlukem 412de962bdSlukemecho "Using ldapsearch to retrieve all the entries..." 422de962bdSlukemfor i in 0 1 2 3 4 5; do 43*e670fd5cSchristos $LDAPSEARCH -b "$BASEDN" -H $URI1 > $SEARCHOUT 2>&1 442de962bdSlukem RC=$? 452de962bdSlukem if test $RC = 0 ; then 462de962bdSlukem break 472de962bdSlukem fi 482de962bdSlukem echo "Waiting 5 seconds for slapd to start..." 492de962bdSlukem sleep 5 502de962bdSlukemdone 512de962bdSlukem 522de962bdSlukemif test $RC != 0 ; then 532de962bdSlukem echo "ldapsearch failed ($RC)!" 542de962bdSlukem test $KILLSERVERS != no && kill -HUP $KILLPIDS 552de962bdSlukem exit $RC 562de962bdSlukemfi 572de962bdSlukem 582de962bdSlukemecho "Filtering ldapsearch results..." 59ef2f90d3Sadam$LDIFFILTER -s ldif=e < $SEARCHOUT > $SEARCHFLT 602de962bdSlukemecho "Filtering original ldif used to create database..." 61ef2f90d3Sadam$LDIFFILTER -s ldif=e < $LDIFGLUED > $LDIFFLT 622de962bdSlukemecho "Comparing filter output..." 632de962bdSlukem$CMP $SEARCHFLT $LDIFFLT > $CMPOUT 642de962bdSlukem 652de962bdSlukemif test $? != 0 ; then 662de962bdSlukem echo "comparison failed - database was not created correctly" 672de962bdSlukem echo $SEARCHFLT $LDIFFLT 682de962bdSlukem $DIFF $SEARCHFLT $LDIFFLT 692de962bdSlukem test $KILLSERVERS != no && kill -HUP $KILLPIDS 702de962bdSlukem exit 1 712de962bdSlukemfi 722de962bdSlukem 73ef2f90d3Sadamif test $BACKEND != null ; then 742de962bdSlukemecho "Testing sizelimit..." 75*e670fd5cSchristos$LDAPSEARCH -b "$BASEDN" -H $URI1 -s one -z 2 > $SEARCHOUT 2>&1 762de962bdSlukemRC=$? 772de962bdSlukemif test $RC = 0 ; then 782de962bdSlukem echo "sizelimit not detected at end of search." 792de962bdSlukem test $KILLSERVERS != no && kill -HUP $KILLPIDS 802de962bdSlukem exit 1 812de962bdSlukemfi 822de962bdSlukem 83*e670fd5cSchristos$LDAPSEARCH -b "$BASEDN" -H $URI1 -z 9 objectclass=OpenLDAPPerson > $SEARCHOUT 2>&1 842de962bdSlukemRC=$? 852de962bdSlukemif test $RC = 0 ; then 862de962bdSlukem echo "sizelimit not detected at middle of search." 872de962bdSlukem test $KILLSERVERS != no && kill -HUP $KILLPIDS 882de962bdSlukem exit 1 892de962bdSlukemfi 90ef2f90d3Sadamfi 912de962bdSlukem 922de962bdSlukemtest $KILLSERVERS != no && kill -HUP $KILLPIDS 932de962bdSlukem 942de962bdSlukemecho ">>>>> Test succeeded" 952de962bdSlukem 962de962bdSlukemtest $KILLSERVERS != no && wait 972de962bdSlukem 982de962bdSlukemexit 0 99