Use sockets for startup notification in primary storage tests
This commit is contained in:
parent
078cc3b3f0
commit
4943a0326d
|
@ -28,6 +28,10 @@ docker pull ${docker_image}
|
||||||
# retrieve current folder to place the config in the parent folder
|
# retrieve current folder to place the config in the parent folder
|
||||||
thisFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
thisFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
# create readiness notification socket
|
||||||
|
notify_sock=$(readlink -f "$thisFolder"/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock)
|
||||||
|
mkfifo "$notify_sock"
|
||||||
|
|
||||||
port=5034
|
port=5034
|
||||||
|
|
||||||
user=test
|
user=test
|
||||||
|
@ -45,6 +49,7 @@ container=`docker run -d \
|
||||||
-e KEYSTONE_SERVICE=${service} \
|
-e KEYSTONE_SERVICE=${service} \
|
||||||
-e OSD_SIZE=300 \
|
-e OSD_SIZE=300 \
|
||||||
-v ${thisFolder}/entrypoint.sh:/entrypoint.sh \
|
-v ${thisFolder}/entrypoint.sh:/entrypoint.sh \
|
||||||
|
-v "$notify_sock":/run/notifyme.sock \
|
||||||
--privileged \
|
--privileged \
|
||||||
--entrypoint /entrypoint.sh ${docker_image}`
|
--entrypoint /entrypoint.sh ${docker_image}`
|
||||||
|
|
||||||
|
@ -57,20 +62,13 @@ echo "${docker_image} container: $container"
|
||||||
echo $container >> $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
echo $container >> $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
||||||
|
|
||||||
echo -n "Waiting for ceph initialization"
|
echo -n "Waiting for ceph initialization"
|
||||||
starttime=$(date +%s)
|
ready=$(timeout 600 cat "$notify_sock")
|
||||||
# support for GNU netcat and BSD netcat
|
if [[ $ready != 'READY=1' ]]; then
|
||||||
while ! (nc -c -w 1 ${host} 80 </dev/null >&/dev/null \
|
echo "[ERROR] Waited 600 seconds, no response" >&2
|
||||||
|| nc -w 1 ${host} 80 </dev/null >&/dev/null); do
|
docker logs $container
|
||||||
sleep 1
|
|
||||||
echo -n '.'
|
|
||||||
if (( $(date +%s) > starttime + 160 )); then
|
|
||||||
echo
|
|
||||||
echo "[ERROR] Waited 120 seconds, no response" >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
sleep 1
|
||||||
echo
|
|
||||||
sleep 20 # the keystone server also needs some time to fully initialize
|
|
||||||
|
|
||||||
cat > $thisFolder/swift.config.php <<DELIM
|
cat > $thisFolder/swift.config.php <<DELIM
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -38,3 +38,4 @@ fi;
|
||||||
# cleanup
|
# cleanup
|
||||||
rm -rf $thisFolder/swift.config.php
|
rm -rf $thisFolder/swift.config.php
|
||||||
rm -rf $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
rm -rf $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
|
||||||
|
rm -rf $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock
|
||||||
|
|
Loading…
Reference in New Issue