Merge branch 'current/for_cpan_index' into current/dq
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 10_before_install.bash
index 1b57e6f..f861b0e 100755 (executable)
@@ -37,7 +37,7 @@ if [[ "$CLEANTEST" != "true" ]]; then
 
   run_or_err "Priming up the APT cache with $(echo $(ls -d $CACHE_DIR/apt_cache/*.deb))" "sudo cp $CACHE_DIR/apt_cache/*.deb /var/cache/apt/archives"
 
-  apt_install memcached firebird2.5-super firebird2.5-dev expect oracle-xe
+  apt_install memcached firebird2.5-super firebird2.5-dev unixodbc-dev expect oracle-xe
 
 ### config memcached
   run_or_err "Starting memcached" "sudo /etc/init.d/memcached start"
@@ -87,6 +87,25 @@ if [[ "$CLEANTEST" != "true" ]]; then
     if run_or_err "Creating Firebird TestDB" \
       "echo \"CREATE DATABASE '/var/lib/firebird/2.5/data/dbic_test.fdb';\" | sudo isql-fb -u sysdba -p 123"
     then
+
+      run_or_err "Fetching and building Firebird ODBC driver" '
+        cd "$(mktemp -d)"
+        wget -qO- http://sourceforge.net/projects/firebird/files/firebird-ODBC-driver/2.0.2-Release/OdbcFb-Source-2.0.2.153.gz/download | tar -zx
+        cd Builds/Gcc.lin
+        perl -p -i -e "s|/usr/lib64|/usr/lib/x86_64-linux-gnu|g" ../makefile.environ
+        make -f makefile.linux
+        sudo make -f makefile.linux install
+      '
+
+      sudo bash -c 'cat >> /etc/odbcinst.ini' <<< "
+[Firebird]
+Description     = InterBase/Firebird ODBC Driver
+Driver          = /usr/lib/x86_64-linux-gnu/libOdbcFb.so
+Setup           = /usr/lib/x86_64-linux-gnu/libOdbcFb.so
+Threading       = 1
+FileUsage       = 1
+"
+
       export DBICTEST_FIREBIRD_DSN=dbi:Firebird:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb
       export DBICTEST_FIREBIRD_USER=SYSDBA
       export DBICTEST_FIREBIRD_PASS=123
@@ -95,12 +114,22 @@ if [[ "$CLEANTEST" != "true" ]]; then
       export DBICTEST_FIREBIRD_INTERBASE_USER=SYSDBA
       export DBICTEST_FIREBIRD_INTERBASE_PASS=123
 
+      export DBICTEST_FIREBIRD_ODBC_DSN="dbi:ODBC:Driver=Firebird;Dbname=/var/lib/firebird/2.5/data/dbic_test.fdb"
+      export DBICTEST_FIREBIRD_ODBC_USER=SYSDBA
+      export DBICTEST_FIREBIRD_ODBC_PASS=123
+
       break
     fi
 
   done
 
 ### config oracle
+  SRV_ORA_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
+
+  # without this some of the more zealous tests can exhaust the amount
+  # of listeners and oracle is too slow to spin extras up :(
+  sudo bash -c "echo -e '\nprocesses=150' >> $SRV_ORA_HOME/config/scripts/init.ora"
+
   EXPECT_ORA_SCRIPT='
     spawn /etc/init.d/oracle-xe configure
 
@@ -140,12 +169,11 @@ if [[ "$CLEANTEST" != "true" ]]; then
   # FIXME: I couldn't figure it out after 3 hours of headdesking,
   # would be nice to know the reason eventually
   run_or_err "Configuring OracleXE" "sudo $(which expect) -c '$EXPECT_ORA_SCRIPT' &>/tmp/ora_configure_10.2.log"
-  SRV_ORA_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
 
   export DBICTEST_ORA_DSN=dbi:Oracle://localhost:1521/XE
   export DBICTEST_ORA_USER=dbic_test
   export DBICTEST_ORA_PASS=abc123456
-  export DBICTEST_ORA_EXTRAUSER_DSN=dbi:Oracle://localhost:1521/XE
+  export DBICTEST_ORA_EXTRAUSER_DSN="$DBICTEST_ORA_DSN"
   export DBICTEST_ORA_EXTRAUSER_USER=dbic_test_extra
   export DBICTEST_ORA_EXTRAUSER_PASS=abc123456