Prepare verified laboratory 4 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:31:17 +03:00
parent ec540a1a72
commit 4fc1f40099
172 changed files with 15646 additions and 38 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
game_guard(){
local code
if game-running >/dev/null; then code=0; else code=$?; fi
if [ "$code" -ne 1 ]; then echo 'Game is active or its state is unknown; measurement stopped' >&2;exit 75;fi
}
game_guard
mkdir -p evidence/k3s
RUN=$(mktemp -d evidence/k3s/image-memory-XXXXXX)
printf '{"state":"started"}\n' >"$RUN/run.json"
sha256sum backend/internal/adapter/imagefile/image.go >"$RUN/source.sha256"
if [ "${VP_RUNTIME:-k3s}" = k3s ]; then
bun --no-env-file scripts/k3s.ts task image-memory >"$RUN/output.txt" 2>&1
else
./scripts/compose.sh run --rm --no-deps image-memory >"$RUN/output.txt" 2>&1
fi
game_guard
grep -F -- '--- PASS: TestWorstCaseImagesWithinBudget' "$RUN/output.txt"
grep -F 'peak_rss_kib=' "$RUN/output.txt"
printf '{"state":"complete"}\n' >"$RUN/run.json"
printf 'PASS image memory: %s\n' "$RUN"