Files
tri-bootstrap-server/tests/run_all.sh
T
Krystie 87bb9fafae Add test suite for bootstrap server
- test_setup.sh: validates installation, package deps, directory creation
- test_tor_config.sh: validates Tor hidden service configuration
- test_caddy_config.sh: validates Caddy web server configuration
- test_generate_bootstrap.sh: validates bootstrap archive generation
- run_all.sh: runs all tests with summary

All tests pass (47 total assertions across 4 test suites).
2026-04-28 04:49:42 -07:00

42 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Run all bootstrap server tests
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR/.."
PASS=0
FAIL=0
run_test() {
local name="$1"; shift
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " $name"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if bash "$@" 2>&1; then
echo "$name PASSED"
else
echo "$name FAILED"
((FAIL++)) || true
fi
}
echo "Running all Bootstrap Server tests..."
run_test "setup.sh" tests/test_setup.sh
run_test "Tor config" tests/test_tor_config.sh
run_test "Caddy config" tests/test_caddy_config.sh
run_test "Generate bootstrap" tests/test_generate_bootstrap.sh
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " Summary"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if [ "$FAIL" -eq 0 ]; then
echo " ✓ All tests passed!"
exit 0
else
echo "$FAIL test suite(s) failed"
exit 1
fi