|
|
@@ -9,7 +9,7 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
|
|
image="$1"
|
|
|
|
|
|
# Use a client image with curl for testing
|
|
|
-clientImage='buildpack-deps:stretch-curl'
|
|
|
+clientImage='buildpack-deps:buster-curl'
|
|
|
|
|
|
app1id="$(docker run -d "$image" rapidoid.port=80 id=app1 app.services=ping,status)"
|
|
|
app2id="$(docker run -d "$image" rapidoid.port=80 id=app2 app.services=ping,status)"
|
|
|
@@ -19,7 +19,7 @@ proxyid="$(docker run -d --link "$app1id":app1 --link "$app2id":app2 "$image" ra
|
|
|
trap "docker rm -vf $proxyid $app1id $app2id > /dev/null" EXIT
|
|
|
|
|
|
_request() {
|
|
|
- local cid="$1"
|
|
|
+ local cid="$1"
|
|
|
shift
|
|
|
|
|
|
local method="$1"
|
|
|
@@ -28,18 +28,20 @@ _request() {
|
|
|
local url="${1#/}"
|
|
|
shift
|
|
|
|
|
|
- docker run --rm --link "$cid":rapidoid "$clientImage" \
|
|
|
+ docker run --rm \
|
|
|
+ --link "$cid":rapidoid \
|
|
|
+ "$clientImage" \
|
|
|
curl -fs -X"$method" "$@" "http://rapidoid/$url"
|
|
|
}
|
|
|
|
|
|
# Make sure all Rapidoid servers are listening on port 80
|
|
|
for cid in $app1id $app2id $proxyid; do
|
|
|
- . "$dir/../../retry.sh" --tries 40 --sleep 0.25 '[ "$(_request '$cid' GET /rapidoid/ping --output /dev/null || echo $?)" != 7 ]'
|
|
|
+ . "$dir/../../retry.sh" --tries 40 --sleep 0.25 '[ "$(_request '$cid' GET /rapidoid/ping --output /dev/null || echo $?)" != 7 ]'
|
|
|
done
|
|
|
|
|
|
# Make sure that the round-robin load balancing works properly
|
|
|
for n in `seq 1 5`; do
|
|
|
- for i in 1 2; do
|
|
|
- [[ "$(_request $cid GET "/rapidoid/status")" == *"\"app$i\""* ]]
|
|
|
- done
|
|
|
+ for i in 1 2; do
|
|
|
+ [[ "$(_request $cid GET "/rapidoid/status")" == *"\"app$i\""* ]]
|
|
|
+ done
|
|
|
done
|