|
1 | 1 | #!/usr/bin/env bash |
2 | | -# XU7 ACCEPTANCE: the full Xubuntu session -- xfwm4 (WM) + xfce4-panel + xfdesktop (wallpaper) + Thunar, |
3 | | -# all wasm, under one X server. Tests the 4-heavy-guest "ceiling" WITH PATIENCE (construction is slow due |
4 | | -# to the perf root, NOT deadlocked -- per the Thunar/notifyd findings). Constraint #5: all unmodified. |
| 2 | +# XU7 integrated session: xfwm4 (WM, Greybird) + xfce4-panel (clock/tasklist/systray/separator) + a |
| 3 | +# decorated GTK app window, all wasm. Proves the panel runs UNDER the WM and the tasklist shows a real |
| 4 | +# window button for the managed app. (applicationsmenu is excluded here -- its populated menu deadlocks, |
| 5 | +# tracked separately.) Stack: dbus + xfconfd (serves the xfwm4 + xfce4-panel channels) + xfwm4 + |
| 6 | +# xfce4-panel + gtk-hello. |
5 | 7 | set -uo pipefail |
6 | 8 | cd "$(dirname "$0")/.." |
7 | 9 | EXP="$(pwd)"; REPO="$(cd ../.. && pwd)" |
8 | | -HOST="$REPO/target/debug/wasm-gui-host"; SIDECAR="${SIDECAR:-$REPO/target/debug/secure-exec-sidecar}" |
9 | | -for f in "$HOST" "$SIDECAR" "$EXP/Xvfb.wasm" "$EXP/dbus-daemon.wasm" "$EXP/xfconfd.wasm" "$EXP/xfwm4.wasm" "$EXP/xfce4-panel.wasm" "$EXP/xfdesktop.wasm" "$EXP/thunar.wasm"; do |
| 10 | +HOST="$REPO/target/debug/wasm-gui-host"; SIDECAR="$REPO/target/debug/secure-exec-sidecar" |
| 11 | +for f in "$HOST" "$SIDECAR" "$EXP/Xvfb.wasm" "$EXP/dbus-daemon.wasm" "$EXP/xfconfd.wasm" "$EXP/xfwm4.wasm" "$EXP/xfce4-panel.wasm" "$EXP/mousepad.wasm"; do |
10 | 12 | [ -f "$f" ] || { echo "MISSING: $f"; exit 1; } |
11 | 13 | done |
| 14 | + |
12 | 15 | FONTS="${VMFONTS:-/tmp/vmfonts}"; LOCALE="${VMLOCALE:-/tmp/vmlocale}" |
13 | | -XFT="${VMXFT:-/tmp/vmxft}"; THEMES="${VMTHEMES:-/tmp/vmthemes}"; WMDATA="${VMXFWM4:-/tmp/vmxfwm4}"; ICONS="${VMICONS:-/tmp/vmicons}" |
| 16 | +XFT="${VMXFT:-/tmp/vmxft}"; THEMES="${VMTHEMES:-/tmp/vmthemes}"; WMDATA="${VMXFWM4:-/tmp/vmxfwm4}" |
14 | 17 | [ -d "$FONTS" ] || bash "$EXP/scripts/prepare-fonts.sh" >/dev/null 2>&1 || true |
15 | 18 | [ -d "$LOCALE" ] || bash "$EXP/scripts/prepare-locale.sh" "$LOCALE" >/dev/null 2>&1 || true |
16 | 19 | [ -d "$XFT" ] || bash "$EXP/scripts/prepare-xftfonts.sh" "$XFT" >/dev/null 2>&1 || true |
17 | | -[ -d "$ICONS" ] || bash "$EXP/scripts/prepare-icons.sh" "$ICONS" >/dev/null 2>&1 || true |
18 | 20 | bash "$EXP/scripts/prepare-themes.sh" "$THEMES" >/dev/null 2>&1 || true |
19 | 21 | bash "$EXP/scripts/prepare-xfwm4.sh" "$WMDATA" >/dev/null 2>&1 || true |
20 | | -[ -d /tmp/vmschemas ] || bash "$EXP/scripts/stage-gschemas.sh" >/dev/null 2>&1 || true |
21 | | -SESS=/tmp/vmxu7sess |
| 22 | + |
| 23 | +# Use SEPARATE vm-trees (each prepare script rm -rf's its own tree); the host MERGES all --vm-tree into |
| 24 | +# the VM root, so the panel channel (panel tree) and the xfwm4 channel (dbus tree) land in the same |
| 25 | +# xfconf dir without clobbering each other. |
| 26 | +# Panel tree (config + stub .so + .desktop); default plugins = clock tasklist systray separator. |
| 27 | +SESS=/tmp/vmxu3sess |
22 | 28 | PLUGINS="${PLUGINS:-clock tasklist systray separator}" bash "$EXP/scripts/prepare-xfce4-panel.sh" "$SESS" >/dev/null 2>&1 |
23 | | -FIX=/tmp/vmxu7sess-dbus; rm -rf "$FIX" |
24 | | -bash "$EXP/scripts/prepare-dbus-fixtures.sh" "$FIX" >/dev/null |
25 | | -mkdir -p "$FIX/etc" "$FIX/var/lib/dbus" "$FIX/root/.cache" "$FIX/usr/share/backgrounds/xfce" "$FIX/root/.config/gtk-3.0" |
26 | | -printf '0123456789abcdef0123456789abcdef\n' > "$FIX/etc/machine-id"; cp -f "$FIX/etc/machine-id" "$FIX/var/lib/dbus/machine-id" |
27 | | -python3 -c "from PIL import Image; Image.new('RGB',(800,600),(40,92,158)).save('$FIX/usr/share/backgrounds/xfce/wallpaper.png')" |
28 | | -printf '[Settings]\ngtk-icon-theme-name=Adwaita\n' > "$FIX/root/.config/gtk-3.0/settings.ini" |
29 | | -CHDIR="$FIX/root/.config/xfce4/xfconf/xfce-perchannel-xml"; mkdir -p "$CHDIR" |
30 | | -cat > "$CHDIR/xfwm4.xml" <<'X' |
| 29 | +# dbus tree (separate) + machine-id + the xfwm4 channel. |
| 30 | +FIX=/tmp/vmxu3sess-dbus |
| 31 | +bash "$EXP/scripts/prepare-dbus-fixtures.sh" "$FIX" >/dev/null 2>&1 |
| 32 | +mkdir -p "$FIX/etc" "$FIX/var/lib/dbus" |
| 33 | +printf '0123456789abcdef0123456789abcdef\n' > "$FIX/etc/machine-id" |
| 34 | +cp -f "$FIX/etc/machine-id" "$FIX/var/lib/dbus/machine-id" |
| 35 | +CHDIR="$FIX/root/.config/xfce4/xfconf/xfce-perchannel-xml"; mkdir -p "$CHDIR" "$FIX/root/.cache" |
| 36 | +cat > "$CHDIR/xfwm4.xml" <<'XML' |
31 | 37 | <?xml version="1.0" encoding="UTF-8"?> |
32 | | -<channel name="xfwm4" version="1.0"><property name="general" type="empty"><property name="theme" type="string" value="Greybird"/><property name="title_font" type="string" value="Sans Bold 9"/><property name="use_compositing" type="bool" value="false"/></property></channel> |
33 | | -X |
34 | | -cat > "$CHDIR/xfce4-desktop.xml" <<'X' |
35 | | -<?xml version="1.0" encoding="UTF-8"?> |
36 | | -<channel name="xfce4-desktop" version="1.0"> |
37 | | - <property name="backdrop" type="empty"><property name="screen0" type="empty"><property name="monitorscreen" type="empty"><property name="workspace0" type="empty"> |
38 | | - <property name="color-style" type="int" value="0"/><property name="image-style" type="int" value="5"/> |
39 | | - <property name="last-image" type="string" value="/usr/share/backgrounds/xfce/wallpaper.png"/> |
40 | | - </property></property></property></property> |
41 | | -</channel> |
42 | | -X |
43 | | -W=${W:-800}; H=${H:-600} |
44 | | -FB="$(mktemp /tmp/xu7-full-fb.XXXXXX.bin)" |
45 | | -OUT="${OUT:-/tmp/xu7-full.log}" |
46 | | -PNG="${PNG:-$HOME/tmp/gui-progress/$(date -u +%Y-%m-%dT%H)/xu7-full-session.png}"; mkdir -p "$(dirname "$PNG")" |
47 | | -echo "running XU7 FULL session (xfwm4+panel+xfdesktop+thunar) -> png=$PNG log=$OUT" |
48 | | -WM_SETTLE_QUIET_MS=${WM_SETTLE_QUIET_MS:-18000} WM_SETTLE_CAP_S=${WM_SETTLE_CAP_S:-150} APP_SETTLE_MS=${APP_SETTLE_MS:-18000} \ |
49 | | -timeout "${OUTER:-400}" env -u DISPLAY NO_AT_BRIDGE=1 "$HOST" --xdemo ${CONCURRENT_FLAG:-} --timeout "${TIMEOUT:-340}" \ |
50 | | - --server "$EXP/Xvfb.wasm" --dbus "$EXP/dbus-daemon.wasm" --dbus-service "$EXP/xfconfd.wasm" \ |
51 | | - --client "$EXP/xfwm4.wasm" --client "$EXP/xfce4-panel.wasm" --client "$EXP/xfdesktop.wasm" --client "$EXP/thunar.wasm" \ |
| 38 | +<channel name="xfwm4" version="1.0"><property name="general" type="empty"> |
| 39 | +<property name="theme" type="string" value="Greybird"/> |
| 40 | +<property name="title_font" type="string" value="Sans Bold 9"/> |
| 41 | +<property name="use_compositing" type="bool" value="false"/></property></channel> |
| 42 | +XML |
| 43 | + |
| 44 | +W=800; H=600 |
| 45 | +FB="$(mktemp /tmp/xu3-sess-fb.XXXXXX.bin)" |
| 46 | +OUT="${OUT:-/tmp/xu7-session.log}" |
| 47 | +PNG="${PNG:-$HOME/tmp/gui-progress/$(date -u +%Y-%m-%dT%H)/xu7-session.png}" |
| 48 | +mkdir -p "$(dirname "$PNG")" |
| 49 | + |
| 50 | +echo "running XU3 session -> fb=$FB png=$PNG log=$OUT" |
| 51 | +WM_SETTLE_QUIET_MS=3000 WM_SETTLE_CAP_S=50 APP_SETTLE_MS=4000 \ |
| 52 | +timeout 200 env -u DISPLAY NO_AT_BRIDGE=1 "$HOST" --xdemo --timeout "${TIMEOUT:-120}" \ |
| 53 | + --server "$EXP/Xvfb.wasm" \ |
| 54 | + --dbus "$EXP/dbus-daemon.wasm" \ |
| 55 | + --dbus-service "$EXP/xfconfd.wasm" \ |
| 56 | + --client "$EXP/xfwm4.wasm" \ |
| 57 | + --client "$EXP/mousepad.wasm" \ |
| 58 | + --client "$EXP/xfce4-panel.wasm" \ |
| 59 | + --client "$EXP/xfdesktop.wasm" \ |
| 60 | + --client "$EXP/thunar.wasm" \ |
52 | 61 | --fonts-dir "$FONTS" --locale-dir "$LOCALE" \ |
53 | | - --vm-tree "$FIX" --vm-tree "$SESS" --vm-tree "$THEMES" --vm-tree "$WMDATA" --vm-tree "$XFT" --vm-tree "$ICONS" --vm-tree /tmp/vmschemas \ |
| 62 | + --vm-tree "$FIX" --vm-tree "$SESS" --vm-tree "$THEMES" --vm-tree "$WMDATA" --vm-tree "$XFT" --vm-tree /tmp/vmschemas \ |
54 | 63 | --fb-out "$FB" --sidecar "$SIDECAR" \ |
55 | | - -- :0 -screen 0 ${W}x${H}x24 -nolisten tcp -nolock -listen local -noreset -fbdir /data > "$OUT" 2>&1 || true |
56 | | -echo "clients completed: $(grep -aoE '[0-9]+/[0-9]+ X client' "$OUT" | tail -1)" |
| 64 | + -- :0 -screen 0 ${W}x${H}x24 -nolisten tcp -nolock -listen local -noreset -fbdir /data \ |
| 65 | + > "$OUT" 2>&1 || true |
| 66 | + |
| 67 | +echo "=== session evidence ===" |
| 68 | +grep -aiE "Gtk-ERROR|unreachable|No window manager|exited with code|deadlock|PARKED" "$OUT" | grep -aviE "NETWRITE|NETREAD" | head -6 |
57 | 69 | [ -s "$FB" ] && python3 "$EXP/scripts/fb2png.py" "$FB" "$PNG" "$W" "$H" 2>&1 | tail -1 |
58 | 70 | python3 - "$PNG" <<'PY' |
59 | 71 | from PIL import Image |
60 | 72 | import sys, os |
61 | 73 | p=sys.argv[1] |
62 | | -if not os.path.exists(p): print("XU7: no png"); sys.exit(1) |
| 74 | +if not os.path.exists(p): print("XU7 SESSION: no png"); sys.exit(1) |
63 | 75 | im=Image.open(p).convert("RGB"); W,H=im.size; px=im.load() |
64 | | -blue=sum(1 for y in range(0,H,4) for x in range(0,W,4) if px[x,y][2]>px[x,y][0]+20 and px[x,y][2]>80) |
65 | | -white=sum(1 for y in range(0,H,4) for x in range(0,W,4) if min(px[x,y])>230) |
66 | | -toprow=sum(1 for x in range(0,W,2) if any(max(px[x,y])>40 for y in range(0,30))) |
67 | | -print(f"wallpaper-blue cells: {blue}; white(window) cells: {white}; panel top-cover: {toprow}/{W//2}") |
68 | | -print("XU7 FULL:", "wallpaper="+("Y" if blue>500 else "n"), "window="+("Y" if white>200 else "n"), "panel="+("Y" if toprow>W//2*0.6 else "n")) |
| 76 | +# panel band: a near-full-width row of non-bg pixels near the top (y<32). |
| 77 | +def nb(x,y): return max(px[x,y])>25 |
| 78 | +toprow=sum(1 for x in range(0,W,2) if any(nb(x,y) for y in range(0,30))) |
| 79 | +# app window: a large white-ish region in the body. |
| 80 | +white=[(x,y) for y in range(40,H,3) for x in range(0,W,3) if px[x,y][0]>235 and px[x,y][1]>235 and px[x,y][2]>235] |
| 81 | +print(f"panel band top-coverage: {toprow}/{W//2} columns") |
| 82 | +if white: |
| 83 | + xs=[q[0] for q in white]; ys=[q[1] for q in white] |
| 84 | + print(f"app window bbox: x[{min(xs)}..{max(xs)}] y[{min(ys)}..{max(ys)}]") |
| 85 | +else: |
| 86 | + print("app window: none detected") |
| 87 | +ok = toprow > (W//2)*0.7 and bool(white) |
| 88 | +print("XU7 SESSION:", "PASS (panel + decorated app under xfwm4)" if ok else "PARTIAL") |
69 | 89 | PY |
0 commit comments