Home | History | Annotate | Line # | Download | only in scripts
sql-all revision 1.1.1.3
      1      1.1  lukem #! /bin/sh
      2  1.1.1.3   adam # OpenLDAP: pkg/ldap/tests/scripts/sql-all,v 1.5.2.5 2010/04/13 20:24:00 kurt Exp
      3      1.1  lukem ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
      4      1.1  lukem ##
      5  1.1.1.3   adam ## Copyright 1998-2010 The OpenLDAP Foundation.
      6      1.1  lukem ## All rights reserved.
      7      1.1  lukem ##
      8      1.1  lukem ## Redistribution and use in source and binary forms, with or without
      9      1.1  lukem ## modification, are permitted only as authorized by the OpenLDAP
     10      1.1  lukem ## Public License.
     11      1.1  lukem ##
     12      1.1  lukem ## A copy of this license is available in the file LICENSE in the
     13      1.1  lukem ## top-level directory of the distribution or, alternatively, at
     14      1.1  lukem ## <http://www.OpenLDAP.org/license.html>.
     15      1.1  lukem 
     16      1.1  lukem SHTOOL="$SRCDIR/../build/shtool"
     17      1.1  lukem 
     18      1.1  lukem TB="" TN=""
     19      1.1  lukem if test -t 1 ; then
     20      1.1  lukem 	TB=`$SHTOOL echo -e "%B" 2>/dev/null`
     21      1.1  lukem 	TN=`$SHTOOL echo -e "%b" 2>/dev/null`
     22      1.1  lukem fi
     23      1.1  lukem 
     24      1.1  lukem SLEEPTIME=10
     25      1.1  lukem 
     26      1.1  lukem echo "#######################################################################"
     27      1.1  lukem echo "###                                                                 ###"
     28      1.1  lukem echo "### SQL tests                                                       ###"
     29      1.1  lukem echo "###                                                                 ###"
     30      1.1  lukem echo "#######################################################################"
     31      1.1  lukem echo "###"
     32      1.1  lukem echo "### SQL tests require the sql backend, a properly configured"
     33      1.1  lukem echo "### ODBC and a database populated with data from the applicable"
     34      1.1  lukem echo "### servers/slapd/back-sql/rdbms_depend/* files."
     35      1.1  lukem echo "###"
     36      1.1  lukem echo "### Set SLAPD_USE_SQL to the desired RDBMS to enable this test;"
     37      1.1  lukem echo "###"
     38      1.1  lukem echo "### Currently supported RDBMSes are:"
     39      1.1  lukem echo "###         ibmdb2, mysql, pgsql"
     40      1.1  lukem echo "###"
     41      1.1  lukem echo "### Set SLAPD_USE_SQLWRITE=yes to enable the write tests"
     42      1.1  lukem echo "###"
     43      1.1  lukem echo "### See servers/slapd/back-sql/rdbms_depend/README for more "
     44      1.1  lukem echo "### details on how to set up the RDBMS and the ODBC"
     45      1.1  lukem echo "###"
     46      1.1  lukem 
     47      1.1  lukem echo ">>>>> Executing all LDAP tests for $BACKEND"
     48      1.1  lukem 
     49      1.1  lukem for CMD in $SRCDIR/scripts/sql-test*; do
     50      1.1  lukem 	# remove cruft from prior test
     51      1.1  lukem 	if test $PRESERVE = yes ; then
     52      1.1  lukem 		/bin/rm -rf testrun/db.*
     53      1.1  lukem 	else
     54      1.1  lukem 		/bin/rm -rf testrun
     55      1.1  lukem 	fi
     56      1.1  lukem 
     57      1.1  lukem 	echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
     58      1.1  lukem 	$CMD
     59      1.1  lukem 	RC=$?
     60      1.1  lukem 	if test $RC -eq 0 ; then
     61      1.1  lukem 		echo ">>>>> $CMD completed ${TB}OK${TN}."
     62      1.1  lukem 	else
     63      1.1  lukem 		echo ">>>>> $CMD ${TB}failed${TN} (exit $RC)"
     64      1.1  lukem 		exit $RC
     65      1.1  lukem 	fi
     66      1.1  lukem 
     67      1.1  lukem 	echo ">>>>> waiting $SLEEPTIME seconds for things to exit"
     68      1.1  lukem 	sleep $SLEEPTIME
     69      1.1  lukem 	echo ""
     70      1.1  lukem done
     71