Skip to content

feat(LinuxTentacleE2E): Phase 12.L.E.14 — exit-12 systemd-version-too-old guard

Placeholder ppxd requested to merge phase12.L.E.14-exit12-systemd-too-old into main

Summary

Pins the .sh's pre-flight v239+ systemd requirement (line 258, exit 12). Older-systemd hosts (RHEL 7 = v219, Ubuntu 18.04 = v237) reach this check before any Phase A work, get a clear error with the probed version + minimum requirement, and exit cleanly.

Why ship-blocking

Without this test, a regression that:

  • moves the version check after Phase A's download work,
  • changes the comparison threshold, OR
  • drops the operator-actionable "systemd v239+ required" error

ships silently. Older-systemd operators would see the upgrade fail mid-Phase-B at the systemd-run --scope handoff with a confusing systemd-internal error instead of the early exit + clear "your host needs systemd v239+" diagnostic.

Test mechanism

PATH-prepend a private temp dir containing a fake systemctl shim:

#!/bin/bash
if [ "$1" = "--version" ]; then
  echo "systemd 200"
  exit 0
fi
exec /usr/bin/systemctl "$@"

The .sh's probe at line 255 reads "200", the lt-239 check fires at line 256, exit 12 + error at line 258.

Why this is genuinely a real-world test, not a mock

The shim returns the EXACT version string systemd 200 that an actual RHEL 7 host would emit. The .sh's probe parses it the same way it parses real systemd output. The only "fake" is the v200 number — which IS what we're testing the boundary against.

Assertions

  • exitCode == 12 (per .sh line 258)
  • stdout contains "systemd v239+ required" (operator-actionable text)
  • stdout contains "v200" (echoes probed version so operators verify)
  • stdout does NOT contain "=== Squid Tentacle upgrade ===" (Phase A banner — proves exit 12 fires BEFORE Phase A starts)
  • stdout does NOT contain "Pre-flight: probing" (proves no download probe — version check is the first guard, before any network IO)

Infrastructure additions

RunUpgradeScript(script, prependPath = null) — optional parameter prepends a directory to PATH for the bash invocation. Backward-compatible (default null = no change; existing 14 tests continue to work).

Fidelity tier

🟢 High (Rule 12.4): real prod .sh + real bash + real PATH-injection. The only "fake" is a 5-line shim returning the v200 boundary the production check exists to detect.

Expected runtime: <1s (no Phase A, no Phase B, just version probe + exit).

Test plan

  • Linux E2E workflow runs Squid.LinuxTentacleE2ETests (manual workflow_dispatch after merge)
  • E1uSystemdVersionTooOld_ExitsTwelveWithSystemdVersionError passes within ~1s
  • No regression on existing 14 Linux E2E tests

🤖 Generated with Claude Code

Merge request reports

Loading