summaryrefslogtreecommitdiff
path: root/tests/test-desktop-branding-migration.sh
diff options
context:
space:
mode:
authortranch <tranch.xiao@gmail.com>2026-09-13 19:18:04 +0800
committertranch <tranch.xiao@gmail.com>2026-09-13 19:18:04 +0800
commit796c6c8a70c92d4675df7c2ec2d25ecda139d723 (patch)
tree06c6d3e7788d7b2ad5ddd0565e2651c0c8d9d151 /tests/test-desktop-branding-migration.sh
parentab070aec5f1d760a2539e14cb19da61593bded15 (diff)
parentd734f2c746632772b794143762f2fcea78e62011 (diff)
downloadAeroCore-OS-796c6c8a70c92d4675df7c2ec2d25ecda139d723.tar.gz
AeroCore-OS-796c6c8a70c92d4675df7c2ec2d25ecda139d723.zip
Merge testing into main for 44.x stable release44.20260913
Diffstat (limited to 'tests/test-desktop-branding-migration.sh')
-rwxr-xr-xtests/test-desktop-branding-migration.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/test-desktop-branding-migration.sh b/tests/test-desktop-branding-migration.sh
new file mode 100755
index 0000000..4715010
--- /dev/null
+++ b/tests/test-desktop-branding-migration.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+test_root="$(mktemp -d -t aerocore-desktop-branding.XXXXXXXXXX)"
+trap 'rm -rf "${test_root}"' EXIT
+
+mkdir -p \
+ "${test_root}/var/home/stock/.config" \
+ "${test_root}/var/home/custom/.config"
+
+printf '%s\n' 'icon=distributor-logo-steamdeck' \
+ > "${test_root}/var/home/stock/.config/plasma-org.kde.plasma.desktop-appletsrc"
+printf '%s\n' 'icon=user-selected-logo' \
+ > "${test_root}/var/home/custom/.config/plasma-org.kde.plasma.desktop-appletsrc"
+
+HOME="${test_root}/var/home/stock" \
+ bash "${repo_root}/system_files/usr/libexec/aerocore-desktop-branding"
+
+grep -Fxq 'icon=aerocore-logo' \
+ "${test_root}/var/home/stock/.config/plasma-org.kde.plasma.desktop-appletsrc"
+grep -Fxq 'icon=user-selected-logo' \
+ "${test_root}/var/home/custom/.config/plasma-org.kde.plasma.desktop-appletsrc"
+
+# The migration must also be idempotent.
+first_digest="$(sha256sum \
+ "${test_root}/var/home/stock/.config/plasma-org.kde.plasma.desktop-appletsrc")"
+HOME="${test_root}/var/home/stock" \
+ bash "${repo_root}/system_files/usr/libexec/aerocore-desktop-branding"
+second_digest="$(sha256sum \
+ "${test_root}/var/home/stock/.config/plasma-org.kde.plasma.desktop-appletsrc")"
+test "${first_digest}" = "${second_digest}"
+
+for path in \
+ bazzite.webm \
+ bazzite-oled.webm \
+ bazzite-suspend.webm \
+ bazzite-suspend-oled.webm; do
+ grep -Fq "${path}" "${repo_root}/build_files/build.sh"
+done
+
+# The About System logo may be a symlink in the Bazzite base image. Both image
+# build paths must explicitly replace that directory entry with AeroCore's PNG.
+grep -Fq '"/usr/share/pixmaps/system-logo-white.png"' \
+ "${repo_root}/build_files/build.sh"
+grep -Fq 'rm -f /usr/share/pixmaps/system-logo-white.png' \
+ "${repo_root}/installer/build.sh"
+
+# Branding migration is user setup, not a system boot service.
+if rg -n 'aerocore-desktop-branding\.service|systemctl enable aerocore-desktop-branding' \
+ "${repo_root}/build_files" "${repo_root}/system_files"; then
+ echo "Desktop branding must not be enabled as a system service" >&2
+ exit 1
+fi
+test ! -e "${repo_root}/system_files/usr/lib/systemd/system/aerocore-desktop-branding.service"
+test -x "${repo_root}/system_files/usr/libexec/aerocore-desktop-branding-privileged"
+
+echo "Desktop branding migration fixture passed"