Commits

Kirill Simonov committed 1a61c4e

Added `make check-all` to test HTSQL on all supported platforms.

Comments (0)

Files changed (7)

test/buildbot/bb.sh

     local CMD="$2"
 
     vm_forward $VM :10022-:22
-    vm_ctl $VM "hostfwd_add tcp:127.0.0.1:10022-:22"
     case $BUILDBOT_DEBUG in
     true)
         ssh -F $CTL/ssh_config $VM_TYPE-vm "$CMD";;
 }
 
 
+check() {
+    local NAME="$1"
+    local TARGET="$2"
+
+    local VM="$NAME-vm"
+    local CMD="cd src/htsql; make -s $TARGET"
+
+    vm_forward $VM :10022-:22
+
+    ssh -F $CTL/ssh_config linux-vm "$CMD" >$TMP/check-output 2>&1
+
+    if [ $? -ne 0 ]; then
+        echo "************************************************************"
+        cat $TMP/check-output
+        echo "************************************************************"
+    fi
+    rm $TMP/check-output
+
+    vm_unforward $VM :10022-:22
+}
+
+
 usage() {
     echo "Usage:"
     echo "  $0 build [<bench>...]"
+    echo "  $0 check [<bench>...]"
     echo "  $0 start [<bench>...]"
     echo "  $0 stop [<bench>...]"
     echo "where <bench> is one of:"
 }
 
 
+do_check() {
+    local LIST="$1"
+
+    for CLIENT in py25 py26; do
+
+        if ! found $CLIENT "$LIST"; then
+            continue
+        fi
+
+        start_linux_bench $CLIENT :10022-:22 >/dev/null
+
+        echo " * Testing HTSQL/$CLIENT installation"
+        check $CLIENT update
+        check $CLIENT deps
+        check $CLIENT install
+        check $CLIENT test-routine
+
+        echo " * Testing HTSQL/$CLIENT on SQLite"
+        check $CLIENT test-sqlite
+
+        if found pgsql84 "$LIST"; then
+            echo " * Testing HTSQL/$CLIENT on Postgresql 8.4"
+            start_linux_bench pgsql84 :15432-:5432 >/dev/null
+            check $CLIENT "test-pgsql \
+                            PGSQL_HOST=10.0.2.2 \
+                            PGSQL_PORT=15432 \
+                            PGSQL_ADMIN_USERNAME=postgres \
+                            PGSQL_ADMIN_PASSWORD=admin"
+            stop_bench pgsql84 >/dev/null
+        fi
+
+        if found pgsql90 "$LIST"; then
+            echo " * Testing HTSQL/$CLIENT on PostgreSQL 9.0"
+            start_linux_bench pgsql90 :15432-:5432 >/dev/null
+            check $CLIENT "test-pgsql \
+                            PGSQL_HOST=10.0.2.2 \
+                            PGSQL_PORT=15432 \
+                            PGSQL_ADMIN_USERNAME=postgres \
+                            PGSQL_ADMIN_PASSWORD=admin"
+            stop_bench pgsql90 >/dev/null
+        fi
+
+        if found mysql51 "$LIST"; then
+            echo " * Testing HTSQL/$CLIENT on MySQL 5.1"
+            start_linux_bench mysql51 :13306-:3306 >/dev/null
+            check $CLIENT "test-mysql \
+                            MYSQL_HOST=10.0.2.2 \
+                            MYSQL_PORT=13306 \
+                            MYSQL_ADMIN_USERNAME=root \
+                            MYSQL_ADMIN_PASSWORD=admin"
+            stop_bench mysql51 >/dev/null
+        fi
+
+        if found oracle10g "$LIST"; then
+            echo " * Testing HTSQL/$CLIENT on Oracle 10g"
+            start_linux_bench oracle10g :11521-:1521 >/dev/null
+            check $CLIENT "test-oracle \
+                            ORACLE_SID=XE \
+                            ORACLE_HOST=10.0.2.2 \
+                            ORACLE_PORT=11521 \
+                            ORACLE_ADMIN_USERNAME=system \
+                            ORACLE_ADMIN_PASSWORD=admin"
+            stop_bench oracle10g >/dev/null
+        fi
+
+        if found mssql2005 "$LIST"; then
+            echo " * Testing HTSQL/$CLIENT on MS SQL Server 2005"
+            start_windows_bench mssql2005 :11433-:1433 >/dev/null
+            check $CLIENT "test-mssql \
+                            MSSQL_HOST=10.0.2.2 \
+                            MSSQL_PORT=11433 \
+                            MSSQL_ADMIN_USERNAME=sa \
+                            MSSQL_ADMIN_PASSWORD=admin"
+            stop_bench mssql2005 >/dev/null
+        fi
+
+        if found mssql2008 "$LIST"; then
+            echo " * Testing HTSQL/$CLIENT on MS SQL Server 2008"
+            start_windows_bench mssql2008 :11433-:1433 >/dev/null
+            check $CLIENT "test-mssql \
+                            MSSQL_HOST=10.0.2.2 \
+                            MSSQL_PORT=11433 \
+                            MSSQL_ADMIN_USERNAME=sa \
+                            MSSQL_ADMIN_PASSWORD=admin"
+            stop_bench mssql2008 >/dev/null
+        fi
+
+        stop_bench $CLIENT >/dev/null
+
+    done
+}
+
+
 do_start() {
     local LIST="$1"
 
         do_build "$ARGUMENTS"
         return;;
 
+    check)
+        do_check "$ARGUMENTS"
+        return;;
+
     start)
         do_start "$ARGUMENTS"
         return;;

test/buildbot/data/mysql51-update.sh

 
 # Post-installation script for the mysql51 VM.
 
+# Update the hostname.
+echo mysql51-vm >/etc/hostname
+
 # Preset the password for the MySQL root user.
 echo "mysql-server-5.1 mysql-server/root_password password admin" | debconf-set-selections
 echo "mysql-server-5.1 mysql-server/root_password_again password admin" | debconf-set-selections

test/buildbot/data/oracle10g-update.sh

 
 # Post-installation script for the oracle10g VM.
 
+# Update the hostname.
+echo oracle10g-vm >/etc/hostname
+
+# Register the Oracle repository.
 echo "deb http://oss.oracle.com/debian/ unstable main non-free" >/etc/apt/sources.list.d/oracle.list
 wget -q http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
 apt-get update

test/buildbot/data/pgsql84-update.sh

 
 # Post-installation script for the pgsql84 VM.
 
+# Update the hostname.
+echo pgsql84-vm >/etc/hostname
+
 # Install the PostgreSQL 8.4 server.
 apt-get -y install postgresql-8.4
 

test/buildbot/data/pgsql90-update.sh

 #/bin/sh
 
-# Post-installation script for the pgsql84 VM.
+# Post-installation script for the pgsql90 VM.
 
-# Install the PostgreSQL 8.4 server.
+# Update the hostname.
+echo pgsql90-vm >/etc/hostname
+
+# Install the PostgreSQL 9.0 server from backports.
 apt-get -y -t squeeze-backports install postgresql-9.0
 
 # Set the password of the user postgres to 'admin'.

test/buildbot/data/py25-update.sh

 #/bin/sh
 
+# Post-installation script for the py25 VM.
+
+# Update the hostname.
 echo py25-vm >/etc/hostname
 
+# Register the Oracle repository.
 echo "deb http://oss.oracle.com/debian/ unstable main non-free" >/etc/apt/sources.list.d/oracle.list
 wget -q http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
 apt-get update
 
+# Install Mercurial.
 apt-get -y install mercurial
 
+# Install Python 2.5 and required Python packages.
 apt-get -y install python2.5
 apt-get -y install python-setuptools
 apt-get -y install python-yaml
 apt-get -y install python-pip
 apt-get -y install python-virtualenv
 
+# Install development files for Python and database drivers.
 apt-get -y install python2.5-dev
-
-apt-get -y install libsqlite3-dev
 apt-get -y install libpq-dev
 apt-get -y install libmysqlclient-dev
 apt-get -y install freetds-dev
 apt-get -y install oracle-xe-client
 
+# Initialize Python virtual enviroment in `/root`.
 virtualenv -p python2.5 .
 
+# Download the source code of HTSQL.
 mkdir src
 hg -q clone https://bitbucket.org/prometheus/htsql src/htsql
 
+# Set the Oracle, FreeTDS and `virtualenv` environment variables on login.
 cat <<END >>/root/.bashrc
 
 export PATH=~/bin:\$PATH
 export PATH=\$PATH:\$ORACLE_HOME/bin
 export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$ORACLE_HOME/lib
 
+export TDSVER=8.0
+
 END
 
-#cat <<END >>/root/.bashrc
-#
-#. /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin/oracle_env.sh
-#END
-
-#. /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin/oracle_env.sh
-
-#python2.5 -mpip install pysqlite
-#python2.5 -mpip install psycopg2
-#python2.5 -mpip install mysql-python
-#python2.5 -mpip install pymssql -f http://pypi.python.org/pypi/pymssql/ --no-index
-#python2.5 -mpip install cx-oracle
-
-#python2.5 -c 'import pysqlite2, psycopg2, MySQLdb, pymssql, cx_Oracle'
-
-#apt-get -qq install python-pysqlite2 >/dev/null
-#apt-get -qq install python-psycopg2 >/dev/null
-#apt-get -qq install python-mysqldb >/dev/null
-
-

test/buildbot/data/py26-update.sh

 #/bin/sh
 
-echo py25-vm >/etc/hostname
+# Post-installation script for the py26 VM.
 
-apt-get -qq install mercurial >/dev/null
+# Update the hostname.
+echo py26-vm >/etc/hostname
 
-apt-get -qq install python2.5 >/dev/null
-apt-get -qq install python-setuptools >/dev/null
-apt-get -qq install python-yaml >/dev/null
-apt-get -qq install python-pysqlite2 >/dev/null
-apt-get -qq install python-psycopg2 >/dev/null
-apt-get -qq install python-mysqldb >/dev/null
+# Register the Oracle repository.
+echo "deb http://oss.oracle.com/debian/ unstable main non-free" >/etc/apt/sources.list.d/oracle.list
+wget -q http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
+apt-get update
 
-hg -q clone https://bitbucket.org/prometheus/htsql
+# Install Mercurial.
+apt-get -y install mercurial
 
+# Install Python 2.6 and required Python packages.
+apt-get -y install python2.6
+apt-get -y install python-setuptools
+apt-get -y install python-yaml
+apt-get -y install python-pip
+apt-get -y install python-virtualenv
+
+# Install development files for Python and database drivers.
+apt-get -y install python2.6-dev
+apt-get -y install libpq-dev
+apt-get -y install libmysqlclient-dev
+apt-get -y install freetds-dev
+apt-get -y install oracle-xe-client
+
+# Initialize Python virtual enviroment in `/root`.
+virtualenv -p python2.6 .
+
+# Download the source code of HTSQL.
+mkdir src
+hg -q clone https://bitbucket.org/prometheus/htsql src/htsql
+
+# Set the Oracle, FreeTDS and `virtualenv` environment variables on login.
+cat <<END >>/root/.bashrc
+
+export PATH=~/bin:\$PATH
+export LD_LIBRARY_PATH=~/lib
+
+export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
+export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
+export SQLPATH=\$ORACLE_HOME/sqlplus
+export PATH=\$PATH:\$ORACLE_HOME/bin
+export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$ORACLE_HOME/lib
+
+export TDSVER=8.0
+
+END
+