feat: add self-enrolling Windows Agent package
This commit is contained in:
1 parent
b9b5e5e36f
commit
abf5654a25
20 files changed
+1834
-42
No files matched your search
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
PROJECT="minerops-agent-transport-isolation-test-$$"
|
||||
|
||||
compose=(
|
||||
docker compose
|
||||
--project-name "$PROJECT"
|
||||
--env-file .env.dev
|
||||
-f compose.dev.yaml
|
||||
)
|
||||
|
||||
cleanup() {
|
||||
"${compose[@]}" down \
|
||||
--volumes \
|
||||
--remove-orphans \
|
||||
>/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "=== START DISPOSABLE POSTGRES ==="
|
||||
"${compose[@]}" up --detach postgres
|
||||
|
||||
echo
|
||||
echo "=== WAIT FOR POSTGRES ==="
|
||||
|
||||
ready=0
|
||||
|
||||
for _ in $(seq 1 30); do
|
||||
if "${compose[@]}" exec -T postgres \
|
||||
sh -c 'pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"' \
|
||||
>/dev/null 2>&1
|
||||
then
|
||||
ready=1
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [ "$ready" -ne 1 ]; then
|
||||
echo "PostgreSQL did not become ready."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "=== BUILD BACKEND ==="
|
||||
"${compose[@]}" build backend
|
||||
|
||||
echo
|
||||
echo "=== MIGRATE DATABASE ==="
|
||||
"${compose[@]}" run --rm backend \
|
||||
alembic upgrade head
|
||||
|
||||
echo
|
||||
echo "=== RUNTIME AGENT ZONE ISOLATION ==="
|
||||
"${compose[@]}" run --rm \
|
||||
--volume "$PWD/backend/tests:/app/tests:ro" \
|
||||
--env MINEROPS_TRANSPORT_ISOLATION_DISPOSABLE=1 \
|
||||
backend \
|
||||
python -m unittest -v \
|
||||
tests.test_agent_transport_isolation_postgres
|
||||
|
||||
echo
|
||||
echo "Runtime Agent transport Zone-isolation tests passed."
|
||||
Reference in new issue
Block a user