Skip to content

Add Linux versioned-upgrade E2E (blue-green happy + rollback)

Placeholder ppxd requested to merge test/tentacle-versioned-upgrade-e2e into main

Summary

Real-systemd E2E coverage for the blue-green (versioned-layout) upgrade path shipped in #403 — the rigorous runtime proof that the failure-isolation guarantee holds, not just the unit/drift assertions.

  • LinuxServiceFixture.InstallVersionedAndStart — stages a v1 service in the versioned layout (versions/<v1>/Squid.Tentacle + current symlink, unit ExecStart through the pointer, no INSTALL_DIR env so the service auto-resolves to its own version dir). Additive — the flat InstallAndStart is untouched.
  • Test service version subcommand resolves version.txt relative to its own directory (like a real binary reporting its embedded version) instead of via the INSTALL_DIR env var. Backward-compatible for flat installs (own dir == install dir); the flat lifecycle tests never invoke version through a name symlink, so they are unaffected.
  • Two tests:
    1. Happy path — current repoints v1→v2, versions/<v1> is byte-for-byte unchanged (SHA256 captured before/after), v2 per-version marker written, service active.
    2. Health-fail rollback — exit 4 / ROLLED_BACK, current repointed back to v1, v1 byte-for-byte unchanged, service running v1 again.

Test plan

  • bash -n on the modified test service script.
  • Linux E2E project compiles clean (new test class + fixture method).
  • CI Linux runner executes the two UpgradeLifecycle-category E2E tests (real systemd + scope + restart + /healthz + symlink repoint). Local mac skips them (LinuxLifecycleContext.IsAvailable is false without systemd).

Notes

  • Non-breaking: purely test-infrastructure + a new test class. No production code changes.
  • Follow-ups (separate): Windows versioned-upgrade E2E (needs a version-reporting test shim), same-version re-upgrade edge cleanup, version GC (P4).

Merge request reports

Loading