aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/status/test-statusctl.sh
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/status/test-statusctl.sh')
-rwxr-xr-xdesktop/modules/status/test-statusctl.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/desktop/modules/status/test-statusctl.sh b/desktop/modules/status/test-statusctl.sh
index 170101c..0c51968 100755
--- a/desktop/modules/status/test-statusctl.sh
+++ b/desktop/modules/status/test-statusctl.sh
@@ -149,11 +149,34 @@ kill "$watcher5" 2>/dev/null
wait "$watcher5" 2>/dev/null
check "first write, created by link, redraws" "1" "$(grep -c '"class": *"gaming"' "$out5")"
+# deck-it writes status.xbox while the Xbox runs a game; it holds
+# presentation on the same way, so the watch follows it too.
+rm -f "$tmp/status.gaming" "$tmp/status.presentation"
+out6="$tmp/watch6.out"
+"$ctl" presentation watch > "$out6" 2>/dev/null &
+watcher6=$!
+sleep 0.3
+printf '1\n' > "$tmp/status.xbox.tmp"
+mv -f "$tmp/status.xbox.tmp" "$tmp/status.xbox"
+sleep 0.5
+kill "$watcher6" 2>/dev/null
+wait "$watcher6" 2>/dev/null
+check "xbox game redraws as gaming" "1" "$(grep -c '"class": *"gaming"' "$out6")"
+"$ctl" presentation toggle 2>/dev/null
+check "toggle refused while the xbox plays" "1" "$?"
+rm -f "$tmp/status.xbox"
+
# quiet is a plain mode like dnd.
"$ctl" quiet set 1
check "quiet set 1" "1" "$("$ctl" quiet get)"
"$ctl" quiet toggle
check "quiet toggle from 1" "0" "$("$ctl" quiet get)"
+# nolamp keeps agent-lamp's bulb dark; a plain mode like quiet.
+"$ctl" nolamp set 1
+check "nolamp set 1" "1" "$("$ctl" nolamp get)"
+"$ctl" nolamp toggle
+check "nolamp toggle from 1" "0" "$("$ctl" nolamp get)"
+
printf '\n%d passed, %d failed\n' "$pass" "$fail"
[[ "$fail" -eq 0 ]]