#!/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 ask for packages that no longer build. Install those # baselines with a fix 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 if git -C "$SMOKETEST_REPO" show "$sha:packages.conf" | grep -qx '[[:space:]]*herdr'; then upstream_commit "Smoketest: herdr-bin for herdr" ' sed -i "s/^\([[:space:]]*\)herdr$/\1herdr-bin/" packages.conf' fi cd_install assert_status 0 run_in_vm reset "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" }