Files
anubis-mirror/test/haproxy-simple/test.sh
Xe Iaso 89282230f5 test: add haproxy smoke test
Assisted-by: GLM 5 via Claude Code
Signed-off-by: Xe Iaso <me@xeiaso.net>
2026-02-15 16:25:46 +00:00

32 lines
748 B
Bash
Executable File

#!/usr/bin/env bash
source ../lib/lib.sh
export KO_DOCKER_REPO=ko.local
set -euo pipefail
# Step 1: Config validation
mint_cert haproxy-simple.test
# Combine cert and key for HAProxy SSL directory format
cat pki/haproxy-simple.test/cert.pem pki/haproxy-simple.test/key.pem >pki/haproxy-simple.test/haproxy.pem
docker run --rm \
-v $PWD/conf/haproxy:/usr/local/etc/haproxy:ro \
-v $PWD/pki:/etc/techaro/pki:ro \
haproxytech/haproxy-alpine:3.0 \
haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
# Step 2: Runtime testing
echo "Starting services..."
docker compose up -d
sleep 5
echo "Services are healthy. Starting runtime tests..."
export NODE_TLS_REJECT_UNAUTHORIZED=0
node test.mjs
# Cleanup happens automatically via trap in lib.sh