#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

SCRIPTS=(
  "01_bootstrap.sh"
  "02_up.sh"
  "03_wait_ready.sh"
  "04_verify_dns_routing.sh"
  "05_agent_register.sh"
  "06_write_health_and_assert.sh"
  "07_logs_send_and_assert.sh"
  "08_restart_agent_reregister.sh"
  "09_down.sh"
)

for script in "${SCRIPTS[@]}"; do
  echo "[SYS-E2E] Running $script"
  "$SCRIPT_DIR/$script"
  echo "[SYS-E2E] $script completed"
  echo
done

echo "[SYS-E2E] All tests completed"

