DSH-Arch-Setup/test/install-layout.test.sh
Шурупов Илья Викторович cf9443753e Add one-command Arch DSH setup
Package the portable DSH profiles, local plugins, desktop integration, Firefox wrapper, and ownership-aware installer lifecycle. Bundle checksum-pinned OpenVSCode, editor extensions, translation assets, and cloudflared so unreliable upstream artifact downloads cannot break a clean installation.
2026-09-12 19:13:36 +03:00

47 lines
2.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
repository_directory=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
test_home=$(mktemp -d)
trap 'rm -rf "$test_home"' EXIT
export HOME="$test_home"
export XDG_STATE_HOME="$test_home/.local/state"
mkdir -p "$HOME/.local/share/applications" "$HOME/.dsh"
printf 'original desktop\n' > "$HOME/.local/share/applications/dsh-app.desktop"
printf 'credential sentinel\n' > "$HOME/.dsh/.credentials.yaml"
"$repository_directory/uninstall.sh" --test-mode
grep -q '^credential sentinel$' "$HOME/.dsh/.credentials.yaml"
"$repository_directory/install.sh" --test-mode
test -x "$HOME/.local/bin/dsh-app"
test -f "$HOME/.config/systemd/user/dsh-web.service"
test -f "$HOME/.dsh/profiles/web/package.json"
test -f "$HOME/.dsh/profiles/headless/package.json"
test -f "$HOME/.local/share/icons/hicolor/512x512/apps/dsh.png"
grep -q "$HOME/.local/bin/dsh-app" "$HOME/.local/share/applications/dsh-app.desktop"
while IFS= read -r plugin; do
test "$(readlink -f "$HOME/.dsh/plugins/$plugin")" = "$(readlink -f "$repository_directory/plugins/$plugin")"
done < "$repository_directory/manifests/local-plugins.txt"
while IFS= read -r plugin; do
test "$(readlink -f "$HOME/.dsh/vendor/$plugin")" = "$(readlink -f "$repository_directory/vendor/$plugin")"
done < "$repository_directory/manifests/vendored-plugins.txt"
printf 'user modified\n' > "$HOME/.local/share/dsh-app-firefox/chrome/userChrome.css"
"$repository_directory/install.sh" --test-mode
grep -q '#TabsToolbar' "$HOME/.local/share/dsh-app-firefox/chrome/userChrome.css"
"$repository_directory/uninstall.sh" --test-mode
grep -q '^original desktop$' "$HOME/.local/share/applications/dsh-app.desktop"
grep -q '^user modified$' "$HOME/.local/share/dsh-app-firefox/chrome/userChrome.css"
grep -q '^credential sentinel$' "$HOME/.dsh/.credentials.yaml"
while IFS= read -r plugin; do
test ! -e "$HOME/.dsh/plugins/$plugin"
done < "$repository_directory/manifests/local-plugins.txt"
while IFS= read -r plugin; do
test ! -e "$HOME/.dsh/vendor/$plugin"
done < "$repository_directory/manifests/vendored-plugins.txt"
printf 'isolated install/uninstall test passed\n'