]> git.sur5r.net Git - openldap/blob - tests/scripts/sql-all
rework SQL tests invocation; improve all tests
[openldap] / tests / scripts / sql-all
1 #! /bin/sh
2 # $OpenLDAP$
3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 ##
5 ## Copyright 1998-2004 The OpenLDAP Foundation.
6 ## All rights reserved.
7 ##
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
10 ## Public License.
11 ##
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>.
15
16 SHTOOL="$SRCDIR/../build/shtool"
17 TB=`$SHTOOL echo -e "%B"`
18 TN=`$SHTOOL echo -e "%b"`
19 SLEEPTIME=10
20
21 echo "### SQL tests require the sql backend, a properly configured"
22 echo "### ODBC and a database poulated with data from the applicable"
23 echo "### servers/slapd/back-sql/rdbms_depend/* files."
24 echo "### Set SLAPD_USE_SQL to the desired RDBMS to enable this test;"
25 echo "### Supported RDBMSes are: mysql,postgres"
26 echo "### Set SLAPD_USE_SQLWRITE=yes to enable the write tests"
27 echo "### See servers/slapd/back-sql/rdbms_depend/README for more "
28 echo "### details on how to set up the RDBMS and the ODBC"
29
30 echo ">>>>> Executing all LDAP tests for $BACKEND"
31
32 for CMD in $SRCDIR/scripts/sql-test*; do
33         # remove cruft from prior test
34         if test $PRESERVE = yes ; then
35                 /bin/rm -rf testrun/db.*
36         else
37                 /bin/rm -rf testrun
38         fi
39
40         echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
41         $CMD
42         RC=$?
43         if test $RC -eq 0 ; then
44                 echo ">>>>> $CMD completed ${TB}OK${TN}."
45         else
46                 echo ">>>>> $CMD ${TB}failed${TN} (exit $RC)"
47                 exit $RC
48         fi
49
50         echo ">>>>> waiting $SLEEPTIME seconds for things to exit"
51         sleep $SLEEPTIME
52         echo ""
53 done