]> git.sur5r.net Git - bacula/bacula/blob - regress/startover_libdbi.sh
Set tape options also vtape in one place
[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="postgresql postgresql-batchinsert postgresql-dbi postgresql-dbi-batchinsert \
8               mysql mysql-batchinsert mysql-dbi mysql-dbi-batchinsert"
9
10 for CT in $CATALOG_MODE ; do
11
12    CATALOG=`echo $CT | cut -d"-" -f1`
13    DISABLE_BATCH_INSERT=`echo $CT | grep batchinsert`
14    WITHOUT_DBI=`echo $CT | grep dbi`
15
16    if test "$DISABLE_BATCH_INSERT" = "" ; then
17       ENABLE_BATCH_INSERT="--disable-batch-insert"
18    else
19       ENABLE_BATCH_INSERT="--enable-batch-insert"
20    fi
21
22    if test "$WITHOUT_DBI" = "" ; then
23
24      _WHICHDB="WHICHDB=\"--disable-nls --with-${CATALOG} ${ENABLE_BATCH_INSERT}\""
25      _LIBDBI="#LIBDBI"
26    else 
27      if test "$CATALOG" = "mysql" ; then
28         DBPORT=3306
29      else
30         DBPORT=5432
31      fi
32
33      _WHICHDB="WHICHDB=\"--disable-nls --with-dbi --with-dbi-driver=${CATALOG} ${ENABLE_BATCH_INSERT} --with-db-port=${DBPORT}\""
34      _LIBDBI="LIBDBI=\"dbdriver = dbi:${CATALOG}; dbaddress = 127.0.0.1; dbport = ${DBPORT}\""
35
36    fi
37
38    _SITE_NAME="SITE_NAME=joaohf-bacula-${CT}"   
39    
40    # subustitute config values
41    cp -a ${PWD}/config ${PWD}/config.tmp
42
43    mkdir -p tmp
44
45    echo "/^SITE_NAME/c $_SITE_NAME" >> tmp/config_sed
46    echo "/^WHICHDB/c $_WHICHDB"  >> tmp/config_sed
47    echo "/^#LIBDBI/c $_LIBDBI" >> tmp/config_sed
48    echo "/^LIBDBI/c $_LIBDBI" >> tmp/config_sed
49
50    sed -f tmp/config_sed ${PWD}/config.tmp > ${PWD}/config
51    rm tmp/config_sed
52
53    make setup
54    ./experimental-disk
55    echo "  ==== Submiting ${_SITE_NAME} ====" >> test.out
56 done
57
58
59
60