Commit b0cd1b09 authored by Morris Jobke's avatar Morris Jobke
Browse files

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 ...
parents a87cc90d d039e4fd
...@@ -17,6 +17,7 @@ set -e ...@@ -17,6 +17,7 @@ set -e
#$EXECUTOR_NUMBER is set by Jenkins and allows us to run autotest in parallel #$EXECUTOR_NUMBER is set by Jenkins and allows us to run autotest in parallel
DATABASENAME=oc_autotest$EXECUTOR_NUMBER DATABASENAME=oc_autotest$EXECUTOR_NUMBER
DATABASEUSER=oc_autotest$EXECUTOR_NUMBER DATABASEUSER=oc_autotest$EXECUTOR_NUMBER
DATABASEHOST=localhost
ADMINLOGIN=admin$EXECUTOR_NUMBER ADMINLOGIN=admin$EXECUTOR_NUMBER
BASEDIR=$PWD BASEDIR=$PWD
...@@ -72,6 +73,11 @@ if [ -f config/config.php ] && [ ! -f config/config-autotest-backup.php ]; then ...@@ -72,6 +73,11 @@ if [ -f config/config.php ] && [ ! -f config/config-autotest-backup.php ]; then
fi fi
function cleanup_config { 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" cd "$BASEDIR"
# Restore existing config # Restore existing config
if [ -f config/config-autotest-backup.php ]; then if [ -f config/config-autotest-backup.php ]; then
...@@ -117,35 +123,20 @@ function execute_tests { ...@@ -117,35 +123,20 @@ function execute_tests {
dropdb -U $DATABASEUSER $DATABASENAME || true dropdb -U $DATABASEUSER $DATABASENAME || true
fi fi
if [ "$1" == "oci" ] ; then if [ "$1" == "oci" ] ; then
echo "drop the database" echo "Fire up the oracle docker"
sqlplus -s -l / as sysdba <<EOF DOCKER_CONTAINER_ID=`docker run -d deepdiver/docker-oracle-xe-11g`
drop user $DATABASENAME cascade; DATABASEHOST=`docker inspect $DOCKER_CONTAINER_ID | grep IPAddress | cut -d '"' -f 4`
EOF
echo "Waiting 60 seconds for Oracle initialization ... "
echo "create the database" sleep 60
sqlplus -s -l / as sysdba <<EOF
create user $DATABASENAME identified by owncloud; DATABASEUSER=autotest
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
DATABASENAME='XE' DATABASENAME='XE'
fi fi
# trigger installation # trigger installation
echo "Installing ...." 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 #test execution
echo "Testing with $1 ..." echo "Testing with $1 ..."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment