Skip to content

Commit 1a92142

Browse files
authored
Merge pull request #14528 from nextcloud/bugfix/noid/fix-database-configuration
Fix database configuration
2 parents 679afa2 + c32c91d commit 1a92142

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

autotest.sh

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,21 @@ function execute_tests {
204204

205205
else
206206
if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
207-
if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
208-
echo "Your mysql binary is not provided by mysql"
209-
echo "To use the docker container set the USEDOCKER environment variable"
210-
exit -1
211-
fi
212-
mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
213-
else
214-
DATABASEHOST=mysql
215-
fi
207+
if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
208+
echo "Your mysql binary is not provided by mysql"
209+
echo "To use the docker container set the USEDOCKER environment variable"
210+
exit -1
211+
fi
212+
mysql -u "$DATABASEUSER" -powncloud -e "DROP DATABASE IF EXISTS $DATABASENAME" -h $DATABASEHOST || true
213+
else
214+
DATABASEHOST=mysql
215+
fi
216+
fi
217+
echo "Waiting for MySQL initialisation ..."
218+
if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 3306 600; then
219+
echo "[ERROR] Waited 600 seconds, no response" >&2
220+
exit 1
216221
fi
217-
echo "Waiting for MySQL initialisation ..."
218-
if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 3306 600; then
219-
echo "[ERROR] Waited 600 seconds, no response" >&2
220-
exit 1
221-
fi
222222
fi
223223
if [ "$DB" == "mysqlmb4" ] ; then
224224
if [ ! -z "$USEDOCKER" ] ; then
@@ -229,9 +229,9 @@ function execute_tests {
229229
-e MYSQL_USER="$DATABASEUSER" \
230230
-e MYSQL_PASSWORD=owncloud \
231231
-e MYSQL_DATABASE="$DATABASENAME" \
232-
-d mysql:5.7
233-
--innodb_large_prefix=true
234-
--innodb_file_format=barracuda
232+
-d mysql:5.7 \
233+
--innodb_large_prefix=true \
234+
--innodb_file_format=barracuda \
235235
--innodb_file_per_table=true)
236236

237237
DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
@@ -331,13 +331,13 @@ function execute_tests {
331331
echo "Waiting for Oracle initialization ... "
332332

333333
# Try to connect to the OCI host via sqlplus to ensure that the connection is already running
334-
for i in {1..48}
335-
do
336-
if sqlplus "autotest/owncloud@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=$DATABASEHOST)(Port=1521))(CONNECT_DATA=(SID=XE)))" < /dev/null | grep 'Connected to'; then
337-
break;
338-
fi
339-
sleep 5
340-
done
334+
for i in {1..48}
335+
do
336+
if sqlplus "autotest/owncloud@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=$DATABASEHOST)(Port=1521))(CONNECT_DATA=(SID=XE)))" < /dev/null | grep 'Connected to'; then
337+
break;
338+
fi
339+
sleep 5
340+
done
341341

342342
DATABASEUSER=autotest
343343
DATABASENAME='XE'
@@ -432,7 +432,8 @@ fi
432432
# NOTES on pgsql:
433433
# - su - postgres
434434
# - createuser -P oc_autotest (enter password and enable superuser)
435-
# - to enable dropdb I decided to add following line to pg_hba.conf (this is not the safest way but I don't care for the testing machine):
435+
# - to enable dropdb I decided to add following line to pg_hba.conf
436+
# (this is not the safest way but I don't care for the testing machine):
436437
# local all all trust
437438
#
438439
# - for parallel executor support with EXECUTOR_NUMBER=0:

0 commit comments

Comments
 (0)