update
All checks were successful
CI / build (push) Successful in 17s

This commit is contained in:
2026-01-10 08:42:37 +00:00
parent e02b5b7046
commit 352562b1a5
2 changed files with 131 additions and 52 deletions

View File

@@ -2,6 +2,17 @@
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Parse arguments
AUTO_MODE=false
for arg in "$@"; do
case $arg in
--auto)
AUTO_MODE=true
shift
;;
esac
done
PROJECT_ROOT="$SCRIPT_DIR/.."
VM_DIR="$PROJECT_ROOT/.nogit/vm"
ISO_PATH="$PROJECT_ROOT/.nogit/iso/ecoos.iso"
@@ -192,15 +203,12 @@ echo ""
echo "=== Press Ctrl-C to stop ==="
echo ""
# Wait for eco-vdagent to be ready in the guest, then enable all 3 displays
echo "Waiting for eco-vdagent to be ready (10s)..."
sleep 10
# Enable all 3 displays via SPICE protocol
# Enable all 3 displays via SPICE protocol (waits for agent automatically)
# Using 300s timeout since ISO boot can take several minutes
if [ -f "$SCRIPT_DIR/enable-displays.py" ]; then
echo "Enabling all 3 displays via SPICE protocol..."
python3 "$SCRIPT_DIR/enable-displays.py" "spice://localhost:5930" 3 2>&1 || true
echo ""
echo "Enabling displays (waiting for SPICE agent, up to 5 minutes)..."
python3 "$SCRIPT_DIR/enable-displays.py" --timeout 300 2>&1 &
ENABLE_PID=$!
fi
echo "Tips:"
@@ -209,5 +217,39 @@ echo " - http://localhost:3006 - Management UI"
echo " - socat - UNIX-CONNECT:.nogit/vm/serial.sock - Serial console (login: ecouser/ecouser)"
echo ""
# Wait for either process to exit
wait $QEMU_PID 2>/dev/null || true
if [ "$AUTO_MODE" = true ]; then
echo "=== Auto mode: waiting for display setup ==="
# Wait for enable-displays.py to complete
if [ -n "$ENABLE_PID" ]; then
wait $ENABLE_PID
ENABLE_EXIT=$?
if [ $ENABLE_EXIT -ne 0 ]; then
echo "FAIL: Could not enable displays (exit code: $ENABLE_EXIT)"
exit 1
fi
fi
# Take screenshot
echo "Taking screenshot..."
"$SCRIPT_DIR/screenshot.sh"
# Verify screenshot dimensions (should be 5760x1080 for 3 displays)
SCREENSHOT="$PROJECT_ROOT/.nogit/screenshots/latest.png"
if [ -f "$SCREENSHOT" ]; then
WIDTH=$(identify -format "%w" "$SCREENSHOT" 2>/dev/null || echo "0")
if [ "$WIDTH" -ge 5760 ]; then
echo "SUCCESS: Multi-display test passed (width: ${WIDTH}px)"
exit 0
else
echo "FAIL: Screenshot width is ${WIDTH}px, expected >= 5760px"
exit 1
fi
else
echo "FAIL: Screenshot not found"
exit 1
fi
else
# Interactive mode - wait for QEMU to exit
wait $QEMU_PID 2>/dev/null || true
fi