mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-11 02:58:49 +00:00
test: add haproxy smoke test
Assisted-by: GLM 5 via Claude Code Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
31
test/haproxy-simple/test.sh
Executable file
31
test/haproxy-simple/test.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user