Files
vt1200/harness/mame/fontwork/run_probe.sh
T
arti 3a51b95317 harness/fontwork: reproduction scripts for the TFTP Disk-full investigation
Isolated-netns test setup (a private tap-mess-0-0 so a second MAME can run
without holding the owner's tap), the one-file/one-index TFTP servers, the
trace/probe run wrappers, and the two server logs quoted in
FONT_STORAGE_REPORT.md.
2026-10-16 22:03:49 +03:00

37 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Probe run: same isolated netns test, but with the debugger and fontprobe.lua so
# the tftp_read capacity check reports live register values into debug.log.
set -euo pipefail
NS=vt1test
ROOT=/home/arti/code/k-space/vt1200
WORK=$ROOT/harness/mame/fontwork
SECS="${1:-20}"; shift || true
sudo -n ip netns exec "$NS" pkill -f 'harness/serve.py' 2>/dev/null || true
sudo -n ip netns exec "$NS" pkill -x vt1200 2>/dev/null || true
sleep 0.3
sudo -n ip netns exec "$NS" python3 -u "$ROOT/harness/serve.py" 192.168.99.1 --bootp \
>"$WORK/serve.log" 2>&1 &
SRV=$!
sleep 1.5
cd "$ROOT"
timeout $((SECS+15)) sudo -n ip netns exec "$NS" env -u DISPLAY \
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy \
XDG_RUNTIME_DIR="$WORK" VT1200_SKIP_LEVEL1=1 \
/home/arti/code/k-space/mame0289/vt1200 vt1200 \
-rompath "$ROOT/harness/mame/roms" -video none -sound none -nothrottle \
-skip_gameinfo -cfg_directory "$ROOT/harness/mame/cfg-net" \
-nvram_directory "$WORK/nvram" -networkprovider taptun \
-debug -debugger none -debuglog \
-autoboot_script "$ROOT/harness/mame/fontprobe.lua" -autoboot_delay 0 \
-seconds_to_run "$SECS" "$@" >"$WORK/mame_probe.log" 2>&1 || true
sudo -n ip netns exec "$NS" pkill -f 'harness/serve.py' 2>/dev/null || true
wait $SRV 2>/dev/null || true
echo "=== debug.log: tftp_read ==="
grep -E 'TFTP-READ-ENTRY|CHK |BUFSIZE-ERR|SEND-ERROR-3|GOT-ERROR-PKT' "$WORK/../debug.log" 2>/dev/null | head -60 || true
echo "=== serve.log ==="
grep -vE 'screen_update|scanline|guard#' "$WORK/serve.log" | tail -10