Prepare verified laboratory 3 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:31:17 +03:00
parent 0ab3a341aa
commit 3d67e677d0
176 changed files with 21076 additions and 38 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
if [ "${VP_RUNTIME:-k3s}" = k3s ]; then exec bun --no-env-file scripts/k3s.ts stop-one; fi
: "${TARGET_INSTANCE_ID:?public resilience test must provide target instance}"
[[ "$TARGET_INSTANCE_ID" =~ ^[a-zA-Z0-9._-]+$ ]]
ids=(); while IFS= read -r id; do ids+=("$id"); done < <(./scripts/compose.sh ps -q api)
test "${#ids[@]}" -ge 2
for id in "${ids[@]}"; do
hostname=$(docker inspect --format '{{.Config.Hostname}}' "$id")
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
mkdir -p evidence
docker inspect --format '{{.Name}} {{.Id}} {{.State.Running}}' "$id" >evidence/stop-one-before.txt
docker stop --time 8 "$id" >/dev/null
docker inspect --format '{{.Name}} {{.Id}} {{.State.Running}}' "$id" >evidence/stop-one-after.txt
exit 0
fi
done
echo 'Target is not a running replica in this Compose project' >&2
exit 1