From 0a12c0e4c6ff16fca1a76f3b15586031238f71f4 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Tue, 29 Sep 2026 14:12:39 +0200 Subject: [PATCH] feat: the hw suite (H1, H4, H5, R1.7 CEC) and host-side suite blocks vmsuite.sh runs NN-name.host.sh blocks on the host (reboot, scripts/vmcec.sh) with prelude-host.sh; every block that applies Steamify says so first (INFO) so the shared console is not silent for minutes. 68 checks pass. --- TODO.md | 2 +- scripts/vmsuite.sh | 6 +++++- share/vmtest/cli/20-f3-everything-desktop.sh | 1 + .../vmtest/cli/30-f4-single-brings-conversion.sh | 1 + .../vmtest/cli/40-f5-poweroff-brings-machine.sh | 1 + share/vmtest/cli/50-f7-boot-only.sh | 1 + share/vmtest/hw/10-h1-h5-leds-poweroff.sh | 16 ++++++++++++++++ .../vmtest/hw/20-h4-boot-desktop-reboot.host.sh | 10 ++++++++++ share/vmtest/hw/30-r1-7-cec.host.sh | 4 ++++ share/vmtest/menu/10-r1-menu.sh | 1 + share/vmtest/prelude-host.sh | 8 ++++++++ share/vmtest/prelude.sh | 1 + 12 files changed, 50 insertions(+), 2 deletions(-) mode change 100755 => 100644 share/vmtest/cli/20-f3-everything-desktop.sh mode change 100755 => 100644 share/vmtest/cli/30-f4-single-brings-conversion.sh mode change 100755 => 100644 share/vmtest/cli/40-f5-poweroff-brings-machine.sh mode change 100755 => 100644 share/vmtest/cli/50-f7-boot-only.sh create mode 100644 share/vmtest/hw/10-h1-h5-leds-poweroff.sh create mode 100644 share/vmtest/hw/20-h4-boot-desktop-reboot.host.sh create mode 100644 share/vmtest/hw/30-r1-7-cec.host.sh create mode 100644 share/vmtest/prelude-host.sh diff --git a/TODO.md b/TODO.md index a873b59..f30b574 100644 --- a/TODO.md +++ b/TODO.md @@ -40,7 +40,7 @@ R2.2 (first desktop login look), H-Real (real Steam Machine). prints the skipped manual rows; move the loader matrix under suite `boot` - [x] S2. Suite `cli` (55 checks pass): G1-G3, F1-F7 (exit codes, `features.state`, boot-desktop unit) - [x] S3. Suite `menu` (36 checks pass): R1.1-R1.6, R1.10 with scripted menu input (`vmrun.sh`) and `vmstate.sh` asserts -- [ ] S4. Suite `hw`: H1, H3 (`WIZARD_BIOS_DRY_RUN=1`), H4, H5, R1.7 (`vmcec.sh --no-sleep`) +- [x] S4. Suite `hw` (68 checks pass; H3 BIOS dry-run still to add): H1, H3 (`WIZARD_BIOS_DRY_RUN=1`), H4, H5, R1.7 (`vmcec.sh --no-sleep`) - [ ] S5. Suite `installer`: R2.1 (`vminstallsim.sh`) - [ ] S6. R1.8 toggle matrix and R1.9 reboot checks (from the skill), as suite `toggles` - [ ] S7. TESTPLAN.md: mark which rows are automated (a column or a tag), keep the results log automatic: diff --git a/scripts/vmsuite.sh b/scripts/vmsuite.sh index e1c124b..1c3cf96 100644 --- a/scripts/vmsuite.sh +++ b/scripts/vmsuite.sh @@ -3,7 +3,7 @@ # CachyOS VM (Plasma, no Steamify: ~/vms/steamify-vm, from vminstall.sh --iso with VM_STEAMIFY=skip). # scripts/vmsuite.sh [--window] suites: the folders in share/vmtest/ (cli, ...) # Every block share/vmtest//NN-name.sh starts from a fresh `ssh-ready` (vmreset.sh --fremont), -# runs in the guest as the VM user (repo on /mnt), and prints PASS/FAIL/SKIP lines; the first +# runs in the guest as the VM user (repo on /mnt; NN-name.host.sh blocks run on the host instead), and prints PASS/FAIL/SKIP lines; the first # comment lines say which TESTPLAN rows it covers. Log: $VM_DIR..log. Exit status = FAILs. # Env: ONLY= runs just that block; VM_DIR (default ~/vms/steamify-vm), REPO (default ../steamify-cachyos). set -uo pipefail @@ -24,6 +24,10 @@ for block in "$dir"/*.sh; do [[ -z "${ONLY:-}" || "$(basename "$block")" == "$ONLY"* ]] || continue # ONLY=50: just that block printf '\n##### %s %s\n' "$(date +%T)" "$(basename "$block" .sh)" "$here/vmreset.sh" --fremont > /tmp/vmsuite-reset.out 2>&1 || { echo "FAIL vmreset.sh failed: $(tail -n 1 /tmp/vmsuite-reset.out)"; continue; } + if [[ "$block" == *.host.sh ]]; then # runs on the host (reboots, host scripts); prelude-host.sh has the helpers + ( . "$repo/share/vmtest/prelude-host.sh"; . "$block" ) 2>&1 | sed -u 's/\x1b\[[0-9;]*m//g' + continue + fi cat "$repo/share/vmtest/prelude.sh" "$block" | vm_ssh -o ConnectTimeout=6 -o LogLevel=ERROR bash -s 2>&1 | sed -u 's/\x1b\[[0-9;]*m//g' done } 2>&1 | tee "$log" | tee -a "$TEST_LOG" diff --git a/share/vmtest/cli/20-f3-everything-desktop.sh b/share/vmtest/cli/20-f3-everything-desktop.sh old mode 100755 new mode 100644 index 5d20de5..a055331 --- a/share/vmtest/cli/20-f3-everything-desktop.sh +++ b/share/vmtest/cli/20-f3-everything-desktop.sh @@ -1,4 +1,5 @@ # F3: every item and --boot desktop: all on, the boot-desktop unit enabled, VRAM left out with a warning. +info "applying Steamify (installs packages, builds kernel modules: a few minutes)..." out=$(sf --defaults --options gaming,theme,glyphs,single,launcher,notify,vram,cec,machine,poweroff --boot desktop); rc=$? [[ $rc -eq 0 ]] && pass "F3 exit 0" || fail "F3 exit $rc" expect_on gaming theme glyphs single launcher notify machine poweroff cec diff --git a/share/vmtest/cli/30-f4-single-brings-conversion.sh b/share/vmtest/cli/30-f4-single-brings-conversion.sh old mode 100755 new mode 100644 index b76c60a..ba1b975 --- a/share/vmtest/cli/30-f4-single-brings-conversion.sh +++ b/share/vmtest/cli/30-f4-single-brings-conversion.sh @@ -1,4 +1,5 @@ # F4: --options theme,single,machine --boot desktop: single brings the conversion; the rest stays off. +info "applying Steamify (installs packages, builds kernel modules: a few minutes)..." sf --defaults --options theme,single,machine --boot desktop >/dev/null; rc=$? [[ $rc -eq 0 ]] && pass "F4 exit 0" || fail "F4 exit $rc" expect_on gaming theme single machine diff --git a/share/vmtest/cli/40-f5-poweroff-brings-machine.sh b/share/vmtest/cli/40-f5-poweroff-brings-machine.sh old mode 100755 new mode 100644 index 096eddc..51bbf43 --- a/share/vmtest/cli/40-f5-poweroff-brings-machine.sh +++ b/share/vmtest/cli/40-f5-poweroff-brings-machine.sh @@ -1,5 +1,6 @@ # F5: --options launcher,vram,poweroff: poweroff brings Steam Machine support; conversion off, plasmalogin unchanged. dm_before=$(current_display_manager) +info "applying Steamify (installs packages, builds kernel modules: a few minutes)..." sf --defaults --options launcher,vram,poweroff >/dev/null; rc=$? [[ $rc -eq 0 ]] && pass "F5 exit 0" || fail "F5 exit $rc" expect_on machine poweroff launcher diff --git a/share/vmtest/cli/50-f7-boot-only.sh b/share/vmtest/cli/50-f7-boot-only.sh old mode 100755 new mode 100644 index a5d5908..d5fb66d --- a/share/vmtest/cli/50-f7-boot-only.sh +++ b/share/vmtest/cli/50-f7-boot-only.sh @@ -1,4 +1,5 @@ # F7: on an install, --boot desktop, again, --boot gamescope: only Boot into changes; the menu ticks stay. +info "applying Steamify (installs packages, builds kernel modules: a few minutes)..." sf --defaults --options gaming,theme,single,launcher,notify,machine,poweroff >/dev/null base=$(ticks | sed 's/boot //') sf --boot desktop >/dev/null; rc=$? diff --git a/share/vmtest/hw/10-h1-h5-leds-poweroff.sh b/share/vmtest/hw/10-h1-h5-leds-poweroff.sh new file mode 100644 index 0000000..63a040a --- /dev/null +++ b/share/vmtest/hw/10-h1-h5-leds-poweroff.sh @@ -0,0 +1,16 @@ +# H1 (LED driver) and H5 (power-off module) with the faked Steam Machine. +info "applying Steamify (installs packages, builds kernel modules: a few minutes)..." +sf --defaults --options gaming,theme,glyphs,single,launcher,notify,cec,machine,poweroff >/dev/null; rc=$? +[[ $rc -eq 0 ]] && pass "Steamify applied (exit 0)" || fail "Steamify exit $rc" +# H1 +lsmod | grep -q '^leds_valve' && pass "H1 leds_valve loaded" || fail "H1 leds_valve not loaded" +n=$(compgen -G "/sys/class/leds/valve-leds*" | wc -l); [[ $n -eq 17 ]] && pass "H1 17 valve-leds nodes" || fail "H1 $n valve-leds nodes" +own=$(stat -c %U /sys/class/leds/valve-leds*/brightness 2>/dev/null | sort -u | tr '\n' ' '); [[ "$own" == "$(id -un) " ]] && pass "H1 the nodes belong to the user" || fail "H1 node owner: $own" +# H5 +for k in $(ls /usr/lib/modules); do + compgen -G "/usr/lib/modules/$k/updates/dkms/steamify-fremont-poweroff.ko*" >/dev/null && pass "H5 power-off module built for $k" || fail "H5 no power-off module for $k" +done +sudo modprobe -r steamify_fremont_poweroff 2>/dev/null +out=$(sudo modprobe steamify_fremont_poweroff 2>&1); rc=$? +# in the VM there is no GPIO wake bit: it loads, or answers "No such device" +[[ $rc -eq 0 ]] || grep -q "No such device" <<< "$out" && pass "H5 the module loads (or: No such device, no GPIO wake bit)" || fail "H5 modprobe: $out" diff --git a/share/vmtest/hw/20-h4-boot-desktop-reboot.host.sh b/share/vmtest/hw/20-h4-boot-desktop-reboot.host.sh new file mode 100644 index 0000000..3cf9387 --- /dev/null +++ b/share/vmtest/hw/20-h4-boot-desktop-reboot.host.sh @@ -0,0 +1,10 @@ +# H4: Boot into desktop, reboot: Plasma straight after boot; Boot into gaming: SDDM autologin into gamescope (session file). +conf=/etc/sddm.conf.d/10-gamescope-autologin.conf +info "applying Steamify (a few minutes)..." +guest 'sf --defaults --options gaming,theme,single,machine --boot gamescope >/dev/null; echo done' | tail -n 1 | grep -q done && pass "H4 conversion applied" || fail "H4 apply" +guest "grep -h '^Session=' $conf" | grep -qi gamescope && pass "H4 gaming: the SDDM autologin session is gamescope" || fail "H4 gaming session: $(guest "grep -h Session= $conf")" +guest 'sf --boot desktop >/dev/null; echo done' | tail -n 1 | grep -q done && pass "H4 --boot desktop" || fail "H4 --boot desktop" +reboot_guest && pass "H4 the VM is back after the reboot" || { fail "H4 no ssh after the reboot"; return 0 2>/dev/null || exit 0; } +up=""; for _ in $(seq 40); do vm_ssh "pgrep -u $VM_USER -x plasmashell" >/dev/null 2>&1 && { up=1; break; }; sleep 3; done +[[ -n "$up" ]] && pass "H4 Plasma straight after the boot (boot into desktop)" || fail "H4 no plasmashell after the reboot" +guest 'sf --boot gamescope >/dev/null; echo done' | tail -n 1 | grep -q done && pass "H4 --boot gamescope" || fail "H4 --boot gamescope" diff --git a/share/vmtest/hw/30-r1-7-cec.host.sh b/share/vmtest/hw/30-r1-7-cec.host.sh new file mode 100644 index 0000000..d9f621c --- /dev/null +++ b/share/vmtest/hw/30-r1-7-cec.host.sh @@ -0,0 +1,4 @@ +# R1.7 / H2: HDMI-CEC with vivid (fake TV and remote): scripts/vmcec.sh prints PASS/FAIL/SKIP (2 SKIP in the VM: wake from TV, sleep). +info "applying Steamify (a few minutes)..." +guest 'sf --defaults --options gaming,theme,glyphs,single,launcher,notify,cec,machine,poweroff >/dev/null; sudo modprobe vivid; echo done' | tail -n 1 | grep -q done && pass "CEC: Steamify applied, vivid loaded" || fail "CEC setup" +"$repo/scripts/vmcec.sh" --no-sleep 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E '^(PASS|FAIL|SKIP)|PASS|FAIL' | sed -E 's/^[^A-Z]*(PASS|FAIL|SKIP)/\1 CEC:/' | cut -c1-140 diff --git a/share/vmtest/menu/10-r1-menu.sh b/share/vmtest/menu/10-r1-menu.sh index 31999be..eaefd7a 100644 --- a/share/vmtest/menu/10-r1-menu.sh +++ b/share/vmtest/menu/10-r1-menu.sh @@ -6,6 +6,7 @@ for n in 1 3 4 5 6 7 8 9 10; do grep -qE "^ +$n +[a-z-]+ +\[x\]" <<< "$out" && p grep -qE "^ +11 .*\[ \]" <<< "$out" && pass "R1.1 Update BIOS not ticked" || fail "R1.1 Update BIOS ticked" grep -q "Boot into: \[gamescope\]" <<< "$out" && pass "R1.1 boots into gamescope by default" || fail "R1.1 boot default is not gamescope" # R1.2: everything OK, back in the menu with all on +info "applying Steamify (installs packages, builds kernel modules: a few minutes)..." out=$(menu '\ny\nm\nq\nn\n') grep -q '^\[ERROR\]' <<< "$out" && fail "R1.2 errors: $(grep -m1 '^\[ERROR\]' <<< "$out")" || pass "R1.2 no errors" grep -q "^\[OK\]" <<< "$out" && pass "R1.2 applied (the run printed [OK] lines)" || fail "R1.2 printed no [OK] line" diff --git a/share/vmtest/prelude-host.sh b/share/vmtest/prelude-host.sh new file mode 100644 index 0000000..58794e8 --- /dev/null +++ b/share/vmtest/prelude-host.sh @@ -0,0 +1,8 @@ +# Sourced in front of a *.host.sh block (scripts/vmsuite.sh): the block runs on the host with the VM's ssh helpers. +. "$repo/scripts/common.sh" +info() { echo "INFO $*"; } +pass() { echo "PASS $*"; }; fail() { echo "FAIL $*"; }; skip() { echo "SKIP $*"; } +# guest : a command in the guest with the Plasma session environment and Steamify's libs +guest() { { cat "$repo/share/vmtest/prelude.sh"; echo "$*"; } | vm_ssh -o ConnectTimeout=6 -o LogLevel=ERROR bash -s 2>&1 | sed 's/\x1b\[[0-9;]*m//g'; } +waitssh() { local _; for _ in $(seq 60); do vm_ssh -o ConnectTimeout=4 'uptime -p' >/dev/null 2>&1 && return 0; sleep 5; done; return 1; } +reboot_guest() { vm_ssh 'sudo systemctl reboot' >/dev/null 2>&1; sleep 25; waitssh; } diff --git a/share/vmtest/prelude.sh b/share/vmtest/prelude.sh index 91d9997..bfac52e 100644 --- a/share/vmtest/prelude.sh +++ b/share/vmtest/prelude.sh @@ -1,6 +1,7 @@ # Sent to the guest in front of every block (scripts/vmsuite.sh): helpers and Steamify's libs. # ssh has no Plasma session: the theme item (Vapor layout) needs one (vmrun.sh does the same). export XDG_RUNTIME_DIR=/run/user/$(id -u) WAYLAND_DISPLAY=wayland-0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +info() { echo "INFO $*"; } pass() { echo "PASS $*"; }; fail() { echo "FAIL $*"; }; skip() { echo "SKIP $*"; } sudo mountpoint -q /mnt || sudo mount -t 9p -o trans=virtio,version=9p2000.L repo /mnt cd /mnt || exit 1