test: every rehearsal installs with apt and proves which version landed
The dirty-upgrade lab installed the new package with dpkg -i. Since 0.2.6.2 the package conflicts with khelpcenter, which dpkg refuses and apt resolves, so the 0.2.2 rehearsal left the machine on 0.2.2 and asked every question of the old release. Old package, new package and the reinstall now all go through apt, as ekklesia-classroom-update does, and each stops the run unless dpkg reports exactly that version, fully installed. The container gate asserts the same of its previous release and its reinstall. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9fc86f9d4c
commit
6c04f743ed
+39
-9
@@ -13,6 +13,8 @@
|
|||||||
# tools/lab/dirty-upgrade [NEW.deb] [OLD.deb]
|
# tools/lab/dirty-upgrade [NEW.deb] [OLD.deb]
|
||||||
# CHECK_ARGS=--restart tools/lab/dirty-upgrade ask twice, either side
|
# CHECK_ARGS=--restart tools/lab/dirty-upgrade ask twice, either side
|
||||||
# of a logout
|
# 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
|
# The container is restarted between the install and the session, because
|
||||||
# a room takes its upgrade and reboots.
|
# 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.
|
# backports for Hyprland. The lab is not testing that.
|
||||||
systemctl mask ekklesia-classroom-provision.service >/dev/null 2>&1'
|
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")"
|
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 "
|
docker exec "$NAME" sh -c "
|
||||||
DEBIAN_FRONTEND=noninteractive dpkg -i '/srv/classroom/${OLD#$ROOT/}' >/dev/null 2>&1
|
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq '/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
|
|
||||||
true" || true
|
true" || true
|
||||||
docker exec "$NAME" dpkg-query -W -f=' installed: ${Version}\n' ekklesia-classroom
|
require_installed "$OLD"
|
||||||
|
|
||||||
step "and everything a used machine accumulates"
|
step "and everything a used machine accumulates"
|
||||||
docker exec -i "$NAME" bash <<'DIRT'
|
docker exec -i "$NAME" bash <<'DIRT'
|
||||||
@@ -164,14 +183,16 @@ DIRT
|
|||||||
step "the new classroom: $(basename "$NEW")"
|
step "the new classroom: $(basename "$NEW")"
|
||||||
docker exec "$NAME" sh -c '
|
docker exec "$NAME" sh -c '
|
||||||
systemctl unmask ekklesia-classroom-provision.service >/dev/null 2>&1 || true'
|
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 "
|
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
|
| 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
|
rm -f /usr/sbin/policy-rc.d
|
||||||
true" || true
|
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"
|
step "and the room reboots"
|
||||||
"$LAB" reboot
|
"$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
|
# An update that changes nothing must change nothing. The migration runs
|
||||||
# again here, over a machine that is already converged.
|
# again here, over a machine that is already converged.
|
||||||
docker exec "$NAME" sh -c "
|
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
|
true" || true
|
||||||
|
require_installed "$NEW"
|
||||||
before=$(docker exec "$NAME" sh -c 'cat /etc/ekklesia-classroom/device.conf | sha256sum')
|
before=$(docker exec "$NAME" sh -c 'cat /etc/ekklesia-classroom/device.conf | sha256sum')
|
||||||
"$LAB" plasma-down >/dev/null
|
"$LAB" plasma-down >/dev/null
|
||||||
"$LAB" plasma-up >/dev/null
|
"$LAB" plasma-up >/dev/null
|
||||||
@@ -230,6 +252,14 @@ fi
|
|||||||
theme dark >/dev/null
|
theme dark >/dev/null
|
||||||
echo " back to $(theme show)"
|
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"
|
step "and it still recovers"
|
||||||
"$ROOT/tools/lab/recovery-check" || converged=1
|
"$ROOT/tools/lab/recovery-check" || converged=1
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,13 @@ CUSTOM_SETTING=preserve-me-too
|
|||||||
CONFIG
|
CONFIG
|
||||||
sed -i "s/@CHANNEL@/${channel}/" /etc/ekklesia-classroom/device.conf
|
sed -i "s/@CHANNEL@/${channel}/" /etc/ekklesia-classroom/device.conf
|
||||||
previous_version="$(dpkg-query -W -f='${Version}' ekklesia-classroom)"
|
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
|
fi
|
||||||
|
|
||||||
run_logged candidate-install 1200 apt-get install -y -qq /packages/candidate.deb
|
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.
|
# for ever.
|
||||||
candidate_version="$(dpkg-deb --field /packages/candidate.deb Version)"
|
candidate_version="$(dpkg-deb --field /packages/candidate.deb Version)"
|
||||||
[[ "$(dpkg-query -W -f='${Version}' ekklesia-classroom)" == "$candidate_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" ]]
|
[[ "$(cat /usr/local/lib/ekklesia-classroom/VERSION)" == "$candidate_version" ]]
|
||||||
echo "installed ekklesia-classroom $candidate_version${previous_version:+ over $previous_version}"
|
echo "installed ekklesia-classroom $candidate_version${previous_version:+ over $previous_version}"
|
||||||
|
|
||||||
@@ -584,6 +592,8 @@ APPLETS
|
|||||||
|
|
||||||
run_logged candidate-reinstall 900 \
|
run_logged candidate-reinstall 900 \
|
||||||
apt-get install --reinstall -y -qq /packages/candidate.deb
|
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.
|
# An install that changes nothing must change nothing.
|
||||||
for setting in LIVE_ENABLED AUDIO_OUTPUT UI_SCALE; do
|
for setting in LIVE_ENABLED AUDIO_OUTPUT UI_SCALE; do
|
||||||
|
|||||||
Reference in New Issue
Block a user