summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/guest-diag/gl_verify.sh2
-rw-r--r--tools/guest-diag/mission-gz.sh55
2 files changed, 56 insertions, 1 deletions
diff --git a/tools/guest-diag/gl_verify.sh b/tools/guest-diag/gl_verify.sh
index edfaab2..bb615e9 100644
--- a/tools/guest-diag/gl_verify.sh
+++ b/tools/guest-diag/gl_verify.sh
@@ -18,7 +18,7 @@ gx() { "${VMEXEC[@]}" exec --timeout "${1:-45}" "$2" 2>&1 | tail -n "${3:-40}";
if [ "$RESTART" = "1" ]; then
# The DDX ScreenInit is a per-start lottery ("GPU exception"): retry up to 3x.
for try in 1 2 3; do
- gx 30 "pkill -f '[X]org :0' 2>/dev/null; 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; echo XSTART-ISSUED" >/dev/null
+ gx 30 "pkill -x Xorg 2>/dev/null; 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; echo XSTART-ISSUED" >/dev/null
sleep 8
ok=$(gx 20 "timeout 12 env DISPLAY=:0 xdpyinfo >/dev/null 2>&1 && echo XDPYINFO-OK || echo X-DEAD" 3 | tail -1)
echo "try $try: $ok"
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)"