3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Run tests using differents catalog databases
10 CATALOG_MODE="mysql-dbi mysql-dbi-batchinsert"
11 #"postgresql postgresql-batchinsert postgresql-dbi postgresql-dbi-batchinsert \
12 # mysql mysql-batchinsert mysql-dbi mysql-dbi-batchinsert"
14 for CT in $CATALOG_MODE ; do
16 CATALOG=`echo $CT | cut -d"-" -f1`
17 DISABLE_BATCH_INSERT=`echo $CT | grep batchinsert`
18 WITHOUT_DBI=`echo $CT | grep dbi`
20 if test "$DISABLE_BATCH_INSERT" = "" ; then
21 ENABLE_BATCH_INSERT="--disable-batch-insert"
23 ENABLE_BATCH_INSERT="--enable-batch-insert"
26 if test "$WITHOUT_DBI" = "" ; then
28 _WHICHDB="WHICHDB=\"--with-${CATALOG}\""
29 _OPENSSL="OPENSSL=\"--with-openssll --disable-nls ${ENABLE_BATCH_INSERT}\""
32 if test "$CATALOG" = "mysql" ; then
34 elif test "$CATALOG" = "postgresql" ; then
36 elif test "$CATALOG" = "sqlite" ; then
38 elif test "$CATALOG" = "sqlite3" ; then
42 _WHICHDB="WHICHDB=\"--with-dbi\""
43 _OPENSSL="OPENSSL=\"--with-openssl --disable-nls ${ENABLE_BATCH_INSERT} --with-dbi-driver=${CATALOG} --with-db-port=${DBPORT}\""
44 _LIBDBI="LIBDBI=\"dbdriver = dbi:${CATALOG}; dbaddress = 127.0.0.1; dbport = ${DBPORT}\""
47 _SITE_NAME="SITE_NAME=joaohf-bacula-${CT}"
49 # substitute config values
50 cp -a ${PWD}/config ${PWD}/config.tmp
54 echo "/^SITE_NAME/c $_SITE_NAME" >> tmp/config_sed
55 echo "/^WHICHDB/c $_WHICHDB" >> tmp/config_sed
56 echo "/^OPENSSL/c $_OPENSSL" >> tmp/config_sed
57 echo "/^#LIBDBI/c $_LIBDBI" >> tmp/config_sed
58 echo "/^LIBDBI/c $_LIBDBI" >> tmp/config_sed
60 sed -f tmp/config_sed ${PWD}/config.tmp > ${PWD}/config
64 echo " ==== Starting ${_SITE_NAME} ====" >> test.out
66 if test x"$1" = "xctest" ; then
71 echo " ==== Submiting ${_SITE_NAME} ====" >> test.out