]> git.sur5r.net Git - bacula/bacula/blob - regress/startover_libdbi.sh
Add timer to run_multiple
[bacula/bacula] / regress / startover_libdbi.sh
1 #!/bin/sh
2
3 # Run tests using differents catalog databases
4
5 PWD=`pwd`
6
7 CATALOG_MODE="mysql-dbi mysql-dbi-batchinsert"
8 #"postgresql postgresql-batchinsert postgresql-dbi postgresql-dbi-batchinsert \
9 #              mysql mysql-batchinsert mysql-dbi mysql-dbi-batchinsert"
10
11 for CT in $CATALOG_MODE ; do
12
13    CATALOG=`echo $CT | cut -d"-" -f1`
14    DISABLE_BATCH_INSERT=`echo $CT | grep batchinsert`
15    WITHOUT_DBI=`echo $CT | grep dbi`
16
17    if test "$DISABLE_BATCH_INSERT" = "" ; then
18       ENABLE_BATCH_INSERT="--disable-batch-insert"
19    else
20       ENABLE_BATCH_INSERT="--enable-batch-insert"
21    fi
22
23    if test "$WITHOUT_DBI" = "" ; then
24
25      _WHICHDB="WHICHDB=\"--with-${CATALOG}\""
26      _OPENSSL="OPENSSL=\"--with-openssll --disable-nls ${ENABLE_BATCH_INSERT}\""
27      _LIBDBI="#LIBDBI"
28    else 
29       if test "$CATALOG" = "mysql" ; then
30          DBPORT=3306
31       elif test "$CATALOG" = "postgresql" ; then
32          DBPORT=5432
33       elif test "$CATALOG" = "sqlite" ; then
34          DBPORT=0
35       elif test "$CATALOG" = "sqlite3" ; then
36          DBPORT=0
37       fi
38
39       _WHICHDB="WHICHDB=\"--with-dbi\""
40       _OPENSSL="OPENSSL=\"--with-openssl --disable-nls ${ENABLE_BATCH_INSERT} --with-dbi-driver=${CATALOG} --with-db-port=${DBPORT}\""
41       _LIBDBI="LIBDBI=\"dbdriver = dbi:${CATALOG}; dbaddress = 127.0.0.1; dbport = ${DBPORT}\""
42    fi
43
44    _SITE_NAME="SITE_NAME=joaohf-bacula-${CT}"   
45    
46    # substitute config values
47    cp -a ${PWD}/config ${PWD}/config.tmp
48
49    mkdir -p tmp
50
51    echo "/^SITE_NAME/c $_SITE_NAME" >> tmp/config_sed
52    echo "/^WHICHDB/c $_WHICHDB"  >> tmp/config_sed
53    echo "/^OPENSSL/c $_OPENSSL" >> tmp/config_sed
54    echo "/^#LIBDBI/c $_LIBDBI" >> tmp/config_sed
55    echo "/^LIBDBI/c $_LIBDBI" >> tmp/config_sed
56
57    sed -f tmp/config_sed ${PWD}/config.tmp > ${PWD}/config
58    rm tmp/config_sed
59
60    make setup
61    echo " ==== Starting ${_SITE_NAME} ====" >> test.out
62    
63    if test x"$1" = "xctest" ; then
64       ./experimental-disk
65    else 
66       ./all-disk-tests
67    fi
68    echo " ==== Submiting ${_SITE_NAME} ====" >> test.out
69 done