Files
coredesktop/smoketest/scenarios/30-upgrade-from-baseline.sh
T
davidandClaude Opus 5.5 061121226d
shellcheck / shellcheck (push) Failing after 18s
smoketest: 30 gets the older installers past GNOME's dialog and polkit
ca658dc installs extensions with plain gext install, which waits for a
GNOME Shell dialog no one clicks; add --filesystem, as HEAD does. ca658dc
and d8d93a4 run flatpak install as the user, which polkit refuses over
SSH; allow it for the install only, with a rule removed afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 09:04:18 -07:00

53 lines
2.1 KiB
Bash

#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="install an older commit, update to the commit under test: same machine as a fresh install"
IMAGE=base
TIER="nightly"
mapfile -t VARIANTS < <(sed 's/#.*//' "$(dirname "${BASH_SOURCE[0]}")/../baselines" | awk 'NF { print $1 }')
scenario() {
[ -f "$(reference_fingerprint)" ] \
|| skip "needs the fingerprint 10-fresh-install saves; run both in the same run"
local sha
sha="$(git -C "$SMOKETEST_REPO" rev-parse "$VARIANT^{commit}")"
upstream_set "$sha"
# Older installers can't finish here as they did on a real machine. Install
# those baselines with fixes on top, then put the clone back at the baseline
# itself, as on a machine installed back then: update pulls --ff-only.
# - The source-built herdr pins a zig version Arch has moved on from;
# herdr-bin provides herdr, and is what HEAD installs instead
# - Plain gext install asks GNOME Shell, which shows a dialog no one clicks;
# --filesystem doesn't ask, and is what HEAD does
upstream_commit "Smoketest: fixes to install this baseline in a VM" '
sed -i "s/^\([[:space:]]*\)herdr$/\1herdr-bin/" packages.conf
sed -i "s|gext install|gext --filesystem install|" gnome/gnome-extensions.sh
git diff --quiet && exit 0'
# Older installers also run flatpak install as the user, which polkit allows
# at the desktop (or asks there) but refuses over SSH. HEAD uses sudo
run_in_vm allow-flatpak "printf '%s\n' \
'polkit.addRule(function(action, subject) {' \
' if (action.id.indexOf(\"org.freedesktop.Flatpak.\") == 0 && subject.user == \"'\"\$USER\"'\")' \
' return polkit.Result.YES;' \
'});' | sudo tee /etc/polkit-1/rules.d/00-smoketest-flatpak.rules"
assert_status 0
cd_install
assert_status 0
run_in_vm reset "sudo rm /etc/polkit-1/rules.d/00-smoketest-flatpak.rules
git -C ~/.local/share/coredesktop reset -q --hard $(q "$sha")"
assert_status 0
vm_reboot
upstream_set "$SMOKETEST_REF"
cd_update
assert_status 0
vm_reboot
health
fingerprint "$SMOKETEST_RESULTS/updated.fingerprint"
assert_same_fingerprint "$(reference_fingerprint)" "$SMOKETEST_RESULTS/updated.fingerprint"
}