summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-05-09 09:43:04 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-05-09 09:43:04 +0200
commit5ff2d59cd47c279f02d882cad8bb31258e64ce2f (patch)
tree1a994aee690342f3334404425218d35ffad2a57f
parent0f873184623e53304fe36e0bc96b4635d5d20c55 (diff)
parent59c4ea2c8da7a04b94a866c51375f874f1447a78 (diff)
downloadnextcloud-server-5ff2d59cd47c279f02d882cad8bb31258e64ce2f.tar.gz
nextcloud-server-5ff2d59cd47c279f02d882cad8bb31258e64ce2f.zip
Merge pull request #24473 from owncloud/fix-oracle-ci
Wait a while even after successful conect ...
-rwxr-xr-xautotest.sh30
1 files changed, 28 insertions, 2 deletions
diff --git a/autotest.sh b/autotest.sh
index 33c4ad50de8..bd51cddefcf 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -180,7 +180,33 @@ function execute_tests {
# drop database
if [ "$DB" == "mysql" ] ; then
- mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
+ if [ ! -z "$USEDOCKER" ] ; then
+ echo "Fire up the mysql docker"
+ DOCKER_CONTAINER_ID=$(docker run \
+ -v $BASEDIR/tests/docker/mariadb:/etc/mysql/conf.d \
+ -e MYSQL_ROOT_PASSWORD=owncloud \
+ -e MYSQL_USER="$DATABASEUSER" \
+ -e MYSQL_PASSWORD=owncloud \
+ -e MYSQL_DATABASE="$DATABASENAME" \
+ -d mysql)
+ DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
+
+ echo "Waiting for MySQL initialisation ..."
+ if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 3306 60; then
+ echo "[ERROR] Waited 60 seconds, no response" >&2
+ exit 1
+ fi
+
+ echo "MySQL is up."
+
+ else
+ if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
+ echo "Your mysql binary is not provided by mysql"
+ echo "To use the docker container set the USEDOCKER environment variable"
+ exit -1
+ fi
+ mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
+ fi
fi
if [ "$DB" == "mariadb" ] ; then
if [ ! -z "$USEDOCKER" ] ; then
@@ -240,7 +266,7 @@ function execute_tests {
# Try to connect to the OCI host via sqlplus to ensure that the connection is already running
for i in {1..48}
do
- if sqlplus "system/oracle@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=$DATABASEHOST)(Port=1521))(CONNECT_DATA=(SID=XE)))" < /dev/null | grep 'Connected to'; then
+ if sqlplus "autotest/owncloud@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=$DATABASEHOST)(Port=1521))(CONNECT_DATA=(SID=XE)))" < /dev/null | grep 'Connected to'; then
break;
fi
sleep 5