From 2889c67adf7e0f88d6b8c704bea3c4a9e46ba61c Mon Sep 17 00:00:00 2001 From: Kurt Spanier Date: Mon, 22 Feb 1999 11:28:01 +0000 Subject: [PATCH] Client programs for test008-concurrency moved to subdir tests/progs. Building tests/progs/*.c in the main build process. ==> Test-suite must be called by 'make test', or 'make test-bdb2' --- Makefile.in | 4 ++-- configure | 6 ++++-- configure.in | 3 ++- tests/Makefile.in | 32 +++++-------------------------- tests/data/slapd-bdb2-master.conf | 2 +- tests/progs/Makefile.in | 31 ++++++++++++++++++++++++++++++ tests/{ => progs}/slapd-addel.c | 0 tests/{ => progs}/slapd-read.c | 0 tests/{ => progs}/slapd-search.c | 0 tests/{ => progs}/slapd-tester.c | 17 ++++++++++------ tests/scripts/defines.sh | 3 ++- tests/scripts/test008-concurrency | 2 +- 12 files changed, 59 insertions(+), 41 deletions(-) create mode 100644 tests/progs/Makefile.in rename tests/{ => progs}/slapd-addel.c (100%) rename tests/{ => progs}/slapd-read.c (100%) rename tests/{ => progs}/slapd-search.c (100%) rename tests/{ => progs}/slapd-tester.c (93%) diff --git a/Makefile.in b/Makefile.in index aaac8d6503..f832bd07e9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,8 +9,8 @@ ## in file LICENSE in the top-level directory of the distribution. ## -SUBDIRS= include libraries clients servers # contrib -CLEANDIRS= tests doc +SUBDIRS= include libraries clients servers tests # contrib +CLEANDIRS= doc # tests doc INSTALLDIRS= doc makefiles: FORCE diff --git a/configure b/configure index 573fb573d3..4361158c11 100755 --- a/configure +++ b/configure @@ -9830,7 +9830,8 @@ servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in: servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \ servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \ servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \ -tests/Makefile:build/top.mk:tests/Makefile.in \ +tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \ +tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \ include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index 5b49908715..95f79d2982 100644 --- a/configure.in +++ b/configure.in @@ -1691,7 +1691,8 @@ servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in: servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \ servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \ servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \ -tests/Makefile:build/top.mk:tests/Makefile.in \ +tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \ +tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \ ,[ date > stamp-h echo Please \"make depend\" to build dependencies diff --git a/tests/Makefile.in b/tests/Makefile.in index 7b4e633109..474ede5a79 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -2,34 +2,11 @@ ## COPYING RESTRICTIONS APPLY, see COPYRIGHT file ## ## tests Makefile.in for OpenLDAP -BUILD_BDB2 = @BUILD_BDB2@ - -SRC = slapd-tester.c slapd-search.c -PROGRAMS = slapd-tester slapd-search slapd-read slapd-addel - -LDAP_INCDIR= ../include -LDAP_LIBDIR= ../libraries - -XLIBS = -lldap_r -llber -llutil - -build-tools: FORCE - $(MAKE) $(MFLAGS) load-tools +SUBDIRS= progs -load-tools: $(PROGRAMS) - -slapd-tester: slapd-tester.o - $(LTLINK) -o $@ slapd-tester.o - -slapd-search: slapd-search.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND) - $(LTLINK) -o $@ slapd-search.o $(LIBS) - -slapd-read: slapd-read.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND) - $(LTLINK) -o $@ slapd-read.o $(LIBS) - -slapd-addel: slapd-addel.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND) - $(LTLINK) -o $@ slapd-addel.o $(LIBS) +BUILD_BDB2 = @BUILD_BDB2@ -bdb2-local: build-tools FORCE +test-bdb2: FORCE @if test "$(BUILD_BDB2)" = "yes" ; then \ $(LN_S) $(srcdir)/data . ; \ echo "Initiating LDAP tests..." ; \ @@ -39,7 +16,8 @@ bdb2-local: build-tools FORCE echo "run configure with --enable-bdb2" ; \ fi -all-local: build-tools FORCE +test: test-ldbm +test-ldbm: FORCE @-$(LN_S) $(srcdir)/data . @echo "Initiating LDAP tests..."; \ $(MKDIR) test-db test-repl ; \ diff --git a/tests/data/slapd-bdb2-master.conf b/tests/data/slapd-bdb2-master.conf index 2dad68bfc0..374f7881ec 100644 --- a/tests/data/slapd-bdb2-master.conf +++ b/tests/data/slapd-bdb2-master.conf @@ -13,7 +13,7 @@ argsfile ./test-db/slapd.args backend bdb2 home ./test-db -mpoolsize 2100000 +mpoolsize 21000000 database bdb2 cachesize 4 diff --git a/tests/progs/Makefile.in b/tests/progs/Makefile.in new file mode 100644 index 0000000000..6e5bcb19d6 --- /dev/null +++ b/tests/progs/Makefile.in @@ -0,0 +1,31 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file +## +## tests Makefile.in for OpenLDAP + +PROGRAMS = slapd-tester slapd-search slapd-read slapd-addel +SRCS = slapd-tester.c slapd-search.c slapd-read.c slapd-addel.c + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +XLIBS = -lldap -llber -llutil + +# build-tools: FORCE +# $(MAKE) $(MFLAGS) load-tools + +# load-tools: $(PROGRAMS) + +slapd-tester: slapd-tester.o + $(LTLINK) -o $@ slapd-tester.o + +slapd-search: slapd-search.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND) + $(LTLINK) -o $@ slapd-search.o $(LIBS) + +slapd-read: slapd-read.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND) + $(LTLINK) -o $@ slapd-read.o $(LIBS) + +slapd-addel: slapd-addel.o $(LDAP_LIBLBER_DEPEND) $(LDAP_LIBLDAP_DEPEND) + $(LTLINK) -o $@ slapd-addel.o $(LIBS) + + diff --git a/tests/slapd-addel.c b/tests/progs/slapd-addel.c similarity index 100% rename from tests/slapd-addel.c rename to tests/progs/slapd-addel.c diff --git a/tests/slapd-read.c b/tests/progs/slapd-read.c similarity index 100% rename from tests/slapd-read.c rename to tests/progs/slapd-read.c diff --git a/tests/slapd-search.c b/tests/progs/slapd-search.c similarity index 100% rename from tests/slapd-search.c rename to tests/progs/slapd-search.c diff --git a/tests/slapd-tester.c b/tests/progs/slapd-tester.c similarity index 93% rename from tests/slapd-tester.c rename to tests/progs/slapd-tester.c index 5bf9d4ed20..2d63a1d9ee 100644 --- a/tests/slapd-tester.c +++ b/tests/progs/slapd-tester.c @@ -37,7 +37,7 @@ static int nkids; static void usage( char *name ) { - fprintf( stderr, "usage: %s [-h ] -p -D -w -d -b [-j ] [-l ]\n", name ); + fprintf( stderr, "usage: %s [-h ] -p -D -w -d -b [-j ] [-l ] -P \n", name ); exit( 1 ); } @@ -51,6 +51,7 @@ main( int argc, char **argv ) char *passwd = NULL; char *dirname = NULL; char *sbase = NULL; + char *progdir = NULL; char *loops = LOOPS; DIR *datadir; struct dirent *file; @@ -72,7 +73,7 @@ main( int argc, char **argv ) int aanum; char acmd[MAXPATHLEN]; - while ( (i = getopt( argc, argv, "h:p:D:w:b:d:j:l:" )) != EOF ) { + while ( (i = getopt( argc, argv, "h:p:D:w:b:d:j:l:P:" )) != EOF ) { switch( i ) { case 'h': /* slapd host */ host = strdup( optarg ); @@ -98,6 +99,10 @@ main( int argc, char **argv ) dirname = strdup( optarg ); break; + case 'P': /* prog directory */ + progdir = strdup( optarg ); + break; + case 'j': /* the number of parallel clients */ maxkids = atoi( optarg ); break; @@ -113,7 +118,7 @@ main( int argc, char **argv ) } if (( dirname == NULL ) || ( sbase == NULL ) || ( port == NULL ) || - ( manager == NULL ) || ( passwd == NULL )) + ( manager == NULL ) || ( passwd == NULL ) || ( progdir == NULL )) usage( argv[0] ); /* get the file list */ @@ -156,7 +161,7 @@ main( int argc, char **argv ) */ sanum = 0; - sprintf( scmd, "%s", SEARCHCMD ); + sprintf( scmd, "%s%s%s", progdir, DEFAULT_DIRSEP, SEARCHCMD ); sargs[sanum++] = scmd; sargs[sanum++] = "-h"; sargs[sanum++] = host; @@ -175,7 +180,7 @@ main( int argc, char **argv ) */ ranum = 0; - sprintf( rcmd, "%s", READCMD ); + sprintf( rcmd, "%s%s%s", progdir, DEFAULT_DIRSEP, READCMD ); rargs[ranum++] = rcmd; rargs[ranum++] = "-h"; rargs[ranum++] = host; @@ -192,7 +197,7 @@ main( int argc, char **argv ) */ aanum = 0; - sprintf( acmd, "%s", ADDCMD ); + sprintf( acmd, "%s%s%s", progdir, DEFAULT_DIRSEP, ADDCMD ); aargs[aanum++] = acmd; aargs[aanum++] = "-h"; aargs[aanum++] = host; diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index a03422aab2..803405b3f1 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -10,6 +10,7 @@ else fi DATADIR=$SRCDIR/data +PROGDIR=$SRCDIR/progs if test "$BACKEND" = "bdb2" ; then LDIF2LDBM=../servers/slapd/tools/ldif2ldbm-bdb2 @@ -31,7 +32,7 @@ SLURPD=../servers/slurpd/slurpd LDAPSEARCH=../clients/tools/ldapsearch LDAPMODIFY=../clients/tools/ldapmodify LDAPADD=../clients/tools/ldapadd -SLAPDTESTER=./slapd-tester +SLAPDTESTER=$PROGDIR/slapd-tester LVL=5 PORT=9009 SLAVEPORT=9010 diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index 88355b20e1..df78da1a56 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -38,7 +38,7 @@ echo "Waiting 5 seconds for slapd to start..." sleep 5 echo "Using tester for concurrent server access..." -$SLAPDTESTER -b "$BASEDN" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50 +$SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50 RC=$? if [ $RC != 0 ]; then -- 2.39.5