summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2016-02-29 21:13:27 +0000
committerRobin McCorkell <rmccorkell@owncloud.com>2016-02-29 21:20:11 +0000
commit078cc3b3f0ac34919b4b30cfa08799ce7743bc87 (patch)
tree7fffea36f34c57d95fadd0d6fef870d706f8bba6 /apps/files_external/tests
parent52d217d77519ed95a18237b09a351f83a0ae7f47 (diff)
downloadnextcloud-server-078cc3b3f0ac34919b4b30cfa08799ce7743bc87.tar.gz
nextcloud-server-078cc3b3f0ac34919b4b30cfa08799ce7743bc87.zip
Use readiness notification socket to be absolutely sure this works
Diffstat (limited to 'apps/files_external/tests')
-rwxr-xr-xapps/files_external/tests/env/start-amazons3-ceph.sh8
-rwxr-xr-xapps/files_external/tests/env/start-swift-ceph.sh8
-rwxr-xr-xapps/files_external/tests/env/stop-amazons3-ceph.sh1
-rwxr-xr-xapps/files_external/tests/env/stop-swift-ceph.sh1
4 files changed, 16 insertions, 2 deletions
diff --git a/apps/files_external/tests/env/start-amazons3-ceph.sh b/apps/files_external/tests/env/start-amazons3-ceph.sh
index 20fa7e7bb2b..d36980fdd11 100755
--- a/apps/files_external/tests/env/start-amazons3-ceph.sh
+++ b/apps/files_external/tests/env/start-amazons3-ceph.sh
@@ -31,6 +31,10 @@ if [ -z "$thisFolder" ]; then
thisFolder="."
fi;
+# create readiness notification socket
+notify_sock=$(readlink -f "$thisFolder"/dockerContainerCeph.$EXECUTOR_NUMBER.amazons3.sock)
+mkfifo "$notify_sock"
+
user=test
accesskey=aaabbbccc
secretkey=cccbbbaaa
@@ -39,6 +43,7 @@ port=80
container=`docker run -d \
-e RGW_CIVETWEB_PORT=$port \
+ -v "$notify_sock":/run/notifyme.sock \
${docker_image}`
host=`docker inspect --format="{{.NetworkSettings.IPAddress}}" $container`
@@ -50,7 +55,8 @@ echo "${docker_image} container: $container"
echo $container >> $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.amazons3
echo -n "Waiting for ceph initialization"
-if ! "$thisFolder"/env/wait-for-connection ${host} ${port} 60; then
+ready=$(timeout 60 cat "$notify_sock")
+if [[ $ready != 'READY=1' ]]; then
echo "[ERROR] Waited 60 seconds, no response" >&2
exit 1
fi
diff --git a/apps/files_external/tests/env/start-swift-ceph.sh b/apps/files_external/tests/env/start-swift-ceph.sh
index 123f6b6871e..357512ae4d6 100755
--- a/apps/files_external/tests/env/start-swift-ceph.sh
+++ b/apps/files_external/tests/env/start-swift-ceph.sh
@@ -31,6 +31,10 @@ if [ -z "$thisFolder" ]; then
thisFolder="."
fi;
+# create readiness notification socket
+notify_sock=$(readlink -f "$thisFolder"/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock)
+mkfifo "$notify_sock"
+
port=5001
user=test
@@ -48,6 +52,7 @@ container=`docker run -d \
-e KEYSTONE_SERVICE=${service} \
-e OSD_SIZE=300 \
--privileged \
+ -v "$notify_sock":/run/notifyme.sock \
${docker_image}`
host=`docker inspect --format="{{.NetworkSettings.IPAddress}}" $container`
@@ -59,7 +64,8 @@ echo "${docker_image} container: $container"
echo $container >> $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
echo -n "Waiting for ceph initialization"
-if ! "$thisFolder"/env/wait-for-connection ${host} 80 600; then
+ready=$(timeout 600 cat "$notify_sock")
+if [[ $ready != 'READY=1' ]]; then
echo "[ERROR] Waited 600 seconds, no response" >&2
docker logs $container
exit 1
diff --git a/apps/files_external/tests/env/stop-amazons3-ceph.sh b/apps/files_external/tests/env/stop-amazons3-ceph.sh
index 3f56a6f1e5d..dcf30d8c515 100755
--- a/apps/files_external/tests/env/stop-amazons3-ceph.sh
+++ b/apps/files_external/tests/env/stop-amazons3-ceph.sh
@@ -33,4 +33,5 @@ done;
# cleanup
rm $thisFolder/config.amazons3.php
rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.amazons3
+rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.amazons3.sock
diff --git a/apps/files_external/tests/env/stop-swift-ceph.sh b/apps/files_external/tests/env/stop-swift-ceph.sh
index b1cbe94b482..9f15fb05a7d 100755
--- a/apps/files_external/tests/env/stop-swift-ceph.sh
+++ b/apps/files_external/tests/env/stop-swift-ceph.sh
@@ -35,4 +35,5 @@ done;
# cleanup
rm $thisFolder/config.swift.php
rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
+rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock