diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-03-20 13:02:33 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-03-20 13:02:33 +0100 |
commit | b0cd1b097573aef8bc3e988f0ba68a730919e9dd (patch) | |
tree | baae4e45416d8b6dd43c20e1974f8ccbd47a0094 | |
parent | a87cc90d1e7380a58bc4a60bd4cc1894ec41c33b (diff) | |
parent | d039e4fd254ef177cbe96245b76d823d4e1f6713 (diff) | |
download | nextcloud-server-b0cd1b097573aef8bc3e988f0ba68a730919e9dd.tar.gz nextcloud-server-b0cd1b097573aef8bc3e988f0ba68a730919e9dd.zip |
Merge pull request #14938 from owncloud/test-oracle-in-docker
Oracle 11 XE is now fired up in a docker image - looks like we get back ...
-rwxr-xr-x | autotest.sh | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/autotest.sh b/autotest.sh index 94d63173547..6c2a61da0a7 100755 --- a/autotest.sh +++ b/autotest.sh @@ -17,6 +17,7 @@ set -e #$EXECUTOR_NUMBER is set by Jenkins and allows us to run autotest in parallel DATABASENAME=oc_autotest$EXECUTOR_NUMBER DATABASEUSER=oc_autotest$EXECUTOR_NUMBER +DATABASEHOST=localhost ADMINLOGIN=admin$EXECUTOR_NUMBER BASEDIR=$PWD @@ -72,6 +73,11 @@ if [ -f config/config.php ] && [ ! -f config/config-autotest-backup.php ]; then fi function cleanup_config { + if [ ! -z "$DOCKER_CONTAINER_ID" ]; then + echo "Kill the docker $DOCKER_CONTAINER_ID" + docker rm -f $DOCKER_CONTAINER_ID + fi + cd "$BASEDIR" # Restore existing config if [ -f config/config-autotest-backup.php ]; then @@ -117,35 +123,20 @@ function execute_tests { dropdb -U $DATABASEUSER $DATABASENAME || true fi if [ "$1" == "oci" ] ; then - echo "drop the database" - sqlplus -s -l / as sysdba <<EOF - drop user $DATABASENAME cascade; -EOF - - echo "create the database" - sqlplus -s -l / as sysdba <<EOF - create user $DATABASENAME identified by owncloud; - alter user $DATABASENAME default tablespace users - temporary tablespace temp - quota unlimited on users; - grant create session - , create table - , create procedure - , create sequence - , create trigger - , create view - , create synonym - , alter session - to $DATABASENAME; - exit; -EOF - DATABASEUSER=$DATABASENAME + echo "Fire up the oracle docker" + DOCKER_CONTAINER_ID=`docker run -d deepdiver/docker-oracle-xe-11g` + DATABASEHOST=`docker inspect $DOCKER_CONTAINER_ID | grep IPAddress | cut -d '"' -f 4` + + echo "Waiting 60 seconds for Oracle initialization ... " + sleep 60 + + DATABASEUSER=autotest DATABASENAME='XE' fi # trigger installation echo "Installing ...." - ./occ maintenance:install --database=$1 --database-name=$DATABASENAME --database-host=localhost --database-user=$DATABASEUSER --database-pass=owncloud --database-table-prefix=oc_ --admin-user=$ADMINLOGIN --admin-pass=admin --data-dir=$DATADIR + ./occ maintenance:install --database=$1 --database-name=$DATABASENAME --database-host=$DATABASEHOST --database-user=$DATABASEUSER --database-pass=owncloud --database-table-prefix=oc_ --admin-user=$ADMINLOGIN --admin-pass=admin --data-dir=$DATADIR #test execution echo "Testing with $1 ..." |