diff --git a/tools/lab/dirty-upgrade b/tools/lab/dirty-upgrade index be5eb34..8c79c96 100755 --- a/tools/lab/dirty-upgrade +++ b/tools/lab/dirty-upgrade @@ -13,6 +13,8 @@ # tools/lab/dirty-upgrade [NEW.deb] [OLD.deb] # CHECK_ARGS=--restart tools/lab/dirty-upgrade ask twice, either side # of a logout +# tools/lab/dirty-upgrade NEW.deb dist/ekklesia-classroom_0.2.2_amd64.deb +# the day the desktops move from 0.2.2 # # The container is restarted between the install and the session, because # a room takes its upgrade and reboots. @@ -38,13 +40,30 @@ docker exec "$NAME" sh -c ' # backports for Hyprland. The lab is not testing that. systemctl mask ekklesia-classroom-provision.service >/dev/null 2>&1' +# Which version is installed, fully configured, or the rehearsal stops. +# Every step below is a question about one particular release, and a +# step that quietly left the machine on another one answers for the +# wrong release — which is how the 0.2.2 rehearsal once passed on 0.2.2. +require_installed() { + local want got + want=$(dpkg-deb --field "$1" Version) + got=$(docker exec "$NAME" dpkg-query -W -f='${Version} ${db:Status-Abbrev}' ekklesia-classroom 2>/dev/null || true) + echo " installed: $got" + + if [[ "$got" != "$want ii " ]]; then + echo " $(basename "$1") DID NOT INSTALL: [$got], wanted [$want ii]" >&2 + echo " Nothing after this would be a question about $want." >&2 + exit 1 + fi +} + step "the old classroom: $(basename "$OLD")" +# With apt, the way a room installs anything, so an old package's own +# dependencies are resolved rather than forced. docker exec "$NAME" sh -c " - DEBIAN_FRONTEND=noninteractive dpkg -i '/srv/classroom/${OLD#$ROOT/}' >/dev/null 2>&1 - DEBIAN_FRONTEND=noninteractive apt-get -y -qq -f install >/dev/null 2>&1 - DEBIAN_FRONTEND=noninteractive dpkg --configure ekklesia-classroom >/dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq '/srv/classroom/${OLD#$ROOT/}' >/dev/null 2>&1 true" || true -docker exec "$NAME" dpkg-query -W -f=' installed: ${Version}\n' ekklesia-classroom +require_installed "$OLD" step "and everything a used machine accumulates" docker exec -i "$NAME" bash <<'DIRT' @@ -164,14 +183,16 @@ DIRT step "the new classroom: $(basename "$NEW")" docker exec "$NAME" sh -c ' systemctl unmask ekklesia-classroom-provision.service >/dev/null 2>&1 || true' +# The way ekklesia-classroom-update installs it: apt, not dpkg. The +# package conflicts with khelpcenter since 0.2.6.2, and dpkg -i refuses a +# conflict where apt resolves it — so from 0.2.2 this step used to leave +# the machine on 0.2.2 and every check below was asked of the old release. docker exec "$NAME" sh -c " - DEBIAN_FRONTEND=noninteractive dpkg -i '/srv/classroom/${NEW#$ROOT/}' 2>&1 \ + DEBIAN_FRONTEND=noninteractive apt-get install -y '/srv/classroom/${NEW#$ROOT/}' 2>&1 \ | grep -E '^\[classroom-migrate\]' || true - DEBIAN_FRONTEND=noninteractive apt-get -y -qq -f install >/dev/null 2>&1 - DEBIAN_FRONTEND=noninteractive dpkg --configure ekklesia-classroom >/dev/null 2>&1 rm -f /usr/sbin/policy-rc.d true" || true -docker exec "$NAME" dpkg-query -W -f=' installed: ${Version} ${db:Status-Abbrev}\n' ekklesia-classroom +require_installed "$NEW" step "and the room reboots" "$LAB" reboot @@ -188,8 +209,9 @@ step "and again, installed a second time over itself" # An update that changes nothing must change nothing. The migration runs # again here, over a machine that is already converged. docker exec "$NAME" sh -c " - DEBIAN_FRONTEND=noninteractive dpkg -i '/srv/classroom/${NEW#$ROOT/}' >/dev/null 2>&1 + DEBIAN_FRONTEND=noninteractive apt-get install --reinstall -y -qq '/srv/classroom/${NEW#$ROOT/}' >/dev/null 2>&1 true" || true +require_installed "$NEW" before=$(docker exec "$NAME" sh -c 'cat /etc/ekklesia-classroom/device.conf | sha256sum') "$LAB" plasma-down >/dev/null "$LAB" plasma-up >/dev/null @@ -230,6 +252,14 @@ fi theme dark >/dev/null echo " back to $(theme show)" +step "and every desktop has the classroom's wallpaper, however it was made" +# Tiny Pebbles, 0.2.2 -> 0.2.6.4: a desktop Plasma made after the layout +# had run came up with Plasma's own wallpaper, and nothing here noticed, +# because every session this rehearsal started had its screen from the +# beginning. This makes Plasma build one by itself, and puts Tiny +# Pebbles' own file in front of a shell restart. +"$ROOT/tools/lab/wallpaper-check" || converged=1 + step "and it still recovers" "$ROOT/tools/lab/recovery-check" || converged=1 diff --git a/tools/validate-trixie-release.sh b/tools/validate-trixie-release.sh index 91397ff..b4ef29f 100755 --- a/tools/validate-trixie-release.sh +++ b/tools/validate-trixie-release.sh @@ -117,6 +117,13 @@ CUSTOM_SETTING=preserve-me-too CONFIG sed -i "s/@CHANNEL@/${channel}/" /etc/ekklesia-classroom/device.conf previous_version="$(dpkg-query -W -f='${Version}' ekklesia-classroom)" + + # The release this is an upgrade FROM, proven rather than assumed: an + # install that silently did not happen makes every check below a + # check of a fresh install instead. + [[ "$previous_version" == "$(dpkg-deb --field "$previous" Version)" ]] + [[ "$(dpkg-query -W -f='${db:Status-Abbrev}' ekklesia-classroom)" == "ii " ]] + echo "installed the previous release, ekklesia-classroom $previous_version" fi run_logged candidate-install 1200 apt-get install -y -qq /packages/candidate.deb @@ -130,6 +137,7 @@ run_logged candidate-install 1200 apt-get install -y -qq /packages/candidate.deb # for ever. candidate_version="$(dpkg-deb --field /packages/candidate.deb Version)" [[ "$(dpkg-query -W -f='${Version}' ekklesia-classroom)" == "$candidate_version" ]] +[[ "$(dpkg-query -W -f='${db:Status-Abbrev}' ekklesia-classroom)" == "ii " ]] [[ "$(cat /usr/local/lib/ekklesia-classroom/VERSION)" == "$candidate_version" ]] echo "installed ekklesia-classroom $candidate_version${previous_version:+ over $previous_version}" @@ -584,6 +592,8 @@ APPLETS run_logged candidate-reinstall 900 \ apt-get install --reinstall -y -qq /packages/candidate.deb + [[ "$(dpkg-query -W -f='${Version} ${db:Status-Abbrev}' ekklesia-classroom)" \ + == "$candidate_version ii " ]] # An install that changes nothing must change nothing. for setting in LIVE_ENABLED AUDIO_OUTPUT UI_SCALE; do