Skip to content

Add an upgrade scenario to the installer test suite - #9

Open
tashian wants to merge 1 commit into
mainfrom
carl/pre-170-installer-upgrade-test
Open

Add an upgrade scenario to the installer test suite#9
tashian wants to merge 1 commit into
mainfrom
carl/pre-170-installer-upgrade-test

Conversation

@tashian

@tashian tashian commented Sep 2, 2026

Copy link
Copy Markdown
Member

Name of feature:

Upgrade scenario in scripts/test-smallstep-agent-installer.sh.

Pain or issue this feature alleviates:

The suite only ever did a fresh install, so a package whose install scriptlet is skipped on upgrade looked fine. PRE-170: pacman never runs step-agent's post_install on upgrade because the package defines no post_upgrade (fix: smallstep/agent#1214).

Each container now runs two scenarios from scripts/installer-scenarios.sh, mounted alongside the installer:

  1. install — fresh install of the latest stable release; asserts the installed version.
  2. upgrade — downgrade to the previous stable release, delete a probe only the scriptlet produces, run the installer again; passes only if the package is at the latest version and the probe is back.

The probe is /etc/systemd/system/step-agent.service.d/tss.conf, which no package-manager hook recreates (the step-agent user and /run/step-agent are recreated by pacman's own sysusers/tmpfiles hooks and wrongly passed an earlier attempt). The tss group is created up front so the probe applies on every distro. Versions come from stable/step-agent/linux/index.json; UPGRADE_FROM=<ver> overrides the starting point.

Two container concessions, both commented in the scripts: a no-op systemctl is in place only while the previous release is laid down (0.68.0's scriptlets call it unguarded and abort in a systemd-less container), and the checkout is mounted as a directory because Docker Desktop keeps serving a stale copy through a single-file bind mount after the file is rewritten.

Current results (stable 0.69.2, upgrade from 0.68.0):

Distro install upgrade
debian:latest pass pass
ubuntu:latest pass pass
archlinux:base pass fail — PRE-170, goes green once smallstep/agent#1214 ships to stable
fedora:latest, redhat/ubi9 pass fail — 0.68.0's rpm %preun has no upgrade guard and rpm runs it after the new %post, so it deletes the drop-in (and disables the swtpm units). A defect in the shipped 0.68.0 package, not in the suite; goes green once the previous stable is 0.69.2+

Supporting links/other PRs/issues:

  • smallstep/agent#1214
  • PRE-170, PRE-171 (pacman repo work that turns the latent bug into an active one)

After merge, bump the step-agent submodule pointer in packages.smallstep.com.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BzF6nFCdBJVudxRXYuGoCX

The suite only ever did a fresh install, so a package whose install
scriptlet is skipped on upgrade looked fine (PRE-170: pacman never runs
step-agent's post_install on upgrade because the package defines no
post_upgrade).

Each container now runs two scenarios from a helper mounted alongside
the installer: a fresh install of the latest stable release, then a
downgrade to the previous stable release, deletion of a probe that only
the scriptlet produces, and a second run of the installer. The upgrade
passes only if the package is at the latest version and the probe is
back. The probe is the tss SupplementaryGroups drop-in, which no
package-manager hook recreates; the tss group is created up front so it
applies on every distro. Versions come from the stable manifest tree;
UPGRADE_FROM overrides the starting point.

Older packages call systemctl unguarded from their scriptlets and fail
in a container without systemd, so a no-op systemctl is put in place
only while the previous release is laid down and removed before the
upgrade under test runs.

The checkout is mounted as a directory rather than per file: a
single-file bind mount is pinned to its original inode and Docker
Desktop keeps serving the stale copy after the file is rewritten.

Current results against stable 0.69.2 from 0.68.0: debian and ubuntu
pass both scenarios; archlinux fails the upgrade (PRE-170, fix in
smallstep/agent); fedora and EL fail the upgrade because 0.68.0's rpm
%preun tears the drop-in down after the new %post has run, which is
a defect in the shipped 0.68.0 package rather than in this suite.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BzF6nFCdBJVudxRXYuGoCX
@tashian
tashian enabled auto-merge September 2, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant