Files
coredesktop/smoketest/scenarios/30-upgrade-from-baseline.sh
T
davidandClaude Opus 5.5 a72835e866
shellcheck / shellcheck (push) Failing after 15s
smoketest: get ca658dc and d8d93a4 installed; fingerprint all of .bashrc
30's fix-up commit now also adds clang and cmake, without which voxtype
no longer builds from source (later commits install them), and stops
ca658dc's bitwarden.sh failing on its unset LINE under the set -u that
install-kickstart-nvim.sh leaves on.

The fingerprint recorded only the line numbers of .bashrc's coredesktop
lines, so 0c0ddf5's showed a line moved without saying what was added.
Record the whole file, sorted.

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

60 lines
2.6 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
# - voxtype from source no longer links without clang and cmake, which later
# commits (and HEAD) install
# - install.sh sources install-kickstart-nvim.sh, whose set -u then stops
# bitwarden.sh on its unset LINE; without set -u, that line did nothing
upstream_commit "Smoketest: fixes to install this baseline in a VM" '
sed -i "s/^\([[:space:]]*\)herdr$/\1herdr-bin/" packages.conf
grep -qx "[[:space:]]*clang" packages.conf \
|| sed -i "s/^\([[:space:]]*\)voxtype$/\1clang\n\1cmake\n\1voxtype/" packages.conf
sed -i "s|gext install|gext --filesystem install|" gnome/gnome-extensions.sh
sed -i "s/\"\$LINE\"/\"\${LINE:-}\"/g" bitwarden.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"
}