Integrate managed lock screen recovery
This commit is contained in:
@@ -76,6 +76,7 @@ chmod +x "$config_path/scripts/panama-lock"
|
||||
|
||||
printf '%s\n' '{"generated":true,"path":"/fixture/generated-hyprlock.conf","fallback":false,"error":""}' \
|
||||
>"$status_response"
|
||||
: >"$generate_log"
|
||||
|
||||
qs_for_harness() {
|
||||
if [[ "$harness_pid" =~ ^[0-9]+$ && "${1:-}" == "ipc" ]]; then
|
||||
@@ -113,7 +114,15 @@ done
|
||||
jq -e '.generated == true and .fallback == false and .path == "/fixture/generated-hyprlock.conf" and .lastError == ""' \
|
||||
<<<"$initial" >/dev/null || fail "valid helper status was not accepted: $initial"
|
||||
|
||||
baseline_generations="$(wc -l <"$generate_log" 2>/dev/null || printf 0)"
|
||||
# Component startup intentionally schedules one generation. Let that and any
|
||||
# preference-file load revision settle before measuring only the burst below.
|
||||
sleep 0.6
|
||||
for _ in $(seq 1 30); do
|
||||
startup="$(qs_for_harness ipc call lock-screen-test status)"
|
||||
[[ "$(jq -r '.busy' <<<"$startup")" == false ]] && break
|
||||
sleep 0.1
|
||||
done
|
||||
baseline_generations="$(wc -l <"$generate_log")"
|
||||
qs_for_harness ipc call lock-screen-test burst >/dev/null
|
||||
for _ in $(seq 1 60); do
|
||||
current_generations="$(wc -l <"$generate_log" 2>/dev/null || printf 0)"
|
||||
|
||||
@@ -90,6 +90,11 @@ for name in hypr quickshell uwsm vicinae; do
|
||||
ln -s "$repo_dir/config/dot/$name" "$config_home/$name"
|
||||
done
|
||||
ln -s "$repo_dir/config/local/share/vicinae/scripts" "$data_home/vicinae/scripts/panama"
|
||||
mkdir -p "$state_home/panama"
|
||||
printf '%s\n' 'background { path = /fixture-secret-wallpaper.jpg }' \
|
||||
>"$state_home/panama/hyprlock.conf"
|
||||
printf '%s\n' '{"generated":true,"path":"/fixture-secret-wallpaper.jpg","fallback":false,"error":""}' \
|
||||
>"$state_home/panama/hyprlock-status.json"
|
||||
|
||||
run_doctor() {
|
||||
HOME="$home" \
|
||||
@@ -107,7 +112,7 @@ run_doctor() {
|
||||
/usr/bin/python3 "$doctor" "$@"
|
||||
}
|
||||
|
||||
expected_order=$'desktop.hyprland\ndesktop.quickshell\ndesktop.notifications\ndesktop.portals\ndesktop.hyprpaper\ndesktop.hypridle\ndesktop.vicinae\ninput.pipewire\ninput.clipboard\ninput.wallpaper\ninput.capture\ninput.ocr\ninput.brightness\nintegration.nextcloud\nintegration.rustdesk\nintegration.kdeconnect\nintegration.bluebubbles\nintegration.home-assistant\nintegration.calendar\npanama.runtime-links\npanama.vicinae-commands\npanama.selected-terminal\npanama.selected-launcher\npanama.processes\npanama.caffeine'
|
||||
expected_order=$'desktop.hyprland\ndesktop.quickshell\ndesktop.notifications\ndesktop.portals\ndesktop.hyprpaper\ndesktop.hypridle\ndesktop.hyprlock\ndesktop.vicinae\ninput.pipewire\ninput.clipboard\ninput.wallpaper\ninput.capture\ninput.ocr\ninput.brightness\nintegration.nextcloud\nintegration.rustdesk\nintegration.kdeconnect\nintegration.bluebubbles\nintegration.home-assistant\nintegration.calendar\npanama.runtime-links\npanama.vicinae-commands\npanama.selected-terminal\npanama.selected-launcher\npanama.processes\npanama.caffeine'
|
||||
|
||||
assert_schema_and_redaction() {
|
||||
local snapshot="$1"
|
||||
@@ -116,8 +121,8 @@ assert_schema_and_redaction() {
|
||||
and (.summary.status | IN("healthy", "warning", "error"))
|
||||
and (.context.session | IN("hyprland", "other"))
|
||||
and (.context.versions | type == "array")
|
||||
and ([.checks[].id] | length == 25)
|
||||
and ([.checks[].id] | unique | length == 25)
|
||||
and ([.checks[].id] | length == 26)
|
||||
and ([.checks[].id] | unique | length == 26)
|
||||
and ([.checks[].status] | all(IN("ok", "warning", "error", "unconfigured")))' \
|
||||
>/dev/null <<<"$snapshot" || fail "invalid schema: $snapshot"
|
||||
[[ "$(jq -r '.checks[].id' <<<"$snapshot")" == "$expected_order" ]] \
|
||||
@@ -139,6 +144,21 @@ check_status() {
|
||||
snapshot="$(run_doctor --json)"
|
||||
assert_schema_and_redaction "$snapshot"
|
||||
check_status "$snapshot" panama.vicinae-commands ok
|
||||
check_status "$snapshot" desktop.hyprlock ok
|
||||
|
||||
printf '%s\n' '{"generated":false,"path":"/fixture-secret-wallpaper.jpg","fallback":true,"error":"fixture-secret-token"}' \
|
||||
>"$state_home/panama/hyprlock-status.json"
|
||||
fallback_lock="$(run_doctor --json)"
|
||||
check_status "$fallback_lock" desktop.hyprlock warning
|
||||
assert_schema_and_redaction "$fallback_lock"
|
||||
|
||||
rm "$config_home/hypr"
|
||||
missing_lock="$(run_doctor --json)"
|
||||
check_status "$missing_lock" desktop.hyprlock error
|
||||
assert_schema_and_redaction "$missing_lock"
|
||||
ln -s "$repo_dir/config/dot/hypr" "$config_home/hypr"
|
||||
printf '%s\n' '{"generated":true,"path":"/fixture-secret-wallpaper.jpg","fallback":false,"error":""}' \
|
||||
>"$state_home/panama/hyprlock-status.json"
|
||||
|
||||
# The diagnostic follows the actual installer contract: the scripts parent is
|
||||
# a directory and only its Panama child is an authored link.
|
||||
|
||||
@@ -48,6 +48,7 @@ for mapping in \
|
||||
'SystemSettings.applyPersistedDisplayPolicy();' \
|
||||
'Keybinds.applyReload();' \
|
||||
'Wallpaper.set(path);' \
|
||||
'LockScreen.regenerate();' \
|
||||
'Quickshell.reload(false);'; do
|
||||
rg -Fq "$mapping" "$service" || fail "production restore seam is missing: $mapping"
|
||||
done
|
||||
@@ -88,6 +89,7 @@ jq -e '
|
||||
"system.apply",
|
||||
"keybinds.reload",
|
||||
"wallpaper.set:/tmp/restored-wallpaper.jpg",
|
||||
"lock.regenerate",
|
||||
"display.block:false",
|
||||
"shell.reload"
|
||||
]
|
||||
@@ -126,6 +128,7 @@ jq -e '
|
||||
"system.apply",
|
||||
"keybinds.reload",
|
||||
"wallpaper.set:/tmp/restored-wallpaper.jpg",
|
||||
"lock.regenerate",
|
||||
"display.block:false",
|
||||
"shell.reload"
|
||||
]
|
||||
|
||||
@@ -45,6 +45,8 @@ rg -Fq 'Keybinds.applyReload();' "$system_settings" \
|
||||
|| fail 'restoreDefaults does not replay shipped keybindings'
|
||||
rg -Fq 'root.applyWallpaper(String(DesktopPreferences.get("wallpaperPath") ?? ""));' "$system_settings" \
|
||||
|| fail 'restoreDefaults does not visibly reapply the shipped wallpaper'
|
||||
rg -Fq 'LockScreen.regenerate();' "$system_settings" \
|
||||
|| fail 'restoreDefaults does not regenerate the shipped lock screen'
|
||||
rg -Fq 'const effectivePath = path === "" ? root.shippedPath : path;' "$wallpaper_service" \
|
||||
|| fail 'clearing wallpaper preference leaves the old image visible'
|
||||
rg -Fq 'property string storedValue:' "$wallpaper_service" \
|
||||
@@ -139,12 +141,24 @@ jq -e '.calls == [
|
||||
"display.protect",
|
||||
"keybinds.reload",
|
||||
"wallpaper.set:",
|
||||
"lock.regenerate",
|
||||
"display.block:false"
|
||||
] and .displayBlocked == false' <<<"$reset_state" >/dev/null \
|
||||
|| fail "reset did not safely replay non-reactive state: $reset_state"
|
||||
|
||||
[[ "$(qs_for_harness ipc call settings-system-test stored dockHideDelayMs)" == "250" ]] \
|
||||
|| fail 'reset did not restore a schema default'
|
||||
for default_case in \
|
||||
'lockBackgroundMode|"screenshot"' \
|
||||
'lockBlurLevel|3' \
|
||||
'lockShowClock|true' \
|
||||
'lockShowDate|true' \
|
||||
'lockShowUser|true' \
|
||||
'lockFadeOnEmpty|false'; do
|
||||
IFS='|' read -r key expected <<<"$default_case"
|
||||
[[ "$(qs_for_harness ipc call settings-system-test stored "$key")" == "$expected" ]] \
|
||||
|| fail "reset did not restore $key to $expected"
|
||||
done
|
||||
[[ "$(qs_for_harness ipc call settings-system-test stored displays | jq -cS .)" == "$(jq -cS . <<<"$display_fixture")" ]] \
|
||||
|| fail 'reset replaced confirmed display geometry without confirmation'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user