forked from mtusi2026/mtusi2026lab2
Bring the application, own tests, Dockerfile, toolchain, compose stack,
HAProxy, k6, RustFS and RabbitMQ configuration, migrations, hooks,
scenario scripts and the CI job from the lab 5 solution commit 64d5c67,
keep the lab 5 Makefile targets on top of the unchanged skeleton
targets, and append the lab 5 solution variables to the skeleton
.env.example. The package and the application follow the contract
version 1.6.0, and the image, the throwaway test containers and the
broker vhost description are tagged lab6 so they do not collide with a
lab 5 stand on the same host.
This is the starting point of the lab 6 cycle: lint, own tests and the
offline skeleton check pass before any lab 6 change.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
21 lines
872 B
Bash
Executable File
21 lines
872 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
out=${1:-evidence/detection}
|
|
mkdir -p "$out"
|
|
scripts/restore.sh
|
|
replica() { docker compose ps -q "${API_SERVICE:-api}" | head -1; }
|
|
detect() { python3 scripts/probe.py detect "$@"; }
|
|
failed=0
|
|
detect --max 1.5 --within-action --restore scripts/restore.sh --out "$out/sigterm.json" \
|
|
-- docker stop -t "${STOP_TIMEOUT:-6}" "$(replica)" || failed=1
|
|
detect --max 1.5 --restore scripts/restore.sh --out "$out/kill.json" \
|
|
-- docker kill "$(replica)" || failed=1
|
|
hung=$(replica)
|
|
detect --max 3.5 --restore "docker unpause $hung && scripts/lb-wait.sh" --out "$out/pause.json" \
|
|
-- docker pause "$hung" || failed=1
|
|
db=$(docker compose ps -q postgres)
|
|
detect --max 1.5 --until 0 --lb-status 503 --restore "docker start $db && scripts/lb-wait.sh" \
|
|
--out "$out/postgres.json" -- docker stop "$db" || failed=1
|
|
exit "$failed"
|