Skip to content

Commit d83a70b

Browse files
committed
Tests: static: use a default port based on the image type
1 parent 0ba70ef commit d83a70b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.test/tests/static/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
88

99
image="$1"
1010

11+
port=80
12+
if echo "$image" | grep -q "unprivileged"; then port=8080; fi
13+
1114
clientImage='buildpack-deps:buster-curl'
1215
# ensure the clientImage is ready and available
1316
if ! docker image inspect "$clientImage" &> /dev/null; then
@@ -37,7 +40,7 @@ _request() {
3740
docker run --rm \
3841
--link "$cid":nginx \
3942
"$clientImage" \
40-
curl -fsSL -X"$method" --connect-to '::nginx:' "$@" "$proto://example.com/$url"
43+
curl -fsSL -X"$method" --connect-to "::nginx:$port" "$@" "$proto://example.com/$url"
4144
}
4245

4346
. "$HOME/oi/test/retry.sh" '[ "$(_request GET / --output /dev/null || echo $?)" != 7 ]'

0 commit comments

Comments
 (0)