Foundation / checks (deploy) (push) Successful in 2m51s
Foundation / checks (ecs) (push) Successful in 1m52s
Foundation / checks (client) (push) Successful in 12m46s
Foundation / checks (network) (push) Successful in 9m44s
Foundation / checks (tsan) (push) Successful in 7m51s
Foundation / checks (checks) (push) Successful in 31m29s
Foundation / checks (postgres) (push) Successful in 39m28s
Foundation / postgres-tools (push) Successful in 10s
Foundation / image (push) Successful in 2m17s
Foundation / server-image (push) Successful in 3m20s
40 lines
1.6 KiB
Bash
40 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
# Smoke test for the evo-server image (M7.8, ADR-0066). Runs the image with the
|
|
# same restrictions a cluster uses; no network, no credentials, read-only root.
|
|
set -euo pipefail
|
|
image="${1:?image reference}"
|
|
run() {
|
|
docker run --rm --network none --read-only --cap-drop ALL \
|
|
--security-opt no-new-privileges "$@"
|
|
}
|
|
# Without configuration the server refuses to start (usage, exit 2), and never
|
|
# falls back to any default region or database.
|
|
set +e
|
|
usage="$(run "$image" 2>&1)"
|
|
code=$?
|
|
set -e
|
|
if [[ "$code" -ne 2 ]] || ! grep -q '^usage: evo-server ' <<<"$usage"; then
|
|
printf 'evo-server smoke failed (exit %s):\n%s\n' "$code" "$usage" >&2
|
|
exit 1
|
|
fi
|
|
# The bundled operations tool refuses to run without a subcommand too (M8.3).
|
|
set +e
|
|
tool="$(run --entrypoint /usr/local/bin/evo-world-clone "$image" 2>&1)"
|
|
code=$?
|
|
set -e
|
|
if [[ "$code" -ne 2 ]] || ! grep -q '^usage: evo-world-clone ' <<<"$tool"; then
|
|
printf 'evo-world-clone smoke failed (exit %s):\n%s\n' "$code" "$tool" >&2
|
|
exit 1
|
|
fi
|
|
# Non-root, every shared library resolved, no credential material in the image.
|
|
run --entrypoint /bin/sh "$image" -c '
|
|
set -eu
|
|
test "$(id -u)" = 10001 && test "$(id -g)" = 10001
|
|
! ldd /usr/local/bin/evo-server | grep -q "not found"
|
|
! ldd /usr/local/bin/evo-world-clone | grep -q "not found"
|
|
test -z "$(find / -xdev \( -name "*pgpass*" -o -name "pg_service.conf" -o -name "*.pem" \
|
|
-o -name "*.key" \) -not -path "/etc/ssl/*" -not -path "/usr/lib/ssl/*" \
|
|
-not -path "/usr/share/*" -print 2>/dev/null)"
|
|
'
|
|
echo "server image smoke passed: $image"
|