From 41e9e18f2a88b6668664ad1bc9e2887bdf51027c Mon Sep 17 00:00:00 2001 From: David Boulay Date: Sun, 20 Sep 2026 01:11:25 +0200 Subject: [PATCH] Stub omarchy-osd in the system power test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test runs bin/omarchy-system-reboot and bin/omarchy-system-shutdown for real, stubbing systemd-run, omarchy-state, omarchy-hyprland-window-close-all and sleep. omarchy-osd was left out, so both scripts' `omarchy-osd -i ... -d 5000` calls ran unstubbed. omarchy-osd is a wrapper around `omarchy-shell -q osd show`, which reaches the shell over IPC keyed on HYPRLAND_INSTANCE_SIGNATURE and XDG_RUNTIME_DIR. Neither the stub PATH nor a sandboxed HOME isolates that, so running the suite on a live session painted "Rebooting" and then "Shutting down" on the real screen for five seconds each — with no reboot or shutdown behind them, since systemd-run was mocked. Stub it alongside the rest and assert the call, so the OSD each script shows is covered rather than merely escaping. Co-Authored-By: Claude Opus 5 (1M context) --- test/shell.d/system-power-test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/shell.d/system-power-test.sh b/test/shell.d/system-power-test.sh index 2c65b5e1aa2a..586895f696f4 100755 --- a/test/shell.d/system-power-test.sh +++ b/test/shell.d/system-power-test.sh @@ -17,7 +17,7 @@ printf 'systemd-run %s\n' "$*" >>"$CALL_LOG" exit 0 SH -for command in omarchy-state omarchy-hyprland-window-close-all sleep; do +for command in omarchy-osd omarchy-state omarchy-hyprland-window-close-all sleep; do cat >"$mock_bin/$command" <<'SH' #!/bin/bash @@ -36,10 +36,12 @@ run_power_command() { assert_power_calls() { local action="$1" local systemctl_action="$2" + local osd_message="$3" local expected_log="$test_tmp/$action-expected.log" cat >"$expected_log" <"$call_log"