diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-12 20:56:47 -0500 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-12 20:56:47 -0500 |
| commit | e2b72ee160b87e6cdfb103b64f5e3a66a6185b5b (patch) | |
| tree | fc8cd7ca0b46ab3d8136905ed59b4d6b32403281 /tools/guest-diag/mission-gz.sh | |
| parent | cd1ceb3ff04aca628ec54b751945f318fc6d20b3 (diff) | |
| download | open-iov-e2b72ee160b87e6cdfb103b64f5e3a66a6185b5b.tar.gz open-iov-e2b72ee160b87e6cdfb103b64f5e3a66a6185b5b.zip | |
tools: mission-gz guest loop (X retry -> gl_frames probe -> GZDoom pbuffer capture); push/verify fixes
mission-gz.sh runs the end-to-end guest pass in one shot (X bring-up with
ScreenInit retries, GPU GL probe via gl_frames, GZDoom offscreen + gz_pbuf +
sdl_cap under the tested wrapper, /tmp/mission-done result flag).
push_gl_tools.sh runs vgpu_vm.py under sudo (QGA needs root);
gl_verify.sh uses 'pkill -x Xorg' (the -f pattern self-matches the shell
when the command line contains the Xorg invocation).
Diffstat (limited to 'tools/guest-diag/mission-gz.sh')
| -rw-r--r-- | tools/guest-diag/mission-gz.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tools/guest-diag/mission-gz.sh b/tools/guest-diag/mission-gz.sh new file mode 100644 index 0000000..717a3d4 --- /dev/null +++ b/tools/guest-diag/mission-gz.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2026 Open-IOV contributors +# mission-gz.sh - run INSIDE the guest: bring X up (retry), probe the GPU GL +# path (gl_frames), then run GZDoom offscreen with the GLX-pbuffer shim and the +# swap-capture shim. Everything logs to /tmp/mission-*.log; completion is +# signalled by /tmp/mission-done (content = result line). +# +# Env knobs: GZ_SECS (default 240) GLF_FRAMES (default 5) GLF_W/GLF_H +set -u +export DISPLAY=:0 + +echo "mission start $(date +%T)" +rm -f /tmp/mission-done /tmp/gzframes.bin +mkdir -p /tmp/gzshots + +# 1. X up (the DDX ScreenInit is a per-start lottery) +XOK=0 +for t in 1 2 3 4; do + pkill -x Xorg; sleep 1 + systemctl reset-failed xorg0 2>/dev/null + systemd-run --unit=xorg0 --collect --setenv=HOME=/root \ + /usr/bin/Xorg :0 -config /etc/X11/xorg.conf >/dev/null 2>&1 + sleep 7 + if timeout 12 xdpyinfo >/dev/null 2>&1; then XOK=$t; break; fi + echo "x try $t: dead" +done +echo "XOK try=$XOK $(date +%T)" +if [ "$XOK" = 0 ]; then echo "X-FAIL" > /tmp/mission-done; exit 1; fi +bash /tmp/guest_mode.sh 2>/dev/null || true + +# 2. GPU GL probe: direct pbuffer frames (non-black px0 = path live) +GLF_FRAMES="${GLF_FRAMES:-5}" +( + timeout 90 /tmp/gl_frames "$GLF_FRAMES" "${GLF_W:-320}" "${GLF_H:-240}" 5 \ + > /tmp/mission-gl.log 2>&1 + echo "glf rc=$? $(date +%T)" >> /tmp/mission-gl.log +) & +GLFPID=$! +sleep 20 +echo "x alive after glf start: $(pgrep -c Xorg)" +wait $GLFPID 2>/dev/null +grep -E "^FRAME seq" /tmp/mission-gl.log | tail -3 + +# 3. GZDoom offscreen + pbuffer shim + swap capture (tested recipe wrapper) +GZ_SECS="${GZ_SECS:-240}" +TIMEOUT="$GZ_SECS" GZLOG=/tmp/mission-gz.log GZCAP=/tmp/gzframes.bin \ + GZPBUF_W="${GZPBUF_W:-640}" GZPBUF_H="${GZPBUF_H:-480}" \ + bash /tmp/gzdoom_pbuf_run.sh +GZRC=$? +echo "gz rc=$GZRC $(date +%T)" >> /tmp/mission-gz.log +ls -la /tmp/gzframes.bin /tmp/gzshots 2>&1 | tail -5 +echo "XORG-ALIVE=$(pgrep -c Xorg)" | tee -a /tmp/mission-gz.log +echo "DONE x=$XOK gzrc=$GZRC $(date +%T)" > /tmp/mission-done +echo "mission end $(date +%T)" |
