From 4e625202d1d2383f4624a462f61117fa7991d781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 16 Jul 2013 00:53:56 +0200 Subject: [PATCH] Use EXECUTOR_NUMBER in database name and user name. --- autotest.sh | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/autotest.sh b/autotest.sh index 141b4333f9..31757e0e48 100755 --- a/autotest.sh +++ b/autotest.sh @@ -3,12 +3,17 @@ # ownCloud # # @author Thomas Müller -# @copyright 2012 Thomas Müller thomas.mueller@tmit.eu +# @copyright 2012, 2013 Thomas Müller thomas.mueller@tmit.eu # +#$EXECUTOR_NUMBER is set by Jenkins and allows us to run autotest in parallel +DATABASENAME=oc_autotest$EXECUTOR_NUMBER +ADMINLOGIN=admin$EXECUTOR_NUMBER DATADIR=data-autotest BASEDIR=$PWD +echo "Using database $DATABASENAME" + # create autoconfig for sqlite, mysql and postgresql cat > ./tests/autoconfig-sqlite.php < ./tests/autoconfig-sqlite.php < false, 'dbtype' => 'sqlite', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => $ADMINLOGIN, 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', ); @@ -28,13 +33,13 @@ cat > ./tests/autoconfig-mysql.php < false, 'dbtype' => 'mysql', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => $ADMINLOGIN, 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', - 'dbuser' => 'oc_autotest', - 'dbname' => 'oc_autotest', + 'dbuser' => 'oc_autotest', + 'dbname' => $DATABASENAME, 'dbhost' => 'localhost', - 'dbpass' => 'owncloud', + 'dbpass' => 'owncloud', ); DELIM @@ -44,13 +49,13 @@ cat > ./tests/autoconfig-pgsql.php < false, 'dbtype' => 'pgsql', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => $ADMINLOGIN, 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', - 'dbuser' => 'oc_autotest', - 'dbname' => 'oc_autotest', + 'dbuser' => 'oc_autotest', + 'dbname' => $DATABASENAME, 'dbhost' => 'localhost', - 'dbpass' => 'owncloud', + 'dbpass' => 'owncloud', ); DELIM @@ -60,10 +65,10 @@ cat > ./tests/autoconfig-oci.php < false, 'dbtype' => 'oci', 'dbtableprefix' => 'oc_', - 'adminlogin' => 'admin', + 'adminlogin' => $ADMINLOGIN, 'adminpass' => 'admin', 'directory' => '$BASEDIR/$DATADIR', - 'dbuser' => 'oc_autotest', + 'dbuser' => $DATABASENAME, 'dbname' => 'XE', 'dbhost' => 'localhost', 'dbpass' => 'owncloud', @@ -88,21 +93,21 @@ function execute_tests { # drop database if [ "$1" == "mysql" ] ; then - mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest" + mysql -u oc_autotest -powncloud -e "DROP DATABASE $DATABASENAME" fi if [ "$1" == "pgsql" ] ; then - dropdb -U oc_autotest oc_autotest + dropdb -U oc_autotest $DATABASENAME fi if [ "$1" == "oci" ] ; then echo "drop the database" sqlplus -s -l / as sysdba <