#!/bin/sh set -eu export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp export DISPLAY=:71 XAUTHORITY=/tmp/vinix-x11.Xauthority server= finish() { status=$? if [ "$status" -ne 0 ]; then echo 'Vinix headless X11 guest check failed' if [ -f /tmp/xvfb.log ]; then cat /tmp/xvfb.log; fi fi if [ -n "$server" ]; then kill "$server" 2>/dev/null || true; fi /sbin/poweroff -f } trap finish EXIT mkdir -p /tmp # This fixed cookie belongs to an isolated guest display with TCP disabled. xauth -q -f "$XAUTHORITY" add "$DISPLAY" MIT-MAGIC-COOKIE-1 0123456789abcdef0123456789abcdef Xvfb "$DISPLAY" -auth "$XAUTHORITY" -nolisten tcp -noreset -screen 0 128x128x24 >/tmp/xvfb.log 2>&1 & server=$! attempt=0 until xset q >/tmp/xset.log 2>&1; do kill -0 "$server" attempt=$((attempt + 1)) [ "$attempt" -lt 20 ] sleep 1 done /x11-client --display printf 'Vinix.sidecar: tested\n' >/tmp/xresources xrdb -nocpp -load /tmp/xresources xrdb -query >/tmp/xresources-query grep -E '^Vinix\.sidecar:[[:space:]]*tested$' /tmp/xresources-query : >/tmp/empty.Xauthority if XAUTHORITY=/tmp/empty.Xauthority xset q >/tmp/unauthorized.log 2>&1; then echo 'Xvfb accepted an unauthenticated client' exit 1 fi echo 'Packaged Xvfb, Xauth, Xlib, xset and xrdb guest checks passed.' echo 'VPAC FIXTURE GUEST PASS'