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

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPTS=(
  "01_bootstrap.sh"
  "02_up.sh"
  "03_wait_and_assert_registration.sh"
  "04_write_health_files.sh"
  "08_verify_agent.sh"
  "05_assert_status_on_master.sh"
  "06_restart_agent_and_reregister.sh"
  "07_down.sh"
)

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

echo "[TEST] Agent module E2E tests completed"
