forked from arti/vt1200
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.
42 lines
1.6 KiB
Bash
Executable File
42 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Run an isolated VT1200 fetch test: our own TFTP+BOOTP server and our own MAME,
|
|
# both inside netns vt1test on its private tap. Captures the wire.
|
|
#
|
|
# harness/mame/fontwork/run_test.sh [seconds] [extra MAME args...]
|
|
set -euo pipefail
|
|
NS=vt1test
|
|
ROOT=/home/arti/code/k-space/vt1200
|
|
WORK=$ROOT/harness/mame/fontwork
|
|
SECS="${1:-40}"; 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
|
|
|
|
sudo -n ip netns exec "$NS" timeout $((SECS+8)) tcpdump -i tap-mess-0-0 -n -s0 \
|
|
'udp port 69 or udp port 67 or udp port 68' -w "$WORK/run.pcap" 2>"$WORK/tcpdump.err" &
|
|
sleep 0.5
|
|
|
|
cd "$ROOT"
|
|
timeout $((SECS+10)) 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 \
|
|
-seconds_to_run "$SECS" "$@" >"$WORK/mame.log" 2>&1 || true
|
|
|
|
sleep 1
|
|
sudo -n ip netns exec "$NS" pkill -f 'harness/serve.py' 2>/dev/null || true
|
|
wait $SRV 2>/dev/null || true
|
|
echo "=== serve.log (tail) ==="
|
|
grep -vE 'screen_update|scanline|guard#' "$WORK/serve.log" | tail -40
|
|
echo "=== pcap summary ==="
|
|
sudo -n tcpdump -r "$WORK/run.pcap" -n 2>/dev/null | tail -40
|